This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Connect a PS# controller to tm4c123g

Other Parts Discussed in Thread: ENERGIA, CC3200

Hi,


I´m Denis Genero from Argentina.

I´m very new in usb communication, so I decided to make a project consisting on interface a PS3 controller via USB to a TM4C123g microcontroller to get some experience in this subjet. I´ve been watching the keyboard and mouse examples and figured out that a library is needed to interact with both devices. There is a library for PS3 controllers, but is for Arduino+USB host shield (a shield is like a BoosterPack).So this is what came to my mind: I configured the Tiva board as a host, receive data packages from the HID controller, and translate those packages in simple data (i.e: if the X botton of the controller is pressed, UART console show the word 'cross', and so on). So my questions are:

Can this project be done?

Do I need to make a library for the PS3 controller?

Can I "treat" the PS3 controller as a generic HID?


Any help, advice or example would be very usefull for me.

Thank you very much!!

  • Hi, I am not using too much Energia than ask who is using arduino it is better, try import sketch on ENERGIA and see if it can work out of USB library, if sketch is not USB library based i fear you need USB interfacing knowledge then you have to grasp USB theory and this is not so simple.
    I don't know PS3 but maybe it present as HID device class.
  • Denis Genero said:
    make a project consisting on interface a PS3 controller via USB

    My small firm "likes" your idea - quoted above - but for that final word!  Vultures, similar creatures, circle the remains of those who drink "unguardedly" from USB's stream...

    Kindly realize - as my friend Roberto (more gently) suggests - that the "USB portion" makes your project a, "big deal."  (i.e. an ordeal)

    And for what?   If the goal is to improve your experience & mastery w/a modern, ARM MCU - can't you "read the heck" out of PSx Controllers - via the MCU's ADC and many GPIO (digital) I/O?   (Ans - of course you can!)

    And - 4-5 years past - my small tech firm purchased lesser model of that controller (at great discount) and provided as a control-head for use by our clients in the "ISM" fields.  (we did add a small graphic Lcd - but otherwise the controller remained intact - but for our removal of the USB output)

    Believe that you'll (necessarily) sacrifice your MCU learning experience - you'll hold that learning "hostage" - at the altar of USB!   Is that wise - is it well thought?

    Just because something can be done - does not mean that it should be done!   Suggest that you maximize your learning by (eliminating) the USB "crutch" - and instead benefit from the great mechanics & compactness of PSx - which you can exploit with the analog & digital resources w/in your MCU...

  • Hi,
    frist of all I appreciate both of you to reply my post...
    I´m actualy intrested in using Code Composer Studio (v6.0) rather than Energía, because there´s a Lisence requirement that don´t allow the use of the USB port in Energía... But I´ve been thinking in pass the code already done in Arduino, to an Energía sketch in Code Composer (which is realy easy) and see what happen.
    The main problem that concern me, like cb1 discribes above, is the USB part... I already have all the usb.h, usb.cpp, PS3.h, etc... Libraries and examples running on Arduino, but I don´t think that Arduino and tm4c123g have the same usb registers.
    The other alternative that came to my mind is to modify the keyboard example and consider the PS3 controller as a "kind of keyboard"... But these are only ideas.

    Why using USB? The answer is that in a near future, and taking ideas from http://processors.wiki.ti.com/index.php/CC256x_MSP430_TI%27s_Bluetooth_Stack_Basic_HIDDemo_APP, connect to the tm4c123g board a Bluetooth dongle and make a wireless communication betwen them... I know this sound a madness, but is the reason why I´m asking for help...

    The idea is not to "suffer the knowledge", but use somthing already done and adapt it to a particular application.

    If any one have another alternative or idea, i would like to hear it...

    Once again, thanks for reply!

    Best Regards!
  • Hi, from your word is the hint of learning USB programming, so you have to do this huge task and study a big lot of thing to learn all caveat of this "de facto" standard not simple to use as it was Firewire well defined in interface and description.
    Every device if not special class can behave differently and if not standard you have to learn how to use from analyzer, you can start somee WireShark session to see what happen, I suggest you Linux as analyser, stack is more open to probing.
    When you have clean knowledge you can try all.. For now you can try explore an HID and see if something happen but have a good luck.

    About USB support on Energia you have reason, it is only on MSP board and serial client only. NO trace on TIVA nor on CC3200 too.
    On TIVA I am just using HID and mass storage and I don't know more than what is necessary to read/write data from them. All I used is in TIVAWare examples you can customize too.
    Madness was when we where young and have time to explore the world of technological stuff, then time elapse too fast for me.
  • Denis Genero said:
    The idea is not to "suffer the knowledge", but use somthing already done and adapt it to a particular application.

    My friend - every (successful) small, tech business that I know has that (exact) "idea" - and may I report - results are "rarely" smooth, as wanted and predictable!

    Why is that - how can it be?  You telegraph (some) desire to avoid the harshness of intense study, experimentation, and "crash-burn."  Yet - that's (so often) just how older warriors (Roberto - myself) built success - achieved real understanding. 

    Rarely will your "adaptation" go without issues - and if you attempt to compress or speed-bump knowledge (by "adapting") I'd bet heavily against your success.  And - almost always - at some point - your "adaptation" will prove, "too limiting" - and then you're stuck!  (your short-cut "adaptation" has deprived you of real knowledge/understanding/mastery - has it not?)

    How often do you think that you can "predict all aspects of your project" - and that it will not grow/expand?  This is what happens in the, "Real World" and I risk the wrath of "repetition" here - as again & again - we're called to "rescue" clients - who had similar "idea" and "adaptation" hopes/dreams - murdered by reality!

    PSx was designed to talk to a "real" USB computer (no offense to esteemed vendor, here) as Roberto stated - your task (if you intend any real mastery) is long and rocky - without much (if any) of a circus net beneath you.

    Unanswered (or just barely answered) is the original, "For what?" 

    This is not the best way to learn USB. 

    Nor is it the best way to learn Tiva MCU.

    Our tech firm used PSx as we could not produce a similar HW platform that good - that capable - for that price - in clients' (several) time-frame.  (that was our, "For what!) 

    Adaptations and "great ideas" are always quick, clean, easy "in your head!"   Commit pen to paper - sweat the (real) details - one by one - "quick, clean, easy" fall by the wayside!   Not to ask - How I know?