Obscure bug: Failure when using USB serial

33 views
Skip to first unread message

Tom Wilson

unread,
Oct 18, 2024, 4:17:28 PMOct 18
to Altair-Duino
So I ran into an interesting bug a few days ago... it's sort of a low-priority issue, but it can affect anyone using the AD, so here's the bug and the fix:

I was using the USB port to upload a bunch of files to my Altair-duino. I typically run the USB port at 115,200bps when uploading disk images, to save upload time. 

However, i was having lots of problems, and I noticed an interesting quirk when testing things in CP/M: when I pressed the ENTER key, nothing would happen until the next keypress. I'd press ENTER, and I'd have to press ENTER again to get the command to take effect, but then I often got an extra  A:> prompt, or the directory listing would get cut short, as if I'd left the "add a line feed" setting on.

As it turns out, the problem is weirder than that: in the (s)erial connection page of the emulator's main menu, you can change the settings of all 4 of the Altair's serial ports. When you change the soft serial ports, you get a full set of options: baud rate, data bits, stop bits, and parity.

But when you adjust the USB Programming Port, the only option is the baud rate. There's no option to set the parity, data bits, or stop bits. 

However, the menu keys for these items are still active. So if you press lower-case "b", instead of Upper-Case "B", you end up setting the data bits to 5.

At that point, weird things happen, due to the byte size mismatch. The USB port is configured for 5-N-1, while the PC is sending 8-N-1. 

So... the solution is easy: if you accidentally press "b" and see a random "5" at the bottom of the screen while configuring the USB settings on the emulator, just tap "b" again until "8" shows up. Save the serial settings, and everything will work fine.

It's been a while since I've dug into the Altair-Duino source code. If David doesn't code a fix for that, I'll probably try to do a PR in the next couple of weeks to fix that, by locking down the settings when saving the USB port serial options.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages