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
-
Can someone help me make a simple 3 shot burst code from scratch?
-
would help on what you want it for 360/ps3? plus wrong place to post requests
-
360. and i didnt know bout the requests and MFH section
-
its ok will move this to right place hope you get some help
-
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
-
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
-
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.
-
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....
-
can u guys help me revise it to work for a 360 controller?
-
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
-
ok thanks and where do i get a template? is there one with microchips programs?
-
They come with MPLAB
C:\Program Files (x86)\Microchip\MPASM Suite\Template\Code
if you used the default install location for MPLAB
-
ok thanks. ill post what i come up with after a few days.
-
be sure to read the datasheet for the 12f683 really really well