Originally Posted by lerameur
I see the problem right away. Remember when I said that the receiver needs to be trained (take a bit of time and read back there somewhere)? Well, you're sending one character, waiting 100ms, then sending another, waiting another 100ms...etc.
That 100ms is WAYYYY too long. Change that pause to less than 5ms, and then look at your datastream at the receiver.
Try this-----
START:
serout portb.2, n2400, [ $aa, $aa, $aa, $aa, $aa ]
Pause 1
serout portb.2, n2400, [ $0F, $F0 ]
Pause 1
GOTO START
The 4 $AA's will take 16.6ms to transmit and probably won't match the transmitter output very well. Do not worry about that, it's ok, that's why we're training the receiver. It's completely normal.
After a few cycles, the $0F and $F0 should be clearly visible and practically match the transmitter output (because we've trained the receiver). The $0F and $F0 will take about 8.3ms to complete, then there will be a 1 ms pause, then the sequence will start over.
You should be able to see an obvious difference between the $AA's and the $0F and $F0.
This should work just fine. Let me know what happens...
JDG
Bookmarks