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 CCS Technical Support

USB memory with PIC24, CCS

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



Joined: 27 Jun 2018
Posts: 6

View user's profile Send private message AIM Address

USB memory with PIC24, CCS
PostPosted: Fri Dec 21, 2018 2:54 am     Reply with quote

Hi everyone.
I am going implement USB memory for my project.
I tried few days but i not yet know where should i start from.
Somebody said SDCard memory is more easy. But in my case i must use USB memory because hardware already made.
It will be great if somebody can help me some document or sample code.
Currently i am using PIC24FJ128GB204 and CCS 5.04.

Thank you for any one come to read this topic or help me. Very Happy
P/s: sorry because my terrible English. Crying or Very sad
Ttelmah



Joined: 11 Mar 2010
Posts: 19569

View user's profile Send private message

PostPosted: Fri Dec 21, 2018 3:07 am     Reply with quote

Major work I'm afraid.

As far as I know, nobody here has gone through the bother of doing this.
CCS do not supply USB OTG code (which is what you need to do this), so
you would have to port this from the MicroChip USB stack.

No code available.

The MicroChip USB stack itself, gives lots of issues when this is used
(typical success rate is perhaps only 90%).

The 'easy' way is to instead use an FTDI Vinculum, which then means
just a serial connection to talk to the USB memory.
For an SD card, the work has been done already.

As a further comment though 5.04, was a very early beta of the V5
compilers. It is unlikely to be completely reliable even if you had got code
for this. There were issues with interrupts being disabled in Printf, and
quite a few driver oddities at this time.

Building the hardware before investigating what is really needed, is a
little silly I'm afraid...
Hopefully your PIC has got a crystal, since this is _required_ to implement
a USB master device...
temtronic



Joined: 01 Jul 2010
Posts: 9255
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Dec 21, 2018 6:47 am     Reply with quote

As Mr T says MAJOR work !! Even I won't code OTG for a PIC, used a Vinculum years ago.Been playing with PICs for 1/4 century...sigh
You'll need to do a LOT of reading, goto Microchip's site and find EVERY 'application note' about OTG USB, get on their 'forum' and see what's there, try googling.
As a 'first step', I'd cut code and get teh PIC to talk to a PC via USB, that should be kinda easy...... It will confirm the hardware is correct and working.
After that..more reading and testing.
USB is NOT simple or easy. I refer to it as the Useless Serial Bus. Way overly complicated and not interrupt driven unlike good old 'RS-232' comports.

Jay
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Fri Dec 21, 2018 7:27 am     Reply with quote

temtronic wrote:

USB is NOT simple or easy. I refer to it as the Useless Serial Bus. Way overly complicated and not interrupt driven unlike good old 'RS-232' comports.

That's from a developer standpoint :p
Luckily, it's super easy from a consumer point of view.
temtronic



Joined: 01 Jul 2010
Posts: 9255
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Dec 21, 2018 8:09 am     Reply with quote

yah, until some 'ap' changes the USB allowed current in the config !!
I never tracked down THAT gremlin.....
What gets me is the shear 'overhead' to transmit data, Top heavy, very top heavy. I use a com system that in 22 BITS, sends 20 BITS of data on a true single wire (plus Earth) that has been (and will be ) hackerproof for 30+ years.
1st PIC project used a 16C84 to replace 22 4000 series devices.

Jay
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