by TomXP411 » March 18th, 2018, 5:30 pm
Hmm... My plan right now was to lock the update rate down to around 100Hz or so. With the number of bits it takes to update the entire front panel, including a synchronization byte, I am going to hit a wall at around 1000 updates per second, so I've been throttling updates to around 10 milliseconds per update. I am actually a little concerned about visual artifacts; I figure that a serial panel won't look exactly like the real thing, and it's not possible to push 2 million updates a second through the pipe. Even on native USB, which is faster, I'm still rate-limited.
Ideally, what I want to do with the Altairduino emulator is build in a mode switch that allows the user to switch between serial panel and native mode. This would allow an Altairduino to work out of the box or attached to a PC. Since the 'duino has a nice debug monitor built in, my plan is to implement a new monitor command that will engage the serial panel mode. To get back to standard operation, the user would hit a specific switch combination, like Stop+Aux2Up. This would give users the most flexibility; they can still use the front panel with PC based emulators, for debugging or just fun, and they can also use the panel direct at CPU clock speeds when they want full fidelity.
My stand-alone sketch takes about 24k right now, but I think there's a way to reduce the size by reading directly from the CPU registers, rather than 36 lines of "If this line is high then add this bit to the switch register...". :)
I'm thinking that, ideally, I could encode the whole process in a few dozen bytes if I was assembling it for the native processor. It's basically a matter of reading a byte from the serial port, putting that byte in a register, and repeating the process four more times. The 6th byte is fixed value that I'm using a synchronization byte, to help ensure I'm seeing the start of a packet. Now that I think about it, it should really be not much bigger than the Altair's own paper tape bootloader.
... I was about to ask what ISA the PIC uses, but I just found the data sheet with the instruction set summary. I'm going to look this over.