Why doesnt this code work correct?
Pic16f628 @ 4mhz
DEFINE OSC 4
on interrupt goto myint
intcon = %10010000
loop:
pause 1
goto loop
disable
myint:
serin2 portb.1, 396, [wait("IB")]
INTCON.1 = 0
resume
enable
The problem is that when i send "IB" from the computer to the pic it hangs up in the Serin2 myint part and doesnt move along before it receive another "IB". It seems like it miss the first "IB" I sent, and then Serin waits for the computer to send "IB" again... Does the interrput command take to long time so it wont catch the first bit or something?
I'm quite noob and my english sux so please explain it easy
Edit: Sorry i duplicated the post, how do i delete it :P ?
Bookmarks