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

Interfacing PIC to removable memory

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



Joined: 28 Sep 2016
Posts: 14

View user's profile Send private message

Interfacing PIC to removable memory
PostPosted: Wed Jun 14, 2017 8:37 am     Reply with quote

I'm using a PIC16F1789.

I'd like to have some type of removal memory storage interfaced with the pic. The type of memory device is not important, as long as I can easily remove it and connect it to a computer.

The memory device will contain only a small file (.txt) with configuration data. This data will be read during startup by the pic. I will not write any data to the memory device after connecting to the pic.

I've never done something like this before, and would just like a bit of advice before I possibly get in over my head. The types I've primarily looked at are MicroSD or a USB flash drive. However, the general impression I've gotten is that I'll need a different chip to handle these (PIC18+). I've also looked at interface chips such as FT230XS-R, to bridge USB to UART to help interface to the PIC; however it's not immediately obvious to me how this is accomplished.

I've seen that CCS has some built-ins for these types of interfaces, but not sure which type is most feasible or preferred.

Is something like this feasible?
Would a different PIC be required/suggested?
What type of memory is easiest to interface to?

Appreciate any feedback.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Jun 14, 2017 9:13 am     Reply with quote

For direct connection, SD far easier. But you need a PIC with lots of RAM, and preferably 3.3v to do this. To handle a USB stick, you would need to implement a USB master.....

However much easier solution. Use a FTDI Vinculum. This is a tiny chip/board (available as a bare chip or as a pre-built board/module). Do a search for 'VDRIVE3'. This does all the work for you. Handles USB, opening files etc., just needs a serial connection to the PIC. Simple ASCII commands to open a file, write things to it etc..
temtronic



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

View user's profile Send private message

PostPosted: Wed Jun 14, 2017 10:44 am     Reply with quote

I have to 'second' Mr. T's choice of the Viniculum devices. Super easy to get 'up and running', easier than an SD device...though more $$ up front. IF you value your time, it is the way to go.
One hint... If you store your data in 'Comma Separated Variable (CSV) format (x,y,z,a,..cr/lf, check online for format...). A PC with Excel can 'autoload' the data into a spreadsheet ! THAT makes it quick and easy to confirm the data is good, saving you days of frustration wondering why the VB program you cut isn't working......

Jay
benoitstjean



Joined: 30 Oct 2007
Posts: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Sat Jun 17, 2017 6:42 am     Reply with quote

Or get yourself a PIC24EP512 which has a load of program space and lots of RAM and get your hands on Brush Electronics' SD card driver. It works flawlessly, can be used royalty-free and is not super expensive, around 150$ USD.

Depending on if this is a personal project (therefore 150$ might be overboard), you could always use the SD card over SPI as a straight raw device but you need to understand the concept of SD cards and why data must be written in blocks, reading and writing to the same spot will wear-out the card prematurely etc.

There is a lot of science behind SD technology, it's not like reading and writing to a standard EEPROM starting at address 0.

Good luck.

Ben
benoitstjean



Joined: 30 Oct 2007
Posts: 543
Location: Ottawa, Ontario, Canada

View user's profile Send private message

PostPosted: Sat Jun 17, 2017 7:06 am     Reply with quote

Or get yourself a PIC24EP512 which has a load of program space and lots of RAM and get your hands on Brush Electronics' SD card driver. It works flawlessly, can be used royalty-free and is not super expensive, around 150$ USD.

Depending on if this is a personal project (therefore 150$ might be overboard), you could always use the SD card over SPI as a straight raw device but you need to understand the concept of SD cards and why data must be written in blocks, reading and writing to the same spot will wear-out the card prematurely etc.

There is a lot of science behind SD technology, it's not like reading and writing to a standard EEPROM starting at address 0.

Good luck.

Ben
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