:main_machine_loop ' Read Dedicated Switches (swlo) and outa, busmask ' turn off data bus or outa, SWLOmask ' set data bus to SWLO andn dira, d0tod7mask ' set D0-7 to be input mov SWLO, ina ' read D0-7 to temp and SWLO, d0tod7mask ' mask out Data bits mov temp1, PAR ' HUB address of data add temp1, #8 ' SWLO is +2 longs wrlong SWLO, temp1 ' write SWLO 32 bits to HUB
And there's more where that came from. Read on.
After far too long we got the debug display, main loop and machine loop all cranking. Not necessarily working, but cranking. The code is just a small snippet from the machine interface. I'm not going to dive into code details just yet as that's just not quite important to the story. You'll have to trust me that the assembly version of the machine loop is functioning properly without actually looking at the code.
On to what is important. Paying attention is important. Particularly with electronics.
First lets catch you up. I rewrote the code so that we have a nice tight loop that
enables the dedicated switches on the data bus and reads the input
for each of 8 columns in the switch matrix
- enable a single column by setting the column data on the data bus and clocking the switch column strobe. This causes one column to be latched and held low (input enabled)
- enable the switch rows on the data bus and read the input for the enable column
writes the dedicated switch (8 bits) and switch matrix (64 bits) of data to the HUB memory so that other systems (in this case the debug monitor) can work with it
pulses the watchdog timer circuit to keep the system RESET line from pulling low and causing many items on the data bus from functioning
This revealed several issues with the overall plan. First, I was trying to run my prototype board with a separate power supply from the CPU board. This was just dumb. What this essentially created was a single circuit with multiple unconnected grounds. This causes all kinds of potential problems, one of which is noise. The video output signals suffered from this. Also, the data bus basically carried random noise. When data was driven high everything was OK, but reference signals pulled to ground were not. As a result the video could not sync and there was a lot of cross talk and random flickering of data from the dedicated switches and the switch matrix. Basically it didn't work.
I decided to pull the +12 signal and ground from the I/O power board, the same ground and power that drive the CPU board. This required a simple rework of the voltage regulator on the prototype circuit and the results were immediate. The video output snapped into crisp focus. The dedicated switches worked flawlessly.
The matrix on the other hand was still not working. In fact, the switch matrix code is still not functioning properly. At this point you are caught up to where I was about two weeks ago. So as not to build up andy unwarranted expectation: The switch matrix is still not fully functioning. I do however know a lot more about the data bus than I did lo so many weeks ago.
Next up: My frustrating and illuminating investigation of the operation of the data bus.