logo elektroda
logo elektroda
X
logo elektroda

Rewriting the ATtiny24A charger code on the ESP2866 for PS3 pads

przemcio.18 636 2
ADVERTISEMENT
Treść zostaÅ‚a przetÅ‚umaczona polish » english Zobacz oryginalnÄ… wersjÄ™ tematu
  • #1 19694968
    przemcio.18
    Level 14  
    Hello I found on the internet a standalone charger for the PS3 Pad. which is based on the ATtiny24A .
    I wonder if it is possible to rewrite this code on ESP2866 or on its template to write a version on ESP?


    Quote:
    USB is only supposed to supply power to devices that have been correctly calculated. In particular, devices must not draw a maximum of 500 mA unless the host has specifically assigned a device configuration that required that much power. Many devices ignore this rule or follow the USB battery charging specification , which provides the ability to configure a higher current draw using a specific resistor configuration on the D+ and D- lines. This is used by most USB-charged mobile phones etc, so it is easy to charge them with just 5 volts and a resistor. Most USB wall chargers also have this resistor.

    However, the Sixaxis and Dualshock 3 controllers do not follow this convention and require full enumeration before charging. This means they cannot charge with most USB chargers and must talk to a real USB host and go through the enumeration process before they start drawing power.

    A friend of mine wanted to build his own docking station to charge the controller, so we came up with a circuit and code that would do just enough of the USB enumeration process to get the controller to charge. The PS3 controller is a full-speed USB device, which means ​​you need to talk to it at 12 MHz for this to work. We used the ATtiny24A , which is one of the smallest and cheapest MCUs that can control the output pins so quickly. The circuit is simple:

    Rewriting the ATtiny24A charger code on the ESP2866 for PS3 pads .

    JP1 is only for in-circuit programming and is not necessary if you are programming the circuit in any other way. U2 is any 3.3v regulator. JP2 is where you supply 5v.

    It currently only supports one controller. It must be directly connected to the controller; you cannot use a hub. The MCU should be able to handle charging up to 4 controllers simultaneously using other free pins, but the code needs a bit of love before this works.


    The code is available here: ps3-charger.zip
    Code: C / C++
    Log in, to see the code
    .


    I'm hoping for help or guidance on this topic :D .
  • ADVERTISEMENT
  • #2 19696269
    sylweksylwina
    Moderator of Computers service
    Just why use the ESP8266 for this? As far as I'm concerned it's shooting a cannon at a fly :) It's better to throw it on an AVR and that's it.
  • #3 19696294
    przemcio.18
    Level 14  
    I have a weather station on esp8266 that works. 24h so that I would have something to hook up to 😅. But maybe you are right I am not even sure if it works as expected, and tell me does it typically have to be on an ATtiny24A or can it be on any e.g. attiny2313-pu with similar memory? And will it program it via FT232RL USB to TTL adapter module.
    I used to play with. I dabbled in bascom but that was. Years back some single project and I don't remember &#128584 anymore;

    I acquired an attiny2313 the only one they had.... Now the question with what I will program it because I already know that ft232 does not work that way.... And the esp8266? Can it replace the arduino uno.? Or do I have to buy a programmer?
ADVERTISEMENT