Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interfacing Joystick to PIC18F4550

Status
Not open for further replies.

santoshhiremani

Newbie level 4
Joined
Mar 21, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,351
HI,
My project is something like to get multiple Inputs from Joystick Buttons and navigation controller, By using these inputs i should ON/OFF around 18 different devices now i'm using an PC based joystick with USB connector. So now how can i communicate joystick with microcontroller? Is that possible to interface USB with the PIC
Please surest me how can i cannect and get input from PIC and aslo post some programming hints.


Thanks in Advance

My Joystick is something like this

 

If it were a simple potentiometer joystick, or switched joystick, then you could open it up and connect the internal devices to your pic inputs, directly (more or less).

However your joystick has 18 command lines. I don't know if that means it really has 18 switches inside it. Maybe a pot or two thrown in the mix?

And the signal goes through USB. This means 18 commands are coded through one data wire. Several times per second.

To attach it to your pic...

You will need to decode the signal coming from the joystick. Either that or obtain directions how to interpret it.

Then you would have to program your pic to:
* recognize the incoming signal at an input pin
* split the signal into 18 different commands (correctly according to which switch is which)
* interpret each command so as to be handled by your program (which you will need to compose).
 

Thanks for the replay Brad,
Can you please tell me the way to read USB data from PIC. I heard its impossible to read data from USB using PIC18F4550 is that right?
If possible please guide me something i'm waiting


THanks
 

Can you please tell me the way to read USB data from PIC. I heard its impossible to read data from USB using PIC18F4550 is that right?

A USB based Joystick requires a Host USB Class interface, the PIC18F4550 USB interface does not support Embedded Host or OTG classes of operation.

You should consider using a PIC24 or PIC32 which can support these USB classes. You would also need detailed specifics of the Joystick's USB interface and its class of operation, HID, CDC, etc.

There are third party devices which maybe able to act as a Host USB, however without specifics of the Joystick's USB interface it is not possible to be certain.


As Brad indicated the other option is to forego the Joystick's USB interface and connect the PIC18 directly to the Joystick's sensors.

BigDog
 

Hi there,

Unfortunately, the 18F4550 is a USB SLAVE device. If you want to interface the USB joystic to a microcontroller, you need one with USB HOST functionality. If you do go this route, download a freeware called "snoopy" or USBlyzer to analyze the USB traffic. During USB enumeration process, it will report the various information about the joystick device when plugged into a PC such as "Report Descriptor" and other USB initialization reports necessary for USB host driver.
For more information about USB, look into getting a copy of the book "USB Complete" - Jan Axelson

hope this helps a bit!
 

Do you need to use a USB joystick?
or any good joystick?

i'm asking because you could communicate with some old and commercial joysticks... (like the NES/SNES joysticks they are mere TTL shift-registers)
also, there is a lot of info about the Playstation Joystick (at least the PS1/PS2 joystick, not sure the PS3, but i heard it uses the same joystick) which you need to implement an SPI communication with the joystick, very easy with any microcontroller. any PS2 compatible joystick could be readed in SPI.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top