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

PIC16F877 to uMMC (FLash Card module) question

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



Joined: 02 Mar 2006
Posts: 16

View user's profile Send private message

PIC16F877 to uMMC (FLash Card module) question
PostPosted: Fri Mar 03, 2006 2:05 pm     Reply with quote

Please help. I've been trying to interface the uMMC with my PIC16F877 but can't seem to get it to work. I'm unable to open a new file, write to it, etc. The uMMC requires a carriage return and line feed after sending it an instruction. I'm not sure how to send that safely.

Here's the current code that I've been working with. Please help!

Note: baud rate set to 9600. Also, I'm using C language(CCS compiler).

void main(){
char prompt;

while (prompt != '>'){ //check if module ready
prompt = getc();
}

printf ("O 1 W input_data.txt", 0x0d, 0x0a); // Is this how u send a carriage return and line feed?

while (prompt != '>'){ //Is uMMC ready for next instruction?
prompt = getc();
}

printf ("W 1 19", 0x0d);
printf ("Date: Mar 03 2006", 0x0d, 0x0a);

while (prompt != '>'){
prompt = getc();
}

printf ("C 1", 0x0d);

}

Please...someone help!!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 03, 2006 2:26 pm     Reply with quote

Use the following Escape Sequences for carriage return and linefeed:
Quote:
\r for carriage return (0x0D)
\n for linefeed (0x0A)


Example:
Code:

#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

void main()
{

printf ("C 1\r\n");

while(1);
}
King Virus



Joined: 02 Mar 2006
Posts: 14
Location: Italy

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Mar 05, 2006 3:51 am     Reply with quote

Hi dacenrie !

Could you give me some help about buying a uMMC... I know it but I´m not able to find a distributor who send this product to Italy, where I live. Crying or Very sad
_________________
*** A good forum is a forum where people respect eatch other ! ***
dacenrie



Joined: 02 Mar 2006
Posts: 16

View user's profile Send private message

PostPosted: Mon Mar 06, 2006 2:43 am     Reply with quote

I got mine from roguerobotics.com, see if they are willing to ship to Italy. I'm not to sure if anyone else will. Sorry.
King Virus



Joined: 02 Mar 2006
Posts: 14
Location: Italy

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Mar 08, 2006 2:41 pm     Reply with quote

Hi dacenrie !

Thanks,
buth they don´t send it to Italy,... Crying or Very sad

I´ll search again in the web...
_________________
*** A good forum is a forum where people respect eatch other ! ***
Ttelmah
Guest







PostPosted: Wed Mar 08, 2006 3:32 pm     Reply with quote

They do have distributors in the UK, Spain, and France. I'm sure one of them would help. Look under 'distributors', in the roguerobotics site.

Best Wishes
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