HOLY MOLY this is /EASY/ to solve....
Send To Calculator, white wire: 0xAA,
After startbit edge, set caclulator red wire low, shift first (7th?) bit into C, wait for bit 7 edge input, load bit 7 to red wire, so on. Repeat for next byte. Profit.
Sheesh. Nothing to it. And, automatically adjusts to the baud-rate, as well.
How come I've never heard of this????
$ cat /dev/ttyUSB0 -> FLASHcontents.bin
If you're forgetful like me, open another terminal window
$ while [ 1 ] ; do printf "%c" $(( 0xAA )) > /dev/ttyUSB0 ; done
CTRL-C both when filesize stops growing.
I'd be utterly shocked if 9600 would be too much. So no need to remember stty...
(Of course, I'll have to rewire the DB9 or make an adapter)
(How long have I been looking for a precision timer?! And to think I was even starting to consider cycle-counting and adding nops! Nevermind the ADC-"counter" idea, which'd just be fun)
THREE FRIGGIN DAYS LATER...
This thing's getting HUGE, and nowhere near as easy as I thought...
How does one implement a time-out without a timer? Or implement key entry to exit early with the interrupts disabled?
The Link Port, allegedly, is tested during key-scanning. I think that's in the timer interrupt. So, if misusing the link port, the OS thinks it's the start of a link.
Ok,now I've got a delayms (ish) for debouncing, which is necessary because the cable can't be attached before the port's set up... and arbitrary multisecond timeouts via 32bit counts are multiplying...
ALL of this would be nearly "easy" with a constantly running counter... but, then, I could use that for timing serial bits, in the first place.
Assembly is a PITA, too.
Stupid: write your own keypress test, give up on timeouts. Key (haha) factor... don't try writing/reading port1 without disabling interrupts, I think that's what i did wrong before... calc returned home like all was well, but keyboard was dead. Don't forget to reenable ints after!
...<sigh> twenty minutes, maybe... twenty+ lines deleted... hours of trying to implement timeouts n such... just press enter when ready. Twenty friggin minutes, at most is all it took. And to test.