mmc fat write problem

General discussion on mikroC.
Post Reply
Author
Message
waelmoharam
Posts: 3
Joined: 22 Feb 2011 20:19

mmc fat write problem

#1 Post by waelmoharam » 22 Feb 2011 23:19

hi , i want to make txt file on mmc (fat16) , I want to send special key to txt file such as ( enter key to make newline) and (tabe key to separate bt words) , i make the file and send characters to it but i cannot make newline or separate tab bt words . can you help me plz.

waelmoharam
Posts: 3
Joined: 22 Feb 2011 20:19

Re: mmc fat write problem

#2 Post by waelmoharam » 25 Feb 2011 19:22

i need write fat16 code plz

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: mmc fat write problem

#3 Post by filip » 28 Feb 2011 14:05

Hi,

Please, look at the MMC FAT16 example provided by the compiler.
I'm sure that you will find it very useful.

Regards,
Filip.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: mmc fat write problem

#4 Post by Dany » 28 Feb 2011 15:18

waelmoharam wrote:hi , i want to make txt file on mmc (fat16) , I want to send special key to txt file such as ( enter key to make newline) and (tabe key to separate bt words) , i make the file and send characters to it but i cannot make newline or separate tab bt words . can you help me plz.
The "newline" is 2 characters: #13 followed by #10, and "tab" is character #9 in an ascii file.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

waelmoharam
Posts: 3
Joined: 22 Feb 2011 20:19

Re: mmc fat write problem

#5 Post by waelmoharam » 28 Feb 2011 20:17

thank you

linspire
Posts: 20
Joined: 03 Sep 2011 08:31

Re: mmc fat write problem

#6 Post by linspire » 18 Sep 2011 03:52

Dany wrote:
waelmoharam wrote:hi , i want to make txt file on mmc (fat16) , I want to send special key to txt file such as ( enter key to make newline) and (tabe key to separate bt words) , i make the file and send characters to it but i cannot make newline or separate tab bt words . can you help me plz.
The "newline" is 2 characters: #13 followed by #10, and "tab" is character #9 in an ascii file.
Hi, I know this's old thread. I'm doing related FAT16 project.
May I know how do I write these new lines you mentioned above ASCII codes ?
Is it written as Mmc_Fat_Write("#13#12",6) ? I got incorrect result by doing so.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: mmc fat write problem

#7 Post by Dany » 20 Sep 2011 11:25

linspire wrote:Is it written as Mmc_Fat_Write("#13#12",6) ? I got incorrect result by doing so.
No, You will have to fill a buffer (array) of 2 chars long with #13 and #10,

Code: Select all

Buffer[0] = #13;
Buffer[1] = #10;
and then do

Code: Select all

Mmc_Fat_Write(@buffer, 2);
I hope I have the C syntax correct (I am a Pascal user. :oops: )

Probably you can also do

Code: Select all

Mmc_Fat_Write(#13 + #10, 2);
(not sure...)
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroC General”