Software Serial

A project log for My CP/M Version 1A

I decided to do a minor upgrade to My CP/M (Version 1). Swap RST6.5 for RST7.5 and increase the FRAM disk capacity from 32k to 256k.

agp.cooperagp.cooper 07/15/2020 at 03:100 Comments

Software Serial

When I wrote the software serial code I realised that it could not handle back to back bytes (at 9600 baud) as there is only 30us spare. I am using a 5MHz clock (i.e. 10MHz crystal). That is, there is no time to echo or do anything else. It was not considered a problem for a human typist however. Still, receiving while sending is still a problem.

But at the time, it was good enough.

I do have a problem however as the flash disk write is timing sensitive (should not be interrupted for more than 200us). It takes 948uS to write the sector (128b) and 1047us (less 30us) to read a serial byte. An impossible position.

Yes, I have looked at using and UART and it is coming, but after sorting out the Flash disks. I do not want to make too many changes at one time.

An option is to use software serial handshake (i.e. XON/XOFF). That is stop serial input during a flash critical disk write (and/or serial output).

Rather than trying to fix these problems, I am just living with it until I move to an UART.

It properly fix these issues in software, an interrupt timer is required.

The lesser of two (or more) evils is to disable interrupts during serial write or flash disk write.