View previous topic :: View next topic |
Author |
Message |
kerplatz
Joined: 01 Nov 2016 Posts: 18
|
General question about USB to PIC24 communication |
Posted: Wed Jan 18, 2017 10:27 am |
|
|
Hi,
We currently have a board design where we use a FTDI chip that provides a USB to I2C bridge for communications to our PIC24 chip. It is giving us trouble sometimes and we are considering other possibilities. One is to use a PIC24 chip that has USB on the chip. We are looking to use the PIC24FJ128GB204 as a replacement. Does CCS PCD compiler support this? FTDI gave us the code to implement for USB and I2C communications. What do we need to know before we settle on a particular PIC24 chip? How do we initiate communications over USB on the host which just happens to be Windows? Any links that explain this would be useful? Libraries that you know of? Anything that you can think of to help us make an informed decision. Thanks for your time. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Jan 18, 2017 10:36 am |
|
|
I gave up using PICs with internal USB years ago(4550 vintage) since for a $1 more I could buy a USB<>TTL module. It saved a LOT of hassles,saved memory(no driver) and so far none have ever caused me any problems. I did remove the onboard PWR LED though. Too dang bright!
maybe something to consider.....
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Jan 18, 2017 12:29 pm |
|
|
For simple serial emulation, the CCS USB drivers work fine. The loss of space is much more bearable on later PIC18's, and larger chips like the PIC24 models than it was when USB was first introduced on the PIC's (this I know was part of the reason Temtronic went away from this). Have to ask though what problem you are seeing with the FTDI chip?. These are normally pretty reliable, and it is possible that your problem is from another cause like power, USB standby handling, impedance matching etc.. If so you might well have the same problems with a PIC solution....
Things that classically cause problems:
1) Not realising that if a device is not powered from the USB bus, then it is _required_ in the specs to implement bus power detection, and reset the USB, when power is re-applied. Very common fault, and causes much more problems on 'modern' OS's that shutdown the USB bus.
2) How is the power for the transceivers being generated?. A variation in this can cause all sorts of problems.
3) Having imbalanced lengths on the PCB tracks, or track widths/spacing that does not match the USB requirements can make any chip unreliable.
4) Are you _sure_ you are getting genuine FTDI parts?. Unfortunately their chips have been 'much cloned' and the copies often exhibit problems. The FTDI drivers have actually at times been deliberately modified to ensure that the clones won't work... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Jan 18, 2017 4:54 pm |
|
|
comment:
When using USB from a PC to power your device be SURE the USB port is set for the current you require ! I got 'surprised' one day when a product that had worked fine for days suddenly didn't. Using USBView I saw that the power capability of that USB port had been set to 100ma from 500ma ! To date I still have NO idea why 'Windows' did that, it sure wasn't me !
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu Jan 19, 2017 1:31 am |
|
|
On the power, the default for a port is meant to be 100mA. Devices have to request more power if they need more than this.
However on most chipsets, their is not proper power management, and so 'dumb' devices can be plugged in and draw more. Some though do implement the proper USB specifications on this.... |
|
|
|