cAVR64 Protocol


Larger photos

cAVR64 is a bidirectional communication protocol between the HummerDTV v3 and an AVR microcontroller. The protocol supports reading ADC channels, I/O pins (R/W -- buttons, JSticks, LEDs, line drivers, etc.) and general data transfer.

Currently in testing with an ATmega8L @ 4mHz, it should work with virtually no changes on other ATmega chips. The 8L is a low power (2.7V) version of the ATmega8. The DIP package (28 pin) has 6 ADC channels available (other packages have the full 8 channels, as does the ATmega16, etc.)

While untested, the protocol might work with a stock C64, also.

Video clips

Accelerometer ----------- Analog Joystick

Read more about cAVR input devices here.

WARNING! This is a hardware interface project which involves soldering the DTV/Hummer pcb. Wrong connections, (reversed polarity, short circuit, etc.) improper voltage levels or voltage spikes can result in the DEATH of your DTV, AVR or the PC used to program the AVR.

Continue at your own risk!

Sending data to, and receiving data from the AVR has been demonstrated in the following ways:

  • Requesting and receiving a STATUS byte (currently this is a rolling count to demonstrate that full and unique bytes are being transfered.)
  • Requesting and receiving BUTTON press status (input.)
  • Requesting and initiating output lines (LED, relays, etc.)
  • Requesting and receiving ADC data.

The first practical test was reading two ADC channels connected to an analog joystick. That data was used to control a simple sprite demo. It's pretty fast...

About the Protocol

Using 5 userport lines, it transfers data in 3-bit chunks, so it is (or should be) much faster than a single-bit serial transfer. The DTV acts as master, the AVR as slave. All transfers are initiated by the master.

Q & A

Q) Why not also use the CASSENCE line, allowing a full nibble (4 bit) transfer per cycle rather than just 3 bits? (DTVLOAD uses this approach)
A) Because the same protocol could be used on the DTV v2, substituting a joystick port for the userport

Q) Does cAVR64 take advantage of the open-collector bus and its ability to connect multiple devices on a singe bus?
A) Ahh, not yet. I just made it work, first. Eventually yes, I hope. (But I'm not certain the original C64 can do this, tho)

Q) Is the AVR protocol IRQ driven?
A) Um, Um, Um, no, not yet. It should be, and it will be.

Q) What about a c64 joystick mode?
A) It should be possible (by using the lower bits on the JS lines) to convert the analog joy/accelerometer inputs to simple digital on/off signals at the ports. I.E., almost any c64 game could be played with the analog controllers. The AVR would handle the signal conversion.