This section will be fleshed-out as time permits...
--------------------------------------- Transmitter ATmega8L TLP434A Transmitter module (315, 418 or 433.92 Mhz) ADXL330 accel RV1, RV2 analog joystick (PS2) C1 0.1 uf C2 2 uF C3 220 pF C4 10 uF R1 10K R2 330 D1 LED Ui LE33CZ-TR LDO regulator (to92 package) Socket or pins for ISP connector Sockets for accel & trans module (if not soldered to brd) Battery holder--anything from 4.5 to 9V should be fine --------------------------------------- Receiver (sorry, numbering is a bit off) ATtiny2313 RLP434A receiver module (315, 418 and 433.92 Mhz) C9 0.1uF C12 10uF R1 10K Socket or pins for ISP connector Socket for receiver module (if not soldered to brd)
Both AVRs are programmed in 'C' with AVRGCC. I used a Linux platform for the development & programming. The Hex files are included in the source, also.
The trasmitter AVR (ATmega8L) is clocked at 4mHz, the receiver (ATtiny2313) at 1mHz. The USARTs are set for 4800 baud, the max speed of the RF modules. Both quicker & slower RF modules are available.
Both the transmitter & receiver have a built in ISP programming connector, DAPA type. Take note: the receiver designed for the DTV mod has only a 4 pin connector on the schematic--the DAPA connector is shared by all three 'expansion slots,' and the ground is tapped off the main board, not the receiver 'card.' Use the C64 receiver schematic for the standard 5-pin DAPA ISP connector (or just look up the DAPA pinout and add the ground...)
The transmitter/receiver modules interface with the AVR USARTs, and the comm link is established with standard baud rates. It's not that simple, of course. Since the receiver tends to be noisy when no data is transmitted, it's neccesary to use manchester encoding to prevent incorrect data. Data must also be transmitted continously for the link to be reliable. During startup, a series of 'legal' manchester-encoded bytes are sent to sync the RF link.
Standard startup mode for the device is 'tilt mode', signaled with a single blink of the LED. 'Analog joystick mode' is entered by powering-up with the firebutton pressed. The LED blinks twice rapidly when starting this mode. The transmitter has connections for two more buttons, but no code has been added yet to use them. Button pins 2 & 3 are jumpered to GND at this point...
The firebutton is connected to the switch on the transmitter case, and the switch integrated into the analog joystick. The external switch was added because pressing the joyswitch in 'tilt mode' sent a mechanical shock through the transmitter, enough to make the accelerometer jump (a LOT.)
The joystick 'handle' is a pencil eraser, pushed on the shaft...
The transmitter antenna is a loop made from aluminum foil, sandwitched between a couple pieces of packing tape.
All modules (RF & accelerometer) are socketed, so they can easily be removed (and reused in other projects.)
The transmitter should use the smaller ATtiny2313 AVR. I had done a cursory search of the ATtiny line, but missed the 2313. Since I had several Atmega8 AVRs, they seemed a good choice. Oh, well-- V02....
When the receiver controller was changed to the 2313, the AVR clock was increased to 4mHz. This made operation less reliable! It's very likely the AVRs should be calibrated. The receiver modules both include traces for an optional xtal--this is for 'future expansion'. I would not add a crystal until the transmitter also has been redesigned with this addition.
Initial testing was done with an ATmega16 for the receiver. This is actually quite wasteful, especially for the C64 version, which didn't have any additional features. Migrating to the 2313 was when the clock timing problem cropped up--the internal architecture of the ATmega8 & ATmega16 must be nearly identical, so any timing errors were 'in sync.'
The range of the device isn't as good with the aluminum antenna inside the iPod case. During testing, with a 6-inch whip antenna, the range of the controller was close to 30 Ft. Now it's more like 10-12 ft. Anyone with experience in antenna design care to critique and improve?
Finally, playing existing C64 games with a 3D tilt controller (the accelerometer) sounds better that it actually is.... The C64 joysticks were not capable of absolute positioning (digital vs analog JS), so gameplay usually involves very precise combinations of joystick switches and fire button presses. An accelerometer just isn't capable of such quick and accurate switching.
The analog joystick is much more controllable, and gameplay is quite good. It's clear that games must be designed specifically for the intended controller.