CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

General question about USB to PIC24 communication

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kerplatz



Joined: 01 Nov 2016
Posts: 18

View user's profile Send private message

General question about USB to PIC24 communication
PostPosted: Wed Jan 18, 2017 10:27 am     Reply with quote

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: 9200
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jan 18, 2017 10:36 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 18, 2017 12:06 pm     Reply with quote

This page describes the CCS Pic24 USB Development kit:
http://www.ccsinfo.com/product_info.php?products_id=usb-pic24-kit
Ttelmah



Joined: 11 Mar 2010
Posts: 19446

View user's profile Send private message

PostPosted: Wed Jan 18, 2017 12:29 pm     Reply with quote

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: 9200
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jan 18, 2017 4:54 pm     Reply with quote

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: 19446

View user's profile Send private message

PostPosted: Thu Jan 19, 2017 1:31 am     Reply with quote

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....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group