I tried to set up a simple serial communication (9600,8,n,1) between my AtMega88 and a serial device.
First I tested the device using Hyperterm on the PC - everything works fine.
Since the device requests a >CR< after the command (no >LF<) I cannot use >print #1<, but instead >printbin #1<.
I learned that >Print #1< always will send a sequence >CR LF< at the end.
To receive the answer from the device I use >inkey #2< in a loop immediately after.
What happens is that I lose the first up to 10 bytes, but the following bytes are correctly received.
To check whether all bytes are sent correctly from the device I connected the terminal in parallel and indeed they are properly sent.
I am aware that there is no receive buffer for the software UART, but I think it should be possible to correctly receive at 9600 Baud?
Also I saw that the start-up message of the device is always correctly received in case the receiving loop is started before switching ON the device.
Is it possible that there is a delay after sending a command with printbin #1?
[b:4585649bd3][color=red:4585649bd3](BASCOM-AVR version : 2.0.7.6 )[/b:4585649bd3][/color:4585649bd3]
↧