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

PIC18F + USB Pen Drive

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



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PIC18F + USB Pen Drive
PostPosted: Wed Aug 11, 2004 7:19 am     Reply with quote

Has anyone tried it?

I am looking for a simple way to datalog some info in my application, I think this would be the best/easiest way to do it.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Aug 11, 2004 8:13 am     Reply with quote

I have never looked into it, but connecting an USB Pen Drive might be difficult because some of those devices download the driver code from the host, and now your PIC18F has become the host....

Why not interface a memory card directly to your PIC? The SD/MMC and CompactFlash cards are the choice for new designs. SD/MMC has the advantage of serial access with only 4 to 6 wires. The SD-card has some nasty design issues, documentation is only available after paying an expensive yearly license fee. I would recommend CompactFlash which requires about 13 I/O lines but has no license fee and is much easier to implement. In case of a shortage on I/O lines you could add one of the I2C-based I/O expanders (Philips).

Ofcourse you want to read the data on your PC. You could implement a FAT16 directory structure and all the management routines for this, but that's a lot of work and takes about 10k of code space. A quick and dirty hack (I love those) is to hard code a FAT16 or FAT32 directory with a single huge file in it. Then from your code you can fill this file with your own data structure. On the PC read this huge file with some decoding program you write and store the data in whatever format suits you. The advantage of doing it like this is that on the PC you have all the routines for file handling available and tested for free.

Edit: Replaced MMC by SD/MMC.


Last edited by ckielstra on Wed Aug 11, 2004 9:12 am; edited 1 time in total
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Wed Aug 11, 2004 8:45 am     Reply with quote

What I want is when I power up my system, it creates a new logfile and store data as long as the system is running. I can let the system work for days until the memory is full, after that I can generate graphs on computer.
cbstieff



Joined: 09 Aug 2004
Posts: 7
Location: Kensington, MD

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 11, 2004 9:13 am     Reply with quote

It might simpler log data into free space in EEPROM or Program memory on the MPU. You could then use the ICD programmer/debugger to copy the data stored in the memory to a file
bdavis



Joined: 31 May 2004
Posts: 86
Location: Colorado Springs, CO

View user's profile Send private message

PostPosted: Wed Aug 11, 2004 1:48 pm     Reply with quote

Another option is to look at Atmel's 4 Meg Flash part - a serial 8 pin dip. Digikey stocks it. It would save you lot's of time, and money. The cost was between $6 and $7 for a 4Mbit part (512K Bytes). I don't know how much data you are logging, but half a meg is quite a bit to me.
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