View previous topic :: View next topic |
Author |
Message |
dacenrie
Joined: 02 Mar 2006 Posts: 16
|
PIC16F877 to uMMC (FLash Card module) question |
Posted: Fri Mar 03, 2006 2:05 pm |
|
|
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
|
|
Posted: Fri Mar 03, 2006 2:26 pm |
|
|
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
|
|
Posted: Sun Mar 05, 2006 3:51 am |
|
|
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. _________________ *** A good forum is a forum where people respect eatch other ! *** |
|
|
dacenrie
Joined: 02 Mar 2006 Posts: 16
|
|
Posted: Mon Mar 06, 2006 2:43 am |
|
|
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
|
|
Posted: Wed Mar 08, 2006 2:41 pm |
|
|
Hi dacenrie !
Thanks,
buth they don´t send it to Italy,...
I´ll search again in the web... _________________ *** A good forum is a forum where people respect eatch other ! *** |
|
|
Ttelmah Guest
|
|
Posted: Wed Mar 08, 2006 3:32 pm |
|
|
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 |
|
|
|