I got to view my data output (in Realterm) after I got hyperterminal to display it once, and then didn't work the next time, and I'm pretty sure my baud rate was correct all along. However, the data I got didn't quite make sense. I tried capturing the output of the console program from which I can easily send the commands I want to the device (Brainstem Moto 1.0) that I am trying to communicate with, and also got data that did not quite make sense. My code...
-" while((SCI0SR1 & 0x80) == 0); //wait until the device is ready to transmit
g_temp = SCI0SR1;
SCI0DRL = 0x04;
while((SCI0SR1 & 0x80) == 0); //wait until the device is ready to transmit
g_temp = SCI0SR1;
SCI0DRL = 0x33;
while((SCI0SR1 & 0x80) == 0); //wait until the device is ready to transmit
g_temp = SCI0SR1;
SCI0DRL = 0x01;
while((SCI0SR1 & 0x80) == 0); //wait until the device is ready to transmit
g_temp = SCI0SR1;
SCI0DRL = 0x00; "
...gives me an output of "00 5F D6 FF 00"
Able to find no simple relation beween these, confused, I captured the output from the console program that came with the Brainstem.
I type: 4 51 1 0
The console: ">04:33,01,00"
On the terminal: "5F 99 FD FF 00"
again:
">04:40,0"
"DF 7F FF 00"
">04:3F,01,01,00,20"
"5F 5F FD FD FF BF 00"
I cannot figure out any simple, consistent relation between the signals I send and what displays on the terminal. I understand it may appear inverted since a 0 is high(5V) on the oscilloscope, but that cannot explain it. The only possible explaination that I can find is from the Brainstem's reference:
-"Since the baud rate generator has a limited number of possible rates, the actual baud rate will differ slightly from the desired baud rate. In some cases, this can effect communication with external serial devices. The desired baud rates and actual baud rates are listed below.
...2 9600 9615 +0.16%..."
I also remember that when I used the equation in the 9s12x's documentation, it came out to not exactly 9600.
Why am I getting this weird data that doesn't seem to match up? Could it be attributed to a tiny difference(<10bps) in actual baud rates?