Autofire Module

From IndividualComputers
Jump to: navigation, search

Contents

Overview

The Autofire-Module adds speed-adjustable autofire capability to a standard joystick. Additionally four arbitrary user defined joystick movement sequences can be programmed into the device on platforms that have bidirectional I/O on the joystick port.

Usage

  • switch off your C64 and connect the autofire module. The first time that is being done a default config will be written to the EEPROM.
  • press and release button to enable/disable autofire playback. By holding the fire button when enabling autofire, one of the following modes is selected:
  1. (no fire) autofire when fire button is pressed
  2. (hold fire) always autofire, hold fire when firebutton is pressed
By pushing the joystick into any direction when releasing the button, one of the 5 available autofire sequences is selected:
  1. (centered) default "auto fire" sequence
  2. (press up) custom sequence 1 (see below)
  3. (press down) custom sequence 2 (see below)
  4. (press left) custom sequence 3 (see below)
  5. (press right) custom sequence 4 (see below)

config mode

  • To enter the config mode press and hold button until LED goes on, then release button (LED goes off). While in config mode, autofire sequence will be active regardless of whether FIRE is pressed or not, so you can observe the speed/pulse settings.
  • press up to increase speed
  • press down to decrease speed
  • press left to increase pulse duty factor
  • press right to decrease pulse duty factor
  • To exit the config mode press button. This will also write the config into the EEPROM.

Factory Reset

Press and hold button until LED starts blinking rapidly (a few seconds), blinking starts when factory reset was done until button is released. This will write the default config into the EEPROM.

C64 config tool

Autofire Module Config Tool

The config tool can be used to edit custom sequences and save them to the device.

  • Download the Config Tool (contains .prg, .d64 and .crt versions)
  • Run the tool on your C64 with the autofire module in port 1
 U  ................................
 D  ................................
 L  ................................
 R  ................................
 F  ................................
 
    ^^
    \\bits set in "off" period
     \bits set in "on" period
  • F3 - read eeprom data from module
  • F5 - write eeprom data from module
  • F1/F7 - select sequence
  • F2/F8 - select sequence length

Developer Information

Communication Protocol

DATA0BIT  = UP
CLK0BIT   = DOWN
DATA1BIT  = LEFT
CLK1BIT   = RIGHT

initiate transfer

to put the microcontroller in the module into programming mode, issue the following "magic sequence":

C64                                     Micro
-------------------------------------   ----------------------------------
- toggles UP 256 times
                                        - ACKs by pulling left+right low
- waits for left+right to go low
                                        - waits for DAT0 lo
- sets DAT0 lo
                                        - waits for CLK0 lo
- sets CLK0 lo
                                        - waits for CLK0 hi
- sets CLK0 hi
                                        - waits for DAT0 hi
- sets DAT0 hi
                                        - goes to programming mode
- waits for left+right to go hi
                                        - releases left+right (=hi)

read/write the buffer

  • first put the module into programming mode as described above
  • send one byte to select the transfer mode
    • $00 read
    • $01 write
  • now transfer $40 bytes (4 * 16)

bit-banging scheme

a clock transition 1->0 means the bit on the related data line is ready

C64 sends Micro sends    C64                      Micro
CLK0 DAT0 CLK1 DAT1
          1              waits until CLK1=1       sets CLK1=1
     W                   puts data on DAT0
0                        sets CLK0=0              waits until CLK0=0
     R                                            reads DAT0
               W                                  Puts data on DAT1
          0              waits until CLK1=0       sets CLK1=0
               R         reads DAT1
1                        sets CLK0=1              waits until CLK0=1

data block format

Each of the 4 sequences consists of 16 bytes in the following format:

bit function
0 joystick down
1 joystick left
2 joystick right
3 unused, set to 0
4 joystick up
5 joystick button (fire)
6 unused, set to 0
7 0 if the current step belongs to the sequence, 1 for unused steps (sequence ends at first byte with bit 7 set)

Repository

The sourcecode of the C64 config tool can be found in the public SVN repository.


Shop

Resellers

Please shop locally. Our partners are listed in alphabetical order.

Personal tools