04-29-2004, 02:18 PM
I've been trying very hard to write a serial interface to an AVR microcontroller. The AVR code is ok, because it works well with a terminal emulator. But my Qbasic code has a problem. Sometimes, the two bytes of the interger are swapped around, ie the AVR sends say 0x0a and 0x44 but it displays on my program the other way, 0x44 and 0x0a.
I'm using GET #1, , buff%(t%) to receive.
If I fiddle with the size of the 'buff' array, the problem may swap back. I was thinking there may be a character left in a buffer somewhere that puts everything out of sync?
Please help!!!!!!
I'm using GET #1, , buff%(t%) to receive.
If I fiddle with the size of the 'buff' array, the problem may swap back. I was thinking there may be a character left in a buffer somewhere that puts everything out of sync?
Please help!!!!!!