Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

SD Card Raw Data Read

Suraj143

Active Member
Hi,

I have a SD card with raw data (Binary data).Can I use standard SPI with a low RAM PIC16F series chip & read the 8bits values & show in UART? Without using high end PIC18F with FAT file systems library etcc..!!

*PIC16F1509
*SD card 8GB
*Both will supply from 3V3.

Thanks
 
If you use a FAT system then it'll insist that it needs formatting.

Do you know how the raw data is stored?

Mike.
Hi Mike Nice to see you.

I use HXD Hex Editor, Below shows the binary file which generated from another software.

I open the HXD Hex Editor & open the above binary file. I can see like below (24 bytes). From this "HXD Hex Editor" I'm going to write to SD card as raw. There is no any file system here.

Now I want to read this 8 bit values from a PIC & see it from UART.

1706333075774.png
 
I'd suggest you set the base address for your data well above zero; eg. use something like a 4K offset for the start with both read and write; 0x1000 as the start address.

Writing at zero could possibly corrupt critical data and mess up the card completely; staying clear of that gives it a much better chance of working without problems.
 
As far as I'm aware, you have to initially start the card at a very slow speed, and then switch it to the normal speed - even if you're using it as a raw card. I think even with raw data, you have to read and write specific numbers of bytes, too much for a low spec. PIC.
 
Thanks for the suggestions. Sorry for the late reply. I was busy with this design.

I want to know below timing before I proceed with the SPI routine with SD card..!!

Oscillator = 16Mhz Internal
T2CON = 00000100; Pre Scaler = 1:1
PR2 = 2;
; MSSP configured for SPI master with Timer2_Period/2 clock
SSP1CON1= b00110011;

I want to know how much time it will take to transfer single byte through SPI (In micro seconds)?
 

Latest threads

New Articles From Microcontroller Tips

Back
Top