> My question is what pins can I use for digital outputs? Can I use
> d0..d7 for outputs instead of inputs. How many possible digital outputs
> could I use at one time?
The SPI pins on the connector on the middle right edge of the board (J6) can be configured as digital outputs. Do a poke(0x1009, 0x3c) to make them outputs; then they are mapped to the middle 4 bits of address 0x1008 (SS= bit 5, SCK= bit 4, MOSI= bit 3, MISO= bit 2). Poke to that address (0x1008) to set them.
d0..d7 is the data bus and stuff is flying around on those pins all the time, so they cannot be used as outputs. If you hook an 'hc374 chip to the board, in the same fashion as the one driving the motor chips, you get 8 more digital outs. Connect the 'hc374's clock line to any of the three unused output latch selects of the 'hc138 (Y0, Y2, or Y4). All of these signals are present on the Expansion Bus.
Also, digital input #9 can be reconfigured as an output. Do a bit_set(0x1026, 0x80) to make it an output, and then use bit_set(0x1000, 0x80) to turn the bit on and bit_clear(0x1000, 0x80) to turn it off.
TO3 is an uncommitted timer output brought out to the Expansion Bus. This pin is bit 5 of PORTA; i.e., set it with bit_set(0x1000, 0x20) and clear it with bit_clear(0x1000, 0x20).
Finally, consider adding the Expansion Board, which adds nine digital outputs to the Handy Board system.