Ok, here it is. The Picaxe Rapidfire Tutorial.................. Ok a little disclaimer.....Rumor has it if you get enough complaints you can get booted from Xbox Live for using a rapidfire controller. I have no idea why. I am gonna leave the LED, Program Port and button placement upto you since everyone has a preference, although I will post some pic showing my placement. Last but least credit where credit is do.....Bigmacattack and Vertinago are the 2 that have helped out the most
so this tut wouldn't be possible without them, thanks again guys!
Parts List:
1 Picaxe 8M chip
1 serial or usb program cable (both are available from "Sparkfun.com")
(Part numbers are Radio Shack numbers)
Torx T-8 security driver
Solderin Iron -part #64-2051(15 watt works best)
Solder -part #64-017E
30ga wire -part #278-501 = red (totally upto you on wire I used some old network cable
part #278-502 = white and some 4 conductor telephone wire since you can color
part #278-503 = blue code everything and make it alittle easier but it doesn't
Tact switch -part # 275-003 bend as easy)
Stereo jack -part # 274-0249
8 pin IC socket -part # 276-1995
Assorted LEDs -part #
Resistors
330 ohm -5pack part #271-1315
1k - 5pack part #271- 1321 (All of them are $1 each)
10k - 5pack part #271-1335
22k - 5pack part #271-1339
100k - 5pack part #271-1347
(a 1.8k is needed if you have the matrix controller and since Radio shack doesn't sell it in any other way then in a 500pack but it does have all the resistors needed part-# 271-312 at $13 you'll also need a transistor if you have the matrix -----transistors - part #276-1617)
Ok 1st step is taking your socket and flipping it upside down you want the notch towards the top
with it upside down pin 8 will be the top left pin, 7 will be the one below 8 and so on and pin 1 will be the top right pin, pin 2 will be below that one and so on...... pay close attention to which pin is which. Best thing to also do is tin all of the pins on the socket.
2nd step:
You want to get a 1k , 22k and a 330 ohm resistor. then cut one end of each so it's just alittle shorter then the pin on the socket. Then solder the 1k to pin 4 , then the 22k to pin 2 and then
the 330 ohm to pin 6. (see
Pic1)
3rd step:
Carefully bend the 1k and 330ohm resistor down towards the middle with the ends going towards the top of the chip. Then bend the 22k to the outside and the end towards the bottom. (see
Pic2)
4th step:
You want to bend the ends of the 1k and 330ohm up (same direction as the pins on the socket see pic3)Now take a 10k and bend one end like was done with the 1k and 330. (see
Pic3)
Now is when some creative bending comes into play......the 10k is soldered to the 1k and then over and around to pin 8 on the socket (refer back to pic 3).
5th step:
Once everything is soldered you want to snip down everything (see
Pic4)
6th step:
Ok take another 10k and bend on end then solder to the 22k (see
Pic5) then wrap the other end around the socket and solder to the other 10k going to pin 8 (see
Pic6)
(in pic 5 you can see I put a dab of hot glue on the 1k and 300 ohm to hold everything in place to help from something making contact to something it shouldn't be.)
7th step:
The wiring is upto you but we'll use the colors I used to help things along , also to make sure you've got enough wire to work with cut them about 6-7 inches long it might see too long but when you start winding up, around and through things it helps.So you want 3 wires to goto ground (see
Pic7) I used brown,black and green/white, twisted them together and tinned them then cut them down. Then you need 2 wires for power, I used red and blue twisted and tinned them also. Just for easier soldering (if you don't allready know) is to tin the wires as you go. The pictures show what colors I used for what....
8th step:
Ok solder the 2 wires(blue and red) to pin1 and a wire(blue/white) to the 1k and 100k that was soldered togeher earlier (see
Pic8)
9th step:
Solder the 3 wires used for ground (black,brown,green/white) to pin8 (see
Pic9)
10th step:
Then solder a wire(green) to the 330ohm (see
Pic10)
11th step:
Another wire(orange/white) to pin 7 (see
Pic11)
12th step:
Another wire(brown/white) to the 22k that was soldered to pin 2 earlier (see
Pic12 )
13th step:
Then another wire(yellow) to pin 3 (see
Pic13)
14th step:
Ok here's where you decide on dual trigger or single trigger???
If you're going with a single then you can either bend over pin 5 (see
Pic14)
or simply snip off pin 5?? But if you want dual just solder a wire(orange) to pin 5.(see
Pic15)
15th step:
Ok this is the tricky part. But unless you used a color coded wire setup you might want to mark the wires with a piece of masking tape and write what each wire goes to before you do this step. Use some hot glue to cover the solder joints and to hold the wires so the don't break off easily. The trick is to wet your fingers and mold the glue around everything keeping the whole thing as small as possible (see
Pic16) and (
Pic17) or else you'll run into problems if you want to keep your rumble motors. If it's too big it won't fit anywhere besides where the motors go. Where ya want it to go is the same spot console customs shows in their tut.
Step 16 is for matrix controller only:
Ok you need a transistor and a 1.8k resistor. The 1.8k resistor gets soldered to the center post(base) on the transistor. what ya wanna do is cut down one end of the 1.8k to about the same length as the ones for the IC socket then center leg of the transistor should be the same length.
Solder the two together, then you want to trim it down to the same length as the other legs. Then solder the 1.8k leg to the bottom of the trigger pot and the collector to the top of the pot and the ground for the chip gets soldered to the emmiter leg. (see
Pic18)
OK...........I'd suggest taking a break if you haven't allready......
Now like I said in the beginning button,LED and program port is all upto you.....But I'll now goto where and what all the wires goto.
Power and ground:
see
Pic19 for Matrix controller and
Pic20 for the CG controller
Trigger wire:
The wire from pin 3 goes to the center post of the right trigger pot (refer to power and ground pics)
(Dual: the wire from pin 5 goes t the center post of the left trigger pot)
LED:
One of the wires soldered to pin 8 goes to the negetive leg of the LED (shorter leg)
Then the wire that was soldered to the 330ohm goes to the positive leg of the LED (longer leg)
Switch/push button:
The wire from the 1k that goes to pin 4 goes to one side
One of the wires from pin 1 goes to the other
(if you're using the tact switch each side of the switch has a neg and pos)
Program port:
Ok if you're using the stereo jacks I listed then when your holding it upside down with the one leg to the right then the one to the left goes to one of the wires from pin 8
The one in the middle the wire from pin2 and the one sticking out the right side gets the wire from pin 7 (The picaxe manual explains the programming port wiring in a schematic)
Picaxe Programming Editor SoftwareOk now I have code for a 3mode rapid fire for The CG and Matrix controllers:
CG controller:
Setfreq m8
rapidoff:
Low 1
do
if pin3 = 1 then pause1
loop while pin3 = 0
goto rapidoff
pause1:
pause 1000
goto rapidon
rapidon:
Low 1
Pause 300
High 1
Readadc 4,b0
If b0 > 125 then Rapidfire1
If pin3 = 1 then pause2
goto rapidon
Rapidfire1:
Do
High 1
Low 4
Pause 180
High 4
Low 1
Pause 175
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 > 125
goto rapidon
pause2:
pause 1000
goto rapidon2
rapidon2:
Low 1
Pause 200
High 1
Readadc 4,b0
If b0 > 125 then Rapidfire2
If pin3 = 1 then pause3
goto rapidon2
Rapidfire2:
Do
High 1
Low 4
Pause 150
High 4
Low 1
Pause 145
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 > 125
goto rapidon2
pause3:
pause 1000
goto rapidon3
rapidon3:
Low 1
Pause 100
High 1
Readadc 4,b0
If b0 > 125 then Rapidfire3
If pin3 = 1 then pause4
goto rapidon3
pause4:
pause 1000
goto rapidoff
Rapidfire3:
Do
High 1
Low 4
Pause 100
High 4
Low 1
Pause 95
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 > 125
goto rapidon3
END
Matrix:
Setfreq m8
rapidoff:
Low 1
do
if pin3 = 1 then pause1
loop while pin3 = 0
goto rapidoff
pause1:
pause 1000
goto rapidon
rapidon:
Low 1
Pause 300
High 1
Readadc 4,b0
If b0 < 30 then Rapidfire1
If pin3 = 1 then pause2
goto rapidon
Rapidfire1:
Do
High 1
Low 4
Pause 180
High 4
Low 1
Pause 175
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 < 30
goto rapidon
pause2:
pause 1000
goto rapidon2
rapidon2:
Low 1
Pause 200
High 1
Readadc 4,b0
If b0 < 30 then Rapidfire2
If pin3 = 1 then pause3
goto rapidon2
Rapidfire2:
Do
High 1
Low 4
Pause 130
High 4
Low 1
Pause 125
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 < 30
goto rapidon2
pause3:
pause 1000
goto rapidon3
rapidon3:
Low 1
Pause 100
High 1
Readadc 4,b0
If b0 < 30 then Rapidfire3
If pin3 = 1 then pause4
goto rapidon3
pause4:
pause 1000
goto rapidoff
Rapidfire3:
Do
High 1
Low 4
Pause 75
High 4
Low 1
Pause 70
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 < 30
goto rapidon3
END
So I hope this has worked for ya, I'll be watching for any questions that ya post and I'm sure Vertagino and Bigmacattack will be watching also and if I can't help hopefully they or someone can?