I can't get any serial ouput from my usart?
#chip 16F688, 8 'mhz #config OSC=INTOSC, MCLRE=off, WDT=off #define USART_BAUD_RATE 2400 '……..or the value you want #define USART_BLOCKING InitUsart On Interrupt UsartRX1Ready call serial_in lcdcon = 0
dim serdata as byte dim temp as byte
Dir portc.5 in Dir portc.4 out Dir portc.1 out
main: epread 1, temp if temp = 1 then set portc.1 on HSerPrint "a" end if
if temp = 0 then set portc.1 off HSerPrint "b" end if goto main
sub serial_in If RCIF On Then serdata = RCREG temp =serdata temp=temp-97 epwrite 1, temp End sub
Log in to post a comment.
I can't get any serial ouput from my usart?
#chip 16F688, 8 'mhz
#config OSC=INTOSC, MCLRE=off, WDT=off
#define USART_BAUD_RATE 2400 '……..or the value you want
#define USART_BLOCKING
InitUsart
On Interrupt UsartRX1Ready call serial_in
lcdcon = 0
dim serdata as byte
dim temp as byte
Dir portc.5 in
Dir portc.4 out
Dir portc.1 out
main:
epread 1, temp
if temp = 1 then
set portc.1 on
HSerPrint "a"
end if
if temp = 0 then
set portc.1 off
HSerPrint "b"
end if
goto main
sub serial_in
If RCIF On Then serdata = RCREG
temp =serdata
temp=temp-97
epwrite 1, temp
End sub