View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
USB on PIC24 |
Posted: Wed May 16, 2018 3:51 am |
|
|
There's any library for USB OTG for PIC24 in CCS or I must write my own?
Can PIC24 OTG capable device run just with the regular USB library as CDC or HID?
I read in another older post that is possible to use the Microchip OTG library in a CCS code by linking it.
I never do it something like that.
Is that possible?
Any tutorial? _________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed May 16, 2018 6:44 am |
|
|
No.
Yes.
The standard PIC library runs the devices as 'slaves' fine. For master you'd have to re-compile the MicroChip library. However 'beware'. Remember you have to have a stack supporting every device you want to use. The MicroChip library gives a lot of problems with many devices. I did adapt it some time ago, but after a while 'gave up'. Even compiling it with the MicroChip compiler it was terribly unreliable. I'd rate USB OTG on the PIC as a 'nearly' working product. It's OK if you are developing to use just one target device, but forget the normal simplicity of plugging in loads of different devices....
In the end it was much simpler to add a Vinculum. The complete VDRIVE2 module was about $20, and included the USB connector, and removed the need to have a crystal on my board (The internal oscillator was accurate enough for everything else). By the time you costed the connector, code, crystal etc., it was by far the easiest way to go.... |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Wed May 16, 2018 11:13 am |
|
|
Thanks for answering.
I just need to connect another PIC18F USB CDC or HID and a pendrive to load new firmware.
Later I was thinking in to use it to read MP3 and WAV files from a pendrive, but that is for another project.
Did you remember what library version did you used? _________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed May 16, 2018 11:36 am |
|
|
It was whatever Microchip was supplying the sources for about 3 years ago. Honestly use the Vinculum. That will do what you want and you could have it working in a few hours. |
|
|
|