Are you sure the polarity of the data was correct?, remember the MAX232 inverts it - and are you sure the baud rate was set correctly?. Both of these will give weird characters.
Are you sure the polarity of the data was correct?, remember the MAX232 inverts it - and are you sure the baud rate was set correctly?. Both of these will give weird characters.
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Yes, the baud rate was set correctly as follows in software.
TXBYTE MOVWF BYTE ;save table value to BYTE
MOVLW 0x08
MOVWF BITCNT ;do eight times
BCF TXPIN ;SEND START BIT
CALL Bit_Delay ;delay 104 instruction cycles
;assuming 4MHz clock, that's 1us per instruction cycle
;so delaying 104us
TXLOOP RRF BYTE,F ;move BYTE bit0 into carry
BTFSS STATUS, C ;a Low ?
BCF TXPIN ;yes, send it
BTFSC STATUS, C ;a High?
BSF TXPIN ;yes, send it
CALL Bit_Delay
DECFSZ BITCNT
GOTO TXLOOP ;loop for 7 more times
BSF TXPIN ;SEND STOP BIT
CALL Bit_Delay
RETURN
People perish because of lack of knowledge
sorry about the above post, the 104us delay is generated as follows, I have simulated the program using mplab and the timing is correct.
Bit_Delay
MOVLW 0x21
MOVWF DELAYCNT
DELAYLOOP
DECFSZ DELAYCNT ;one cycle if DELAYCNT
GOTO DELAYLOOP ;two cycles
RETURN
People perish because of lack of knowledge
My code snippets are not coming out clearly, what do I do?
People perish because of lack of knowledge
Surround them with the 'Code' tags, click on the 'Advanced' button where it's an option.Originally Posted by emufambirwi
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
I did not receive a comment on my delay, is it ok
People perish because of lack of knowledge
I didn't check it, just use the one from my tutorial which is known to work (uses a 4MHz clock).Originally Posted by emufambirwi
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
How do I invert the data again in software?Originally Posted by Nigel Goodwin
People perish because of lack of knowledge
Switch the BCF's and BSF's in the transmit routine - don't forget the start and stop bits as well.Originally Posted by emufambirwi
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
ok thanks, feedback later
People perish because of lack of knowledge