PIC24 USB Host Mode
PIC24 USB Host Mode
Hi I'm looking for some example code for the PIC24 or PIC32 for USB Host mode??
Any help would be greatly appreciated. Thanks
Any help would be greatly appreciated. Thanks
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PIC24 USB Host Mode
Hello,
On our LibStock, you can find an example for USB Host for PIC24 and PIC32:
https://libstock.mikroe.com/projects/vi ... st-library
Kind regards,
Jovana
On our LibStock, you can find an example for USB Host for PIC24 and PIC32:
https://libstock.mikroe.com/projects/vi ... st-library
Kind regards,
Jovana
Re: PIC24 USB Host Mode
I looked at those examples and they don't do what I need. I have a HID Terminal device that I want to send commands too and read what is coming back. 1st I need to recognize the device.
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PIC24 USB Host Mode
Hello,
In our compiler, you can find an example for HID terminal, so you can use both examples (USB Host and HID) to write your project.
For PIC32:
\Mikroelektronika\mikroC PRO for PIC32\Examples\Development Systems\EasyPIC Fusion v7\USB
For PIC24:
\Mikroelektronika\mikroC PRO for dsPIC\Examples\Development Systems\EasyPIC Fusion v7\PIC24EP512GU810\USB
Kind regards,
Jovana
In our compiler, you can find an example for HID terminal, so you can use both examples (USB Host and HID) to write your project.
For PIC32:
\Mikroelektronika\mikroC PRO for PIC32\Examples\Development Systems\EasyPIC Fusion v7\USB
For PIC24:
\Mikroelektronika\mikroC PRO for dsPIC\Examples\Development Systems\EasyPIC Fusion v7\PIC24EP512GU810\USB
Kind regards,
Jovana
Re: PIC24 USB Host Mode
I am using the EasyPIC Fusion V7 board. I have looked at the examples but the software description say they are for a HID device plugged into a PC. I'm looking for the PC side of it so I can plug the HID to it, see if its connected, send it a command and read the response back. My device plugs into the USB Host (Type A) of the board. Thanks......
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PIC24 USB Host Mode
Hello,
Can you tell me which MCUs you are using?
When you install examples from the link which I sent you:
https://libstock.mikroe.com/projects/vi ... st-library
You can find these examples on the path:
\Mikroelektronika\mikroC PRO for dsPIC\Packages\USB_Host_dsPIC\Examples\PIC24EP512GU810\Host MSC
Kind regards,
Jovana
Can you tell me which MCUs you are using?
When you install examples from the link which I sent you:
https://libstock.mikroe.com/projects/vi ... st-library
You can find these examples on the path:
\Mikroelektronika\mikroC PRO for dsPIC\Packages\USB_Host_dsPIC\Examples\PIC24EP512GU810\Host MSC
Kind regards,
Jovana
Re: PIC24 USB Host Mode
I have tried to use those examples (mouse and memory stick) and neither one of them compile. I load the hex file into my Easyfusion V7 board and still get nothing. I am using a PIC24EP512GU810. I attached a picture of the board I am using.
- Attachments
-
- EasyFusion.jpg (166.44 KiB) Viewed 4372 times
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PIC24 USB Host Mode
Hello,
I tested Host_MSC example with PIC24EP512GU810 and it works fine (see the picture in the attachment).
You have to place SD card on USB HOST and turn on SW14.7 switch for USB-PSW.
In user manual of your board, you can read how to use USB HOST (page 24)
https://download.mikroe.com/documents/f ... -v101b.pdf
In the attachment, you can find the example.
Kind regards,
Jovana
I tested Host_MSC example with PIC24EP512GU810 and it works fine (see the picture in the attachment).
You have to place SD card on USB HOST and turn on SW14.7 switch for USB-PSW.
In user manual of your board, you can read how to use USB HOST (page 24)
https://download.mikroe.com/documents/f ... -v101b.pdf
In the attachment, you can find the example.
Kind regards,
Jovana
- Attachments
-
- HOST.zip
- (1.89 MiB) Downloaded 114 times
Re: PIC24 USB Host Mode
Your hex file works but when I go to compile it I get errors.
- Attachments
-
- errors.jpg (49.54 KiB) Viewed 4361 times
-
- errors.jpg (49.54 KiB) Viewed 4361 times
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PIC24 USB Host Mode
Hello,
Please, go to Project -> Edit Search Path and in Source Path add path to MSCHost_dsPIC_EP.c:
\Mikroelektronika\mikroC PRO for dsPIC\Packages\USB_Host_dsPIC\Uses
Kind regards,
Jovana
Please, go to Project -> Edit Search Path and in Source Path add path to MSCHost_dsPIC_EP.c:
\Mikroelektronika\mikroC PRO for dsPIC\Packages\USB_Host_dsPIC\Uses
Kind regards,
Jovana
Re: PIC24 USB Host Mode
I did what you asked and now I get this error...
- Attachments
-
- error2.jpg (57.48 KiB) Viewed 4307 times
Re: PIC24 USB Host Mode
I don't understand because the example is not using a multi media card.
- jovana.medakovic
- mikroElektronika team
- Posts: 986
- Joined: 18 Dec 2018 10:36
Re: PIC24 USB Host Mode
Hello,
Unfortunately, I cannot reproduce the same behavior.
Please, try to uncheck the MMC library from the Library Manager.
Can you tell me which version of the compiler you are using?
Kind regards,
Jovana
Unfortunately, I cannot reproduce the same behavior.
Please, try to uncheck the MMC library from the Library Manager.
Can you tell me which version of the compiler you are using?
Kind regards,
Jovana
Re: PIC24 USB Host Mode
I'm trying to configure the PIC24FJ128GC010 for USB host mode. i want to connect mouse or keyboard with USB host port of PIC24FJ128GC010. So please share me the correct example code and please explain how to access those links. i have already checked in the comments where you shared some links but i don't have any idea how to access those links in mplab x ide.
Re: PIC24 USB Host Mode
Hi,
Have you installed USB Host library from LibStock :
https://libstock.mikroe.com/projects/vi ... st-library
Regards,
Filip.
Have you installed USB Host library from LibStock :
https://libstock.mikroe.com/projects/vi ... st-library
Regards,
Filip.