|
Forum Index : Microcontroller and PC projects : Framing errors in TXD C-Sub...
| Author | Message | ||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9748 |
Hi - does anyone have any idea why I would be getting framing errors from the TXD C-Sub? It always produces framing errors in the FIRST string I send, following being in the editor. So, you save your changes in the editor, exit to the console, run the program, and the first string you send to the TXD C-Sub has at least one framing error in it, which causes the connected device to fail. Following that, there are no framing errors again - till you next enter the editor, change something and save-and-exit again. Here is a link to a GIF of the logic-analyser output. The start byte in this case, is supposed to be 0x7E, but it seems to have one extra unwanted high/low transitional bit in there between 0x7E and 0xFF - the next byte.(marked by the analyser as a red X symbol) Note how if you send strings via the C-Sub AFTER the first one, there are no framing errors - see the debug output on the bottom-right of the analyser screen-shot, where you can see that the next string of bytes starting with 0x7E is fine. QUESTION: When using the TXD C-Sub, should you setup the I/O pin as an output, or leave it un-configured? I currently am NOT configuring it, leaving that to the C-function to do. QUESTION: When using the TXD C-Sub, do I need to externally pull-up the data line? I am going to add a 4k7 pull-up shortly just to see if that helps at all. Currently playing around with a 170 MM2 chip. MMBASIC version 5.02. I can try the serial on the native COM port, but I NEED this to work on the C-Sub serial port, as I have already assigned the hardware COM ports to other things, and swapping them around now is not possible - the PCB's have already been made. EDIT: Have added a 4k7 pull-up to 3v3 on the TXD C-Sub pin - makes no difference to the framing errors. I will try the native COM port just to see if the problem vanishes or not. Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9748 |
Dammit! I think it might have been ME doing this..... I had the logic analyser set to 25ks/s. Baud-rate is 9600. Analyser sample-rate might have been too slow? I would like to know if that was perhaps the case, if someone can say one way or the other. I have set the analyser to 250ks/s, and the framing errors are gone from the analyser output now.... The experiment continues..... Smoke makes things work. When the smoke gets out, it stops! |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
The CSub does set the pin as an output but it might help to do it in code before launching the CSub as that would avoid any glitches at the start when the CSub does it. Try something like this: PIN(10) = 1 ' make sure that pin 10 starts high SETPIN 10, DOUT SerialTx 10, 19200, "Hello World" This assumes that you are using pin 10 for Tx. Geoff Geoff Graham - http://geoffg.net |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |