The serial communication thread
Posted: Fri Jun 19, 2020 8:18 pm
The title "The serial communication thread" is perhaps presumptuous.. perhaps no one else uses or cares about the RS232C port of their own little Albert(s) anymore... well let's see.
I am using the RS232 port connected to a PC which itself runs an "Albert server" in order to support 'remote' disk drives. (More details of this are in a separate thread). This is all working pretty swimmingly but for one thing: 9600bps is so slow, so 'last century'. If this is all Einstein can handle, so be it. But if that could be, say, doubled, that would make a real perceptible difference.
The standard MOS call definitely only goes up to 9600. Furthermore, looking at the actual ROM code, I see that the timer reload value for 9600 is 13 - not divisible by two in the realm of integers. But undeterred, I thought: what if I try the value 6 anyway. This corresponds to a bit rate of 20800 to I started "picocom --baud 20800 /dev/ttyUSB0" on the PC. It complained that could not set that exactly , but got well within 1% which is usually good enough for RS232-C.
Simply typing characters to and fro between the PC and Einstein worked fine. Of course, I need to try more intensive data transfer before concluding this is a viable solution, but I'm optimistic. Some concessions I may need to make are:
- disable the 1 second interrupt.My Einsteins don't know what day day it is, so not keeping the time to within a second is no great loss.
- perhaps disable all interrupts during data transfer.
- (almost certainly need to:) use straight I/O instructions for serial port access rather than the (nifty but time-consuming) MOS calls. This would make it easier to, where appropriate, put a poll limit on read operations.
While I was hooking my scope up to check the timings, one of my poorly soldered connections fell apart (again!), so I didn't get beyond establishing that I really had doubled the transfer rate. .. Any thoughts/recommendations from the rest of the Einstein community?
Larry Myerscough (aka papahippo)
I am using the RS232 port connected to a PC which itself runs an "Albert server" in order to support 'remote' disk drives. (More details of this are in a separate thread). This is all working pretty swimmingly but for one thing: 9600bps is so slow, so 'last century'. If this is all Einstein can handle, so be it. But if that could be, say, doubled, that would make a real perceptible difference.
The standard MOS call definitely only goes up to 9600. Furthermore, looking at the actual ROM code, I see that the timer reload value for 9600 is 13 - not divisible by two in the realm of integers. But undeterred, I thought: what if I try the value 6 anyway. This corresponds to a bit rate of 20800 to I started "picocom --baud 20800 /dev/ttyUSB0" on the PC. It complained that could not set that exactly , but got well within 1% which is usually good enough for RS232-C.
Simply typing characters to and fro between the PC and Einstein worked fine. Of course, I need to try more intensive data transfer before concluding this is a viable solution, but I'm optimistic. Some concessions I may need to make are:
- disable the 1 second interrupt.My Einsteins don't know what day day it is, so not keeping the time to within a second is no great loss.
- perhaps disable all interrupts during data transfer.
- (almost certainly need to:) use straight I/O instructions for serial port access rather than the (nifty but time-consuming) MOS calls. This would make it easier to, where appropriate, put a poll limit on read operations.
While I was hooking my scope up to check the timings, one of my poorly soldered connections fell apart (again!), so I didn't get beyond establishing that I really had doubled the transfer rate. .. Any thoughts/recommendations from the rest of the Einstein community?
Larry Myerscough (aka papahippo)