Datasheet

{
for(k=0; k<512; k++)
{ //UART1_Write(dData[k]); // send 512 bytes from MMC
card via usart
printhex(dData[k]);
UART1_Write(' ');
if(((k+1) % 16)==0)
{
UART1_Write(' ');
//printhex(k);
for(px=(k-15); px<=k; px++)
{
if((dData[px]>33) && (dData[px]<126))
{
UART1_Write(dData[px]);
}
else
{
UART1_Write('.');
}
}
UART1_Write(13);
}
}
UART1_Write(13);
UART1_Write(10);
}
else
{
UART1_Write_Text("Read-error");
UART1_Write(13);
UART1_Write(10);
}
}
}
if(serial_buffer[0] == 'W') // Command: Write
{
if(serial_buffer[1] == 'w')
{
// Generating 32-bit address of the sector out of four received bytes
sector_address = ((long)first_byte << 24) + ((long)sec-
ond_byte << 16) +
((long)third_byte << 8) +
((long)fourth_byte);
for(k=0; k<512; k++)
dData[k] = received_character;// fill RAM baffer
i = Mmc_Write_Sector(sector_address, dData); // write
buffer tou MMC
if(i != 0)
339
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6