I have just started experementing with the pic 16f84a and I am having problems with serin.
when I use the following code only approx 16% of the time do I get the correct character outputed. the debug output works fine. I am using a max 232 and I have tried both normal and inverted modes but had even less sucess with inverted mode. I have looped back my serial and it woks ok. can someone please help?
' SERIN & SEROUT Commands
'
INCLUDE "modedefs.bas" ' Include serial modes
DEFINE OSC 4
DEFINE DEBUG_REG PORTA
DEFINE DEBUG_BIT 3
DEFINE DEBUG_BAUD 1200
DEFINE DEBUG_MODE 0
SI CON 9 ' Define serial in pin
B0 VAR BYTE
loop: SerIn SI,t1200,B0 ' B0 = input character
Debug "B0= ",B0
GoTo loop ' Forever
Bookmarks