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

pic18f452 writing in MMC card with spi mode

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



Joined: 07 Feb 2012
Posts: 34

View user's profile Send private message

pic18f452 writing in MMC card with spi mode
PostPosted: Sat Mar 31, 2012 9:08 am     Reply with quote

hello guys!!
I have a 18f452 and i would like to know how to use Spi mode to just write 5 adc values in mmc card.
If its possible show me a simple example plz!
Thanks !!
_________________
NOway!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19431

View user's profile Send private message

PostPosted: Sat Mar 31, 2012 9:27 am     Reply with quote

The complicated part, is not the software, but the hardware. The 452, is a 5v PIC, which means you need 5v, to 3.3v adapting circuits on the signals from the PIC to the SPI card (this can be done with resistors), 3.3v power supply to feed the card, and (worse), 3.3v logic to 5v logic for the signals the other way.
The code is about 5 minutes work. Open a file, write the values as text with printf, and close the file. The hardware between the two chips is a few _hours_ work.
You need the hardware working first.

Best Wishes
temtronic



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

View user's profile Send private message

PostPosted: Sat Mar 31, 2012 9:32 am     Reply with quote

1) the PIC18F452 does NOT interface directly with any MMC card ! Search this forum for dozens of 'hits' about this subject.

Once you have proper hardware, simply use the example that CCS provides in the examples folder or one of the ones here or in the code library forum.

2) If you have any problems...post compiler version, PIC type,MMC card and how/what the interface between the PIC and MMC card is.

3) failure to NOT properly interface 5 volt PIC to 3 volt MMC card will destroy the MMC card, so reread step #1 !

4) be advised that not all MMC cards conform to any 'standard', as well some drivers may not work with larger cards.
exodia505



Joined: 07 Feb 2012
Posts: 34

View user's profile Send private message

PostPosted: Sat Mar 31, 2012 9:33 am     Reply with quote

I know that sd card runs with 3.3v.

I just need to write values no read from mmc card.
I think my hardware circuit is set and fine.
May you give me a simple code example plz?
I don't want to write data in blocs of 512 byte.
_________________
NOway!!


Last edited by exodia505 on Sat Mar 31, 2012 11:09 am; edited 1 time in total
dyeatman



Joined: 06 Sep 2003
Posts: 1929
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Mar 31, 2012 10:51 am     Reply with quote

OK, so you are not blind, glad to hear it! Folks here took the time to
say this so you could avoid the mistakes made recently by many
others on this board, so your attitude is unwarranted.

Since you are not blind I assume you can SEE the Search button at the
top of the forum page. So, why didn't you search the forum before
asking? There is lots of code already there without asking someone
here to do the work for you.
_________________
Google and Forum Search are some of your best tools!!!!
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