Question about FullDuplexSerial (from obex by Chip Gracey, Jeff Martin)
marzec309
Posts: 146
Hi guys,
At the risk of looking stupid . I'm have a little problem with a chunk of code.
At the risk of looking stupid . I'm have a little problem with a chunk of code.
repeat 6 outa[16]~~ outa[16]~ repeat until tmp1 >= $00 outa[3]~~ outa[3]~ repeat waitcnt(cnt + clkfreq / 10000) until ser.rxcount > 0 tmp1 := ser.rx Buff[tmp0] := tmp1 tmp0++I can't seem to hold the program in the inner most loop " repeat until ser.rxcount > 0" It doesn't seem to matter how I code it. the program will jump the loop after 1mS. Even with out the waitcnt it still jumps ship :frown:. I'm trying to wait for a 6 byte serial stream, that is on a 50mS interval. If I could just sync to this serial packet, I would have a bunch of time for other fun stuff. Any ideas what I'm doing wrong?
Comments
Also, you're using tmp1 >= $00 which isn't a comparison (greater or equal). In SPIN that's an assignment (like +=). You want tmp1 => $00.
Thanks
For the sake of it I added an rxcount method and ran this test Which stays in that loop until I press a key.
Does your serial link work otherwise, i.e. do you get what you expect from normal interactions with a terminal?
thanks Kuroneko