Acidmods

Console Modding------ ( Here you can talk about your favorite Consoles ) => XBOX 360 => 360 Controllers / 360 Rapid Fire Controllers => Topic started by: Oglesan on April 17, 2011, 08:08:52 AM

Title: Burst Code?
Post by: Oglesan on April 17, 2011, 08:08:52 AM
Can someone help me make a simple 3 shot burst code from scratch?
Title: Re: Burst Code?
Post by: whitetop on April 17, 2011, 09:23:11 AM
would help on what you want it for 360/ps3? plus wrong place to post requests
Title: Re: Burst Code?
Post by: Oglesan on April 17, 2011, 04:14:06 PM
360. and i didnt know bout the requests and MFH section
Title: Re: Burst Code?
Post by: whitetop on April 17, 2011, 04:20:17 PM
its ok will move this to right place hope you get some help
Title: Re: Burst Code?
Post by: Modded Matt on April 17, 2011, 04:29:48 PM
how much reading and studying are you willing to put into this? if you dont care to spend say, 100 hours min to start from knowing nothin to posibly writing the first bit of code, then you should use one of our premade codes, some of which have burst
Title: Re: Burst Code?
Post by: Oglesan on April 17, 2011, 04:41:14 PM
i know a bit about assembly, the commands and what they do but putting it together is what i have trouble with.

this is what i came up with after an hour last night, sorry if its hard to follow.

   list    p=12F683
   #include <p12F683.inc>

   errorlevel  -302

   __CONFIG   _FCMEN_OFF & _IESO_OFF & _CP_OFF & _CPD_OFF & _BOD_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTOSCIO

;***Variables***
STATUS      equ      03h
GPIO      equ                    05h
TRISIO      equ      85h
;***********************
   goto Start

Start
   bsf   STATUS,5
   movlw      b'100001'
   movwf     TRISIO
   bcf           STATUS,5

Main
   btfss     GPIO,5
   goto      Main
   goto      LED

LED
   movlw     01h
   movwf     GPIO,4
   decfsz     2Bh,f
   goto       State

State
   btfss     GPIO,0
   goto     Continue
   goto     Burst

Continue
   btfss     GPIO,5
   goto     State
   goto     Main

Burst
   bsf           STATUS,5
   movlw     b'100000'
   movwf     TRISIO
   bcf           STATUS,5
   movlw     01h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     00h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     01h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     00h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     01h
   movwf     GPIO,0
   goto        State
   
   end
Title: Re: Burst Code?
Post by: Dcofer on April 18, 2011, 01:52:57 PM
It always surprises me that all of the rapid fire codes I have viewed the code of that they are all written in assembly, why doesn't anyone write them in C utilizing the timers or pwm control (forgot pwm can only drop to 62.125hz so that would be too fast for some and no burst).  I would think that the code could be condensed and easier to write, maybe when I have some free time I will attempt to create a basic rf using C.  I guess I just dun like writing assembly so I don't see the advantage of it so my curiosity may be uninformed.
Title: Re: Burst Code?
Post by: hyper999 on April 18, 2011, 02:19:26 PM
It always surprises me that all of the rapid fire codes I have viewed the code of that they are all written in assembly, why doesn't anyone write them in C utilizing the timers or pwm control (forgot pwm can only drop to 62.125hz so that would be too fast for some and no burst).  I would think that the code could be condensed and easier to write, maybe when I have some free time I will attempt to create a basic rf using C.  I guess I just dun like writing assembly so I don't see the advantage of it so my curiosity may be uninformed.

i tried in C once but i just hate it, i feel as though i no idea what the program is doing i like being able to step through assembly line by line and know exactly what the PIC is doing. but all the codes here use a timer for rf....
Title: Re: Burst Code?
Post by: Oglesan on April 18, 2011, 02:22:53 PM
can u guys help me revise it to work for a 360 controller?
Title: Re: Burst Code?
Post by: hyper999 on April 18, 2011, 02:37:08 PM
i know a bit about assembly, the commands and what they do but putting it together is what i have trouble with.

this is what i came up with after an hour last night, sorry if its hard to follow.

   list    p=12F683
   #include <p12F683.inc>

   errorlevel  -302

   __CONFIG   _FCMEN_OFF & _IESO_OFF & _CP_OFF & _CPD_OFF & _BOD_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTOSCIO

;***Variables***
STATUS      equ      03h
GPIO      equ                    05h
TRISIO      equ      85h
;***********************
   goto Start

Start
   bsf   STATUS,5
   movlw      b'100001'
   movwf     TRISIO
   bcf           STATUS,5

Main
   btfss     GPIO,5
   goto      Main
   goto      LED

LED
   movlw     01h
   movwf     GPIO,4
   decfsz     2Bh,f
   goto       State

State
   btfss     GPIO,0
   goto     Continue
   goto     Burst

Continue
   btfss     GPIO,5
   goto     State
   goto     Main

Burst
   bsf           STATUS,5
   movlw     b'100000'
   movwf     TRISIO
   bcf           STATUS,5
   movlw     01h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     00h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     01h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     00h
   movwf     GPIO,0
   decfsz     2Bh,f
   movlw     01h
   movwf     GPIO,0
   goto        State
   
   end

heres a few tips,
-you should start with the template file for the 12f683 as you haven't got the reset and interrupt vectors
-use timer2 interupt for the actual rf, it will give more accurate timing and make the multitasking easier
-define your file registers instead of using a hex value it will make your code easier to follow
Title: Re: Burst Code?
Post by: Oglesan on April 18, 2011, 02:46:12 PM
ok thanks and where do i get a template? is there one with microchips programs?
Title: Re: Burst Code?
Post by: hyper999 on April 18, 2011, 02:50:36 PM
They come with MPLAB

C:\Program Files (x86)\Microchip\MPASM Suite\Template\Code

if you used the default install location for MPLAB
Title: Re: Burst Code?
Post by: Oglesan on April 18, 2011, 02:56:15 PM
ok thanks. ill post what i come up with after a few days.
Title: Re: Burst Code?
Post by: hyper999 on April 18, 2011, 03:05:06 PM
be sure to read the datasheet for the 12f683 really really well
SimplePortal 2.3.5 © 2008-2012, SimplePortal