I'm trying to get my pic 16f818 to transmit characters to a serial LCD. When I use the same code on f84 chip it works fine. However, when I try it on a f818 it sends a different character. I used a logic analyzer to check out what's going on. It looks as if the start bit is longer on the f84. I thought by default it sent data 8N1 not matter what chip your using. Is there any defines I don't know about? Thanks for any help.
<font color=blue><b>You are calling on your serial output pin to go high.Code:INCLUDE "BS2DEFS.BAS" @ DEVICE INTRC_OSC_NOCLKOUT,MCLR_OFF DEFINE OSC 4 OSCCON=$60 ADCON1=6 <font color=red>HIGH PORTB.0</font color> sleep 2 low PORTA.2 begin: serout PORTB.0,N2400,[12] SLEEP 2 <font color=red>HIGH PORTB.0</font color> SEROUT2 PORTB.0,N2400, [68] SLEEP 2 LOW PORTA.2 goto begin
What's that about? Also you have used serout AND serout2, so yes you are using serout2, I suspect that's why skimask directed you to page 140. I am curious about the high portB.o command though. I would be inclined to eliminate it and do something like this</font color>
I am really curious as to why you would use INCLUDE "BS2DEFS.BAS" instead of INCLUDE "modedefs.bas" since you are using PICs and not Stamps.Code:SEROUT PortB.0,N2400,[254,128,"68"]
JS




Bookmarks