Author Topic: Ps3 rapid fire studying and understanding project open source  (Read 122089 times)

Offline grizzfu88

  • Chief squatting Hard
  • *
  • Posts: 18
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Ps3 rapid fire studying and understanding project open source
« Reply #450 on: January 17, 2014, 12:53:28 PM »
Oh ok well i rechecked and all buttons rapid fire. any ideas like i said im just a beginner and id like to use just one wire. im assuming this is because when pressed they go low??
« Last Edit: January 17, 2014, 01:02:45 PM by grizzfu88 »

Offline SethMods

  • Registered BST
  • King of the Wii-tards
  • *
  • Posts: 189
  • Post quality +17/-1
  • Gender: Male
  • Acidmods User
Re: Ps3 rapid fire studying and understanding project open source
« Reply #451 on: January 17, 2014, 01:49:29 PM »
Can you do oscope screenshots while you do this testing? If not, send me the code and I will connect my Arduino up and take oscope screenshots so you can see what is going on.

Offline RDC

  • Administrator
  • Around the block
  • *
  • Posts: 2596
  • Post quality +90/-2
  • Gender: Male
  • The CGnome Project
Re: Ps3 rapid fire studying and understanding project open source
« Reply #452 on: January 17, 2014, 07:14:29 PM »
MC or AT, it's no different than Ford or Chevy, it's all the  same in the end, so there's no issues or worries there at all with the chip you're using, just how it's being used.

R2 does not go all the way down to 0v, none of the buttons do, if R2 did there would be no way for the controller to know that it was pressed, as it's Analog like every other button on the controller. They get lower, but never reach 0v, ground. This is why the ADC or Comparator is used to detect when the COM2 line starts to do it's thing.
« Last Edit: January 17, 2014, 07:18:27 PM by RDC »
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline Hazer

  • x4675636B4E7574
  • Acidmods Alumni
  • Acid Modder
  • *
  • Posts: 583
  • Post quality +59/-0
Re: Ps3 rapid fire studying and understanding project open source
« Reply #453 on: January 17, 2014, 08:01:19 PM »
Just to add a little light on this:

The following was taken from the PS3 remap code found here:https://www.acidmods.com/forum/index.php/topic,42146.0.html

Here is a clip from the code:

Code: [Select]
WaitForTrigger BTFSS PORTC, TRIGGER, ACCESS ;wait for pulse train start
BRA WaitForTrigger


MOVLB 2

;***********************R2 pulse***************************  FIRST PULSE

bsf TRISC, COMMONR, ACCESS ;make digital inputs
bsf TRISC, COMMONL, ACCESS
movlw 0x60 ;return to comparator inputs
movwf ANSEL, ACCESS
bsf CM1CON0, C1ON, ACCESS
bsf CM2CON0, C2ON, ACCESS

BTFSC NextPressLo, C3R3, BANKED ;COM3 outputs
BSF LATB, R3WRITE, ACCESS ;force press
BTFSC NextPressLo, C3L3, BANKED
bsf LATB, L3WRITE, ACCESS ;force press

movlw 0xF6 ;setup timer
movwf TMR1H, ACCESS
movlw 0xAD
movwf TMR1L, ACCESS
bcf PIR1, 0, ACCESS
bsf T1CON, 0, ACCESS

Timer01 btfss PIR1, 0, ACCESS ;200usec interval
goto Timer01

btfsc CM1CON0, C1OUT, ACCESS ;read button presses
BSF CurPressLo, C2R2, ACCESS ;with cmparators
btfsc CM2CON0, C2OUT, ACCESS
BSF CurPressHi, C1DUP, ACCESS
BTFSC PORTC, RCLIC, ACCESS ;read stick clicks
BSF CurPressLo, C3R3, ACCESS
BTFSC PORTC, LCLIC, ACCESS
BSF CurPressLo, C3L3, ACCESS
bcf CM1CON0, C1ON, ACCESS ;turn comparators off
bcf CM2CON0, C2ON, ACCESS ;and make digital inputs
clrf ANSEL, ACCESS

movlw 0xF8 ;setup timer
movwf TMR1H, ACCESS
movlw 0x94
movwf TMR1L, ACCESS
bcf PIR1, 0, ACCESS
bsf T1CON, 0, ACCESS

Timer21 btfss PIR1, 0, ACCESS ;160usec for 360usec total interval
goto Timer21


bcf TRISC, COMMONR, ACCESS ;make commons outputs
BTFSC NextPressLo, C2R2, BANKED ;force hi or lo
bcf LATC, COMMONR, ACCESS
BTFSS NextPressLo, C2R2, BANKED
bsf LATC, COMMONR, ACCESS
bcf TRISC, COMMONL, ACCESS
BTFSC NextPressHi, C1DUP, BANKED ;force hi or lo
bcf LATC, COMMONL, ACCESS
BTFSS NextPressHi, C1DUP, BANKED
bsf LATC, COMMONL, ACCESS



movlw 0xF8 ;setup timer
movwf TMR1H, ACCESS
movlw 0x9B
movwf TMR1L, ACCESS
bcf PIR1, 0, ACCESS
bsf T1CON, 0, ACCESS

Timer11 btfss PIR1, 0, ACCESS ;160usec for 520usec total interval
goto Timer11

;***********************R1 pulse*************************** SECOND PULSE

bsf TRISC, COMMONR, ACCESS ;make digital inputs
bsf TRISC, COMMONL, ACCESS
bcf LATB, R3WRITE, ACCESS ;force stick click release
bcf LATB, L3WRITE, ACCESS
movlw 0x60 ;return to comparator inputs
movwf ANSEL, ACCESS
bsf CM1CON0, C1ON, ACCESS
bsf CM2CON0, C2ON, ACCESS


movlw 0xF6 ;setup timer
movwf TMR1H, ACCESS
movlw 0xAD
movwf TMR1L, ACCESS
bcf PIR1, 0, ACCESS
bsf T1CON, 0, ACCESS

Timer02 btfss PIR1, 0, ACCESS ;200usec
goto Timer02

btfsc CM1CON0, C1OUT, ACCESS ;read button presses
BSF CurPressLo, C2R1, ACCESS
btfsc CM2CON0, C2OUT, ACCESS
BSF CurPressHi, C1DRIGHT, ACCESS
bcf CM1CON0, C1ON, ACCESS ;turn comparators off
bcf CM2CON0, C2ON, ACCESS ;and make digital
clrf ANSEL, ACCESS

movlw 0xF8 ;setup timer
movwf TMR1H, ACCESS
movlw 0x8F
movwf TMR1L, ACCESS
bcf PIR1, 0, ACCESS
bsf T1CON, 0, ACCESS

Timer22 btfss PIR1, 0, ACCESS ;160 usec
goto Timer22

bcf TRISC, COMMONR, ACCESS
BTFSC NextPressLo, C2R1, BANKED ;force hi or lo
bcf LATC, COMMONR, ACCESS
BTFSS NextPressLo, C2R1, BANKED
bsf LATC, COMMONR, ACCESS
bcf TRISC, COMMONL, ACCESS
BTFSC NextPressHi, C1DRIGHT, BANKED ;force hi or lo
bcf LATC, COMMONL, ACCESS
BTFSS NextPressHi, C1DRIGHT, BANKED
bsf LATC, COMMONL, ACCESS

movlw 0xF8 ;setup timer
movwf TMR1H, ACCESS
movlw 0x98
movwf TMR1L, ACCESS
bcf PIR1, 0, ACCESS
bsf T1CON, 0, ACCESS

Timer12 btfss PIR1, 0, ACCESS ;160 usec
goto Timer12



;***********************TRIANGLE pulse***************************

Basically this goes like this: The stick click buttons get pulsed high at the exact same time as the pulse train executes for COM1 and COM2. Since you can tie to 12 buttons using 2 IO, sacrificing 1 IO for the 'trigger event' on a 20 pin PIC was a no brainer. You could use the comparator to see COM1 dropping, but the digital signal on the stick clicks is much faster.

So the rest of the code goes like this:
-turn on comparator
-force R3/L3 outputs (this requires trace cutting since they are digital)
-setup a timer for 200 micro seconds
-read comparator results (so you can read button presses even though you will be manipulating the signal later)
-setup timer for 160 microseconds
-change pin to output and force pulse to go high or low based upon previous logic
-setup another timer for 160 micro seconds
-return pin to input and setup comparator for next pulse
-repeat for all pulses (six all together)


I only showed 2 pulses above. This is followed by evaluating the just taken button presses read by the comparator (during the first half of each pulse) and then storing what button presses/releases will be set for the next train pulse to come. So, the train pulses repeat every 10 milliseconds (or 100Hz roughly, it changes based upon battery vs USB power) and the logic to determine what bu8ttons get pressed/released comes from the previous pulse trains comparator read.

This is well tested code. Its very important what voltage reference value is used for the comparator and the code in this project has that value set via USB utility for 2 major reasons: You can set sensitivity so it can be very touchy or require you to mash the button, and also I have found that not all controllers behave the same. I had made a mod for someone here at AM and found that I had to widen the range of values in the utility because the controller would not 'dip' low enough for the default values I was using.
[Quote from Gamermodz via Viking forums]
Don't be jealous your not half as smart. I hate ****tards like you. An ignorant redneck. Your nothing but a posing ******. Get the **** out of here, really, your claim to fame is an open source rapid fire code? You make me laugh. You think you have control over the modding market?  You couldn't create what I can and do. You are too ignorant with your outrageous assumptions and accusations. [/Quote]

Offline grizzfu88

  • Chief squatting Hard
  • *
  • Posts: 18
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Ps3 rapid fire studying and understanding project open source
« Reply #454 on: January 17, 2014, 11:14:34 PM »
Can you do oscope screenshots while you do this testing? If not, send me the code and I will connect my Arduino up and take oscope screenshots so you can see what is going on.

Code is on Page 15.

Im gonna work on the adc method when i get some time.
the comparators confuse the piss out of me.

Offline SethMods

  • Registered BST
  • King of the Wii-tards
  • *
  • Posts: 189
  • Post quality +17/-1
  • Gender: Male
  • Acidmods User
Re: Ps3 rapid fire studying and understanding project open source
« Reply #455 on: January 18, 2014, 06:01:39 PM »
Code is on Page 15.

Im gonna work on the adc method when i get some time.
the comparators confuse the piss out of me.

Sorry, I thought you had more and were giving us the Cliff's Notes edition. My PS3 code is just a little under 2000 lines of code.

I can help you through the Comparator part if you want and if you are still interested in doing this.

It'd probably be good to start a new thread though. Something like "PS3 code for the Arduino."

Offline grizzfu88

  • Chief squatting Hard
  • *
  • Posts: 18
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Ps3 rapid fire studying and understanding project open source
« Reply #456 on: January 19, 2014, 10:08:18 AM »
I've been up all morning trying different things and I think the arduino thread is an awesome idea. 

Yea its not much because I'm kinda learning as I go. I did a ten mod on a rock candy controller but this Sony one is a beast. But any help is appreciated.

Link to that tread if you do make one!

Sorry, I thought you had more and were giving us the Cliff's Notes edition. My PS3 code is just a little under 2000 lines of code.

I can help you through the Comparator part if you want and if you are still interested in doing this.

It'd probably be good to start a new thread though. Something like "PS3 code for the Arduino."

I started one here
https://www.acidmods.com/forum/index.php/topic,43339.0.html

seems im getting nowhere and im getting really frustrated with all this but i dont wanna give up, Not in me.

[admin]Please Click Modify to edit post ! Please Do not double post! [/admin]
« Last Edit: January 19, 2014, 03:38:31 PM by Rodent »

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal