Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Write into Flash Memory thru Micro

Status
Not open for further replies.

sahilgore

New Member
I need to interface a micro with a mass storage device. There are many USB compatible microcontrollers available (eg: The 16 bit AMD AM186CU). I want to know if such a micro can directly write into a USB flash drive, or will I need some driver ICs in between. Also, how will the micro address the memory locations of the flash drive, or detect with of those are free. Can the micro also read the memory of the drive?

Any alternative suggestion would also be helpful. Basically, I'm using the micro for 24hr monitoring and data logging from 6 diff sensors. Just need to store the data in a user friendly, portable device to transfer to a PC after a finite time. On-chip memory and a RS232 connection to PC is not an option as the system (micro circuit) has to stay in the field and cannot be brought in.
 
I suggest you dump the USB idea! - check FLASH memory cards instead, there are plenty of FLASH memory card projects around using micro-controllers.

You might try searching here for all the other threads about it!.
 
If you really want to, you could use a SD card and then when you want the data you take the SD card out of the device and plug it into a card reader. Doing this manually in assembly would be rather time consuming because you would have to write your own fat file system format libraries.

A solution is you could buy mikroC which has a SD interface built right into it. The downside is it is $250.
 
That does look nice, especially at that price. It looks a bit bulkier than it needs to be, but all in all, it would be great for prototyping. :)
 
CompactFlash is IDE compatible so if an IDE interface is included in the circuit you read and write to the flash card with reasonably simple commands.
 
SD cards have a SPI interface, which is very simple and many PICs have as a hardware module. It is also easy to bit-bang.

I think the SD card may have somewhat large block size that requires significant PIC RAM to buffer, but I'm not sure.

There are a bunch of projects on the web where they've interfaced the SD card with the PIC.

You can buy SD card sockets for under $1 from Digikey/Mouser. It's very simple. Power and a few data wires. I seem to recall the interface may be 3.3v though, if that's true you'd either need to add some level converting components or use a low voltage PIC with a 3.3v supply.
 
Thanks, shall try out an SD card interface.

Hey, thanks guys. Will try out the SD card idea, although I'm not too keen on using a PIC. Have worked with the 8051 CPU before. Atmel has come out with a new chip 89C51SND2C which supports SD and MMC cards. It also has flash memory read/write capabilities. Would like to explore that first, as I'm more comfortable with the C51 architecture and instruction set.

Does anyone feel a PIC would be a better option? If yes, why?
 
Found an SD card reader with USB interface.

**broken link removed**

$10 is not bad. Saw a few cards available for the same price. Suits me need perfectly. Need to interface a micro thru SPI to write into the card now. I read on the net (and on some other threads) about SD interfacing, and it seemed like a lot of people were have problems with it. Is it as bad as it sounds? Wikipedia also says that SD card specifications are not freely avilable yet.
 
sahilgore said:
Hey, thanks guys. Will try out the SD card idea, although I'm not too keen on using a PIC. Have worked with the 8051 CPU before. Atmel has come out with a new chip 89C51SND2C which supports SD and MMC cards. It also has flash memory read/write capabilities. Would like to explore that first, as I'm more comfortable with the C51 architecture and instruction set.

Does anyone feel a PIC would be a better option? If yes, why?

They aren't really any better or worse, just that a PIC has become a generic name for a micro-controller - use whichever processor you're comfortable with!. If Atmel have a processor that supports the cards, and you're already familiar with Atmel devices, then go for that - it would be stupid to change to a PIC when you're already using Atmel ones.
 
sahilgore said:
Found an SD card reader with USB interface.

**broken link removed**

$10 is not bad. Saw a few cards available for the same price. Suits me need perfectly. Need to interface a micro thru SPI to write into the card now. I read on the net (and on some other threads) about SD interfacing, and it seemed like a lot of people were have problems with it. Is it as bad as it sounds? Wikipedia also says that SD card specifications are not freely avilable yet.
You can get a set of general specs (still like 100+ pages long) from sdcard.org I believe. If you are using a mcu with support for reading and writing files in FAT format you should not have any troubles. If you aren't however, then you will have to spend quite some time getting it to work.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top