Jump to content


Photo

Picaxe 14m Rapid Fire Mod


  • Please log in to reply
42 replies to this topic

#1 razorbackjedi

razorbackjedi

    X-S Member

  • Members
  • Pip
  • 66 posts

Posted 19 October 2008 - 08:05 AM

I dont have a camera to use at the moment, so no tutorial photos, but heres my schematic and some codes (I did this work on a CG controller so if you have a Matrix change the code accordingly) for Halo and COD4. Just so everybody knows Im not an expert at coding these chips, that being said Im sure someone will come up with a better way of doing it. Presently I have been able to fit COD4 rapidfire/active reload and Halo3 rapidfire/rapid melee all on one 14m, even though its possible to run both I always reflash my controller with a single game code depending on what Im playing, so I will be posting them as seperate codes.

I tried every way possible to interface all of these buttons correctly without a Darlington Array but no matter what I tried I got unreliable results(buttons would work then they wouldnt!), using the Darlington was the only I could get it to work correctly with my limited coding experience. You may also notice the haphazard way I have connected the A,B,X,Y,RB criss-crossed, but it was for a reason, turning the darlinton array 180 degrees allows the +v, 0V and the 14's right side outputs line up with the darlingtons inputs and you can just solder the chips on top of one another. I also have this schematic in Illustrator .ai and Photoshop .psd formats with greater resolution and editibility.
IPB Image

Although Im only utilizing a few of the sub-routines they are all there in the code for ease of combo programming, for example... combos could be written like.

BXB:
gosub Bbtn
gosub Xbtn
gosub Bbtn

then just work out the pauses in between the gosubs, at least that how I did the active reload.

Heres COD4
CODE
Setfreq m8

main:
    do
    low 0
    if pin3 = 1 then gosub Rstick
    if pin4 = 1 then exit
    loop while pin4 = 0
    pause 800

    do
    high 0
    if pin3 = 1 then gosub reload
    readadc 0,b0
    if b0 > 40 then gosub Rtrig
    if pin4 = 1 then exit
    loop while pin4 = 0
    pause 800
    goto main

Rtrig:
    do
    high portc 3
    pause 85
    low portc 3
    pause 80
    b0=b0 and %00000000
    Let dirsc=b0
    readadc 0,b0
    loop while b0 > 40
    return

reload:
    gosub Xbtn
    pause 3000
    gosub Ybtn
    gosub Ybtn
    return

Abtn:
    b0=b0 or %00000100
    let dirsc=b0
    high 5
    pause 50
    low 5
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0    
    return

Bbtn:
    b0=b0 or %00000010
    let dirsc=b0
    high 4
    pause 50
    low 4
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

Xbtn:
    b0=b0 or %00000001
    let dirsc=b0
    high 3
    pause 50
    low 3
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

Ybtn:
    high 2
    pause 50
    low 2
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

RBumper:
    high 1
    pause 50
    low 1
    b0=b0 and %00000000
    Let dirsc=b0
    pause 50
    return

RStick:
    b0=b0 or %00100000
    let dirsc=b0
    high portc 5
    pause 50
    low portc 5
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

Heres Halo3
CODE
Setfreq m8

main:
    do
    low 0
    if pin3 = 1 then gosub Bbtn
    if pin4 = 1 then exit
    loop while pin4 = 0
    pause 800

    do
    high 0
    if pin3 = 1 then gosub Bbtn
    readadc 0,b0
    if b0 > 40 then gosub Rtrig
    if pin4 = 1 then exit
    loop while pin4 = 0
    pause 800
    goto main

Rtrig:
    do
    high portc 3
    pause 106
    low portc 3
    pause 90
    b0=b0 and %00000000
    Let dirsc=b0
    readadc 0,b0
    loop while b0 > 40
    return

Abtn:
    b0=b0 or %00000100
    let dirsc=b0
    high 5
    pause 50
    low 5
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0    
    return

Bbtn:
    b0=b0 or %00000010
    let dirsc=b0
    high 4
    pause 50
    low 4
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

Xbtn:
    b0=b0 or %00000001
    let dirsc=b0
    high 3
    pause 50
    low 3
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

Ybtn:
    high 2
    pause 50
    low 2
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return

RBumper:
    high 1
    pause 50
    low 1
    b0=b0 and %00000000
    Let dirsc=b0
    pause 50
    return

RStick:
    b0=b0 or %00100000
    let dirsc=b0
    high portc 5
    pause 50
    low portc 5
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    return




Heres some YouTube vids of the chip in action. In COD4 the first clip emptied and reloded are without the chip, the remainder is with the chip enabled.
COD4 rapid fire/active reload
Heres a Halo 3 rapid fire/rapid melee video.
Halo 3 Rapid Fire/Rapid Melee

I will get my camera back and do some pics for my next mod and try to make a tutorial. Anyone else get some cool combos worked up let me know, Im currently working on a few simple combos for my son when playing Star Wars:The Force Unleashed.

Edited by razorbackjedi, 19 October 2008 - 08:22 AM.


#2 razorbackjedi

razorbackjedi

    X-S Member

  • Members
  • Pip
  • 66 posts

Posted 19 October 2008 - 10:07 AM

If you leave the loop in the Rtrig gosub you cant access other parts of the code without releasing the right trigger... duh on my part..., so if you were shooting at someone and press the extra input button for rapid melee it wont work. You need to either remove the loop or ad a gosub call within the Rtrig gosub for the Bbtn gosub(or whatever button your using). Heres the replacement gosubs for the Halo3 code.

CODE
Rtrig:
    do
    high portc 3
    pause 106
    low portc 3
    pause 90
    b0=b0 and %00000000
    Let dirsc=b0
    readadc 0,b0
    if pin3 = 1 then gosub Bbtn
    loop while b0 > 40
    return
Bbtn:
    do
    b0=b0 or %00000010
    let dirsc=b0
    high 4
    pause 50
    low 4
    pause 50
    b0=b0 and %00000000
    Let dirsc=b0
    loop while pin3 = 1
    return


Edited by razorbackjedi, 19 October 2008 - 10:09 AM.


#3 dschu012

dschu012

    X-S Member

  • Members
  • Pip
  • 121 posts

Posted 20 October 2008 - 02:26 AM

Just a quick question on what certain lines in the code do.

readadc 0,b0
b0=b0 or %00000100 (looks like you are or'ing b0 with 4 but I dunno why)
let dirsc=b0 (what is dirsc)
b0=b0 and %00000000 (looks like you are clearing what is in b0, again I dunno why)

I probably could figure this all out if I looked in the picaxe manual, but figured I would ask here because it requires less reading.

#4 razorbackjedi

razorbackjedi

    X-S Member

  • Members
  • Pip
  • 66 posts

Posted 20 October 2008 - 05:45 AM

QUOTE(dschu012 @ Oct 19 2008, 09:02 PM) View Post

I probably could figure this all out if I looked in the picaxe manual, but figured I would ask here because it requires less reading.


I know very little about Picaxe programming but reading is the only place to start. I read a bunch of posts by Dr Acula about preserving pin states while others are doing output, etc. I still dont understand it all, but enough to get what youve seen so far to work.

Im still reading the rest....

#5 dschu012

dschu012

    X-S Member

  • Members
  • Pip
  • 121 posts

Posted 20 October 2008 - 06:18 AM

QUOTE(razorbackjedi @ Oct 20 2008, 06:21 AM) View Post

I know very little about Picaxe programming but reading is the only place to start. I read a bunch of posts by Dr Acula about preserving pin states while others are doing output, etc. I still dont understand it all, but enough to get what youve seen so far to work.

Im still reading the rest....

After doing some reading it looks like you are setting the pin 8 (in the code in my previous post) to output and then below with the and statement setting all pins 5-10 to input. Couldn't you just at the very beginning do
let dirsc=%00100111
since 5,8,9,10 are all output? And then leave out all of the other b0=b0 or/and statements and let dirsc=b0 statements.

#6 razorbackjedi

razorbackjedi

    X-S Member

  • Members
  • Pip
  • 66 posts

Posted 23 October 2008 - 07:06 PM

Theres no doubt i have extraneous code!... and your suggestions sound correct. When I learn more perhaps I can shave the code down and repost it. It does work though.

#7 killer skittle

killer skittle

    X-S Senior Member

  • Members
  • PipPip
  • 245 posts
  • Location:Atlanta, GA
  • Xbox Version:v1.2
  • 360 version:v1 (xenon)

Posted 28 February 2009 - 07:49 AM

SORRY FOR THE MEGA BUMP!
But im actually taking on the challenge of doing this today i got me some goodies: love.gif
IPB Image
Well ive got about 4 hours sleeping.gif into it:
IPB Image
IPB Image
IPB Image
IPB Image
IPB Image
IPB Image
IPB Image
IPB Image
Ill be working on it tomorrow hopefully finishing it!
wish me luck! jester.gif

#8 Salincer

Salincer

    X-S Expert

  • Members
  • PipPipPip
  • 507 posts
  • Location:Virginia, USA
  • Xbox Version:unk
  • 360 version:unknown

Posted 28 February 2009 - 05:10 PM

Hmmm...wonder if i can be conservant and free-form this. I bet you rape on halo w/ double beatdown thing

#9 killer skittle

killer skittle

    X-S Senior Member

  • Members
  • PipPip
  • 245 posts
  • Location:Atlanta, GA
  • Xbox Version:v1.2
  • 360 version:v1 (xenon)

Posted 28 February 2009 - 06:37 PM

You probably could, looking back at my pictures the next day: i was not conservative at ALL! (just trying to make it "neat") looks like the pins are pretty much the same if you turned the picaxe 180 degrees and set them on top of one another! HOPE TO FINISH TODAY! What it the double beat down for halo 3?

#10 killer skittle

killer skittle

    X-S Senior Member

  • Members
  • PipPip
  • 245 posts
  • Location:Atlanta, GA
  • Xbox Version:v1.2
  • 360 version:v1 (xenon)

Posted 01 March 2009 - 01:27 AM

I KNEW IT WAS TOOOOOOO GOOD TO BE TRUE! of course its not working! mad.gif mad.gif mad.gif mad.gif mad.gif i dont think 3 volts is enough to program the picaxe!

#11 Protolisk

Protolisk

    X-S X-perience

  • Members
  • PipPip
  • 401 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 01 March 2009 - 01:32 AM

Wait so why do you need a darlington array?

#12 Salincer

Salincer

    X-S Expert

  • Members
  • PipPipPip
  • 507 posts
  • Location:Virginia, USA
  • Xbox Version:unk
  • 360 version:unknown

Posted 01 March 2009 - 01:50 AM

QUOTE(killer skittle @ Feb 28 2009, 08:03 PM) View Post

I KNEW IT WAS TOOOOOOO GOOD TO BE TRUE! of course its not working! mad.gif mad.gif mad.gif mad.gif mad.gif i dont think 3 volts is enough to program the picaxe!

Dang. Is there anything you can do about it? This mod looks interesting..and i wanna try it. I say i could free-form it

#13 killer skittle

killer skittle

    X-S Senior Member

  • Members
  • PipPip
  • 245 posts
  • Location:Atlanta, GA
  • Xbox Version:v1.2
  • 360 version:v1 (xenon)

Posted 01 March 2009 - 02:32 AM

I was just angry! I think it might have some thing to do with my laptop! I took a break from it, and will hopefully figure out in a minute! I will post some more picture later everything is soldered up, just i cant seem to program the picaxe now, i know its getting power and hooked up right. but don't know if 3v is enough. I think from what im gathering, the "cable 1, cable 2 and cable 3" on the main schematic are the programming wires! but he doesn't say it!
wish me luck! sleep.gif

#14 killer skittle

killer skittle

    X-S Senior Member

  • Members
  • PipPip
  • 245 posts
  • Location:Atlanta, GA
  • Xbox Version:v1.2
  • 360 version:v1 (xenon)

Posted 01 March 2009 - 03:39 AM

QUOTE(killer skittle @ Mar 1 2009, 03:08 AM) View Post

I was just angry! I think it might have some thing to do with my laptop! I took a break from it, and will hopefully figure out in a minute! I will post some more picture later everything is soldered up, just i cant seem to program the picaxe now, i know its getting power and hooked up right. but don't know if 3v is enough. I think from what im gathering, the "cable 1, cable 2 and cable 3" on the main schematic are the programming wires! but he doesn't say it!
wish me luck! sleep.gif


I THINK I MIGHT KILL SOME ONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IVE PUT OVER 15 HOURS ON THIS PIECE OF SH%&, AND STILL NOTHING!


#15 killer skittle

killer skittle

    X-S Senior Member

  • Members
  • PipPip
  • 245 posts
  • Location:Atlanta, GA
  • Xbox Version:v1.2
  • 360 version:v1 (xenon)

Posted 01 March 2009 - 04:28 AM

ITS FRIED!!!!
PERFECT!!!!
SPARK FUN ALL OUT.... NOT FUN





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users