[NTLK] NCX problem

Matthias Melcher mm at matthiasm.com
Tue Aug 24 07:17:19 EDT 2010

On 24.08.2010, at 11:07, Simon Bell wrote:

>> I tried changing it to the PL2303 open source driver that I've been  
>> using
>> with my generic USB-Serial adapter, and got a crash when I closed the
>> preference dialog.
> There does seem to be a problem with the PL2303 driver. I don’t know  
> why -- NCX uses only POSIX calls to the serial device. Not having the  
> requisite hardware I can’t reproduce this crash but I shall see what I  
> can do...

The Newton hardware has issues when bursts of bytes come in at the full baud rate. It drops bytes once in a while which makes the connections unbearably slow or drops it alltogether. I believe the problem is related to checksum calculation at the end of a block.

On older PCs, "slowdown" can slow a PC sufficiently down to avoid the problem.

USB-to-serial adapters however don't necessarily transfer bytes when they arrive, but may actually wait for a buffer to fill and then send them in a burst. There are no POSIX calls that can keep this from happening, except maybe flushing, but that depends on the driver implementation.

The only way I found to avoid this issue is to use carful timing and send serial data in chunks, then not send any data until the USB driver's flushing sets in (unfortunately, it does not tell us, so we must guess). 

It would be possible to create some kind of statistics by sending data via USB adapter and receiving them on the same machine via built-in RS232 connector, then analyzing the delays. That of course would require the adapter in question and some time consuming work. 

 - Matthias

More information about the NewtonTalk mailing list