FullDuplexSerial communication problems
Hello,
I am trying to get a propeller to send information to my computer using the FullDuplexSerial object. I created a simple test program just to see if I could send a word and receive it using the Python pySerial module. My Spin code is just:
When using the python library, I am receiving bytes where the second nibble is correct, but the first one is not. For the string test, I should receive the bytes:
0x74 0x65 0x73 0x74
However, if I set the serial port settings to 8 data bits, 1 stop bit, and no parity, I receive:
0xb4 0xb5 0xb3 0xb4
I get the same results using other terminals, including the parallax serial terminal. Does anyone have an idea as to what the problem might be?
I am trying to get a propeller to send information to my computer using the FullDuplexSerial object. I created a simple test program just to see if I could send a word and receive it using the Python pySerial module. My Spin code is just:
OBJ serial : "FullDuplexSerial" PUB Main serial.Start(31, 30, 0, 9600) repeat serial.str(string("test")) waitcnt(clkfreq + cnt)
When using the python library, I am receiving bytes where the second nibble is correct, but the first one is not. For the string test, I should receive the bytes:
0x74 0x65 0x73 0x74
However, if I set the serial port settings to 8 data bits, 1 stop bit, and no parity, I receive:
0xb4 0xb5 0xb3 0xb4
I get the same results using other terminals, including the parallax serial terminal. Does anyone have an idea as to what the problem might be?
Comments
One thing that you can do though for testing purposes is to adjust the baud in the prop code but still use 9600 on the PC side. So you could try 8800 or 10300 or other numbers 10 - 30 % off. I have found the internal oscillator to be off by 10% - 30%. Note, anything off by more that 10% by definition will not work for serial because they share clocks and there is 10 bits communicated in a serial transitional.
Rocky