Losing serial data with sertxd

system11

Member
Setup: picaxe development board, 40X2 chip, very simple circuit/code that just reads data from a ROM chip and writes it out with sertxd one byte at a time.

Problem: at 8mhz / 9600 baud, it's "kind of" stable, it's very easy to interrupt the data flow and lose a few bytes. At 16mhz it loses many more bytes of data. I know the data is being read correctly from the chip and it's down to the actual serial connection, does anyone have any suggestions on how to fix this? It takes a VERY long time to run at 9600 baud, and since this is a device for dumping 'slightly faulty' ROM chips I don't want them being operated for hours when it could be minutes. I've tried adding pauses here and there and it basically makes no difference at all.
 

AllyCat

Senior Member
Hi,

You haven't indicated to what/where you're transmitting the bytes. But if it's to another PICaxe then that very probably will struggle.

If you're transmitting to a PC or similar, then it could be much faster to transmit using HSEROUT. However, I still doubt if you will be able to reduce a similar number of "hours to minutes".

Cheers, Alan.
 

system11

Member
Oh just to my laptop using the AXE027 cable. Unfortunately the project is now "over" as I've found the bad chip I'm trying to read, can't be read by this either - it's going to have to go to a data recovery specialist. What I built worked, slowly, but it doesn't solve the problem. At least it was a bit of fun.
 

inglewoodpete

Senior Member
It's not clear to me what is happening on the input side of the 40X2. How is the data being read from a ROM chip? Is it a data transfer that can be corrupted if the 40X2 is doing something else of higher priority as the ROM data arrives?

A few years ago, I had a situation where I was trying to debug an incoming serial data stream that was arriving via background serial reception. I was using SerTxd to send some of the data to the PE's terminal window for debugging. At the time, I was not aware that SerTxd sends serial data using bit-banging (without using an internal UART). To send async data, the PICAXE has to stop all internal interrupts in order to keep strict bit times for SerTxd. This resulted in the chip being unable to respond to any interrupts related to the incoming data stream and losing incoming data.
 
Top