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

A bit off topic: MMC Card Stuff

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



Joined: 15 Jun 2004
Posts: 21
Location: Nottingham UK

View user's profile Send private message

A bit off topic: MMC Card Stuff
PostPosted: Wed Nov 03, 2004 3:43 am     Reply with quote

Chaps (and quite possibly chapesses):

Sorry if this is a bit off topic, but you all are so knowledgable, it would seem churlish not to ask:

I have a requirement to read in lots of data from RS232 device to MMC memory (10MB or more) and then squirt out on USB.

Thinking of using 16F87 with a SIL CP2102 USB chip....but I have a question or two:

1) Where can I find the MMC spec?
2) Can one buy MMC memory chips ready for surface mount, or do I need to get hold of a carrier? And if so where from?
3) Can I really drive MMC using I2C or similar, and will the 16F87 cope with that? I read that the 512 byte input buffer for the MMC chip can be clocked really slow, so speed isn't an issue (the data comes in down to 9600...)

And, while I'm asking (!!!) - does anyone know of a supplier for LCD display that uses serial or I2C interface and runs on 3.3V, for 20x4 chars or similar?

Thanks in advance

Gizz
ckielstra



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

View user's profile Send private message

PostPosted: Wed Nov 03, 2004 5:08 am     Reply with quote

Quote:
1) Where can I find the MMC spec?
Lazy? Use mmc in Google and the first hit is www.mmca.org

Quote:
Can I really drive MMC using I2C or similar,
SPI you mean. Other option is the 4-bits wide MMC-bus.

Beware that you can only write data in blocks of 512 bytes. So in order to change a single byte you have to read the whole block, change the byte in RAM and then write the whole block again. Data reading is possible bytewise.

The 16F87 only has 368 bytes of RAM. A good option is to include the possibility for connecting an external memory to your processor, for example the Ramtron FM24CL16, a serial 16kbit FRAM memory, EUR2,31. FRAM sits in between RAM and EEPROM, as fast as RAM but doesn't loose it's contents when power is removed.

If you choose to implement multiple SPI devices, then be aware better not to place them on the same SPI bus. The MMC block-write of 512 bytes requires the chip-select to be active during the whole write making it impossible to switch to another SPI device on the same bus (only 368 bytes of RAM in the 16F84...). That's why I suggested the FM24CL16 which is I2C instead of the FM25C160 which is SPI. The CCS compiler is good in implementing an I2C software interface.
Gizz



Joined: 15 Jun 2004
Posts: 21
Location: Nottingham UK

View user's profile Send private message

Not lazy, just a bit thick!
PostPosted: Wed Nov 03, 2004 9:10 am     Reply with quote

Thanks ckielstra

I appreciate your saying that there is not much RAM on the 87, but my app is very very simple, and doesn't need much RAM.... the data rate in is 9600 baud and all I'm doing is storing it, not parsing it or acting on it, so it can go straight into the MMC. And then straight out again via USB. Its v cost sensitive so a Ramtron part is not desired, even though they are cheap.

I wouldn't be changing a byte of data, simply writing in big chunkcs, and then streaming them out again on USB a few minutes later.

I take it that SPI has to be done manually on the PIC?
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

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

PostPosted: Wed Nov 03, 2004 9:36 am     Reply with quote

I didn't check the numbers,...BUT to write a 512 block, you need to store,(buffer) until you recieve that many bytes, right??? So there your RAM req is busted. I personaly would use a PIC that could store the whole 512.
ckielstra



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

View user's profile Send private message

PostPosted: Wed Nov 03, 2004 10:18 am     Reply with quote

Quote:
Thinking of using 16F87 with a SIL CP2102 USB chip....
You are fast! This chip was only released 2 days ago! Are you sure it is already available?

Quote:
I take it that SPI has to be done manually on the PIC?
The 16F87 and most other PICs have hardware support for SPI. The CCS compiler has additional great support functions like spi_write and spi_read.

Don't take my word for it, I haven't tried it and didn't study the specs in detail regarding the following...
MMC timing is not very critical, as long as you keep the MMC Chip Select line active you can clock in your data at any rate you want. Even long delays between succeeding bytes of the 512 byte block are allowed (I think). So theoretically you can indeed read data from RS-232 and copy it directly to the MMC.
Two restrictions to remember:
1) Writing to USB will have to wait for the current 512 bytes block to be finished.
2) During USB writes you still need to buffer incomming RS-232 data.


In a cost sensitive device the price for the connector is a possible problem. I never heard of a solderable MMC. Connectors always give electrical problems, soldering is much better. We use glue to fix the MMC card in the connector.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Nov 03, 2004 10:44 am     Reply with quote

treitmey wrote:
I didn't check the numbers,...BUT to write a 512 block, you need to store,(buffer) until you recieve that many bytes, right??? So there your RAM req is busted. I personaly would use a PIC that could store the whole 512.


Unless it is possible to write the bytes as they come in. Is there any limitation how slowly you can write that 512 block? I don't know MMC but I haven't heard anything yet to disqualify the 16F87.
_________________
The search for better is endless. Instead simply find very good and get the job done.
SteveS



Joined: 27 Oct 2003
Posts: 126

View user's profile Send private message

3.3v display
PostPosted: Thu Nov 04, 2004 7:57 am     Reply with quote

On the display subject, you may want to look at the Nokia 3310 display. It's very thin and small, 2-something to 3.3V, B&W, graphical (84 x 48), serial interface. You can do 6 lines by 14 characters using 8x5 fonts. Reflective, so no backlight needed - of course that's a negative if you need to read it in the dark....



- SteveS
Gizz



Joined: 15 Jun 2004
Posts: 21
Location: Nottingham UK

View user's profile Send private message

PostPosted: Mon Nov 08, 2004 12:41 pm     Reply with quote

ckielstra, the CP2102 is being sampled in the UK next week - I have a few on order.

And, the USB and the RS232 interfaces are used at different times (RS232 for data in, then USB for data out at a different location...)

Thanks all for your comments!
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