Discussion in "8051 Discussion Forum" started by    andrefrejat    Apr 3, 2014.
Thu Apr 03 2014, 09:52 PM

I've been following the tutorial on how to use Elm Chan's tutorial to communicate with a SD card. I'm actually using CC1110, from TI, on IAR Workbench for the program.

Inside the disk_initialize function, exactly on "CardType = 0" my microcontroller resets, it starts the program all over again. Does anybody have any guesses about the reason?

Another thing, I don't know what I did wrong, but there are 4 #define missing in my program:

#define IDLE_STATE
#define SD_TIME_OUT
#define SD_ERROR
#define SD_DATA_SIZE

The only one that I thought I had a more or less accurate answer was the IDLE_STAT (0x01) but I have no idea if that's right.

Thanks in advance,
Fri Apr 04 2014, 06:56 AM
Can you tell me what version of FATfs library are you using?
It is hard to say why CPU is getting reset. wild guess... do you have any watchdog running?

For missing defines.. I need to check the code first. Let me know what version are you using.
Tue Apr 08 2014, 03:54 PM
Ajay Bhargav,

Sorry about the delay, I thought I had replied before.

I'm using the Generic FatFs V0.06 (the one I think the tutorial used as well).
Is a wild guess I'm looking for, so I appreciate that!

I'm not running any watchdog, it was one of the first things I've tried.
The problem I'm having now is that it's restarting actually inside the "do" loop in SD_init() function. I've "discovered" that send via UART messages to the PC.

Did you get the defines?

Kind regards,
Wed Apr 09 2014, 10:27 AM
the do-while loop has nothing which can reset your controller. Its a simple SPI send and read. Most probably it has something to do with your SPI functions. Did you create your SPI library yourself or downloaded it from TI?
I would also suggest you to update your source to 0.10a latest version.
Sun Jun 15 2014, 08:37 PM
Hello again,

I started working on the project again and managed to get rid of the resetting problem. But I still wasn't able to find the definitions for:


Did you find it on your code?

Thanks in advance,
Mon Jun 16 2014, 07:04 AM
those are SD specific routines which might be different for everyone. However I will ask Dave to provide those missing defines. Meanwhile you can take reference from FatFs sample projects and use SD init routines from one of the project you can understand well. Let me know if you need any suggestions.

Tue Jan 05 2016, 04:55 PM

I'm also not able to find those defines. Any luck? I know that we have to define it in SDcard.h file, the question is whats the value for each define?

Get Social


Powered by e107 Forum System


Mon Apr 12 2021, 11:54 AM
Joe N
I have recently launched my own site, and I am looking to provide value for you for free, by giving away 26 professional level blog post templates (worth $297).
Mon Apr 12 2021, 09:24 AM
Hey, I think your site might be having browser compatibility issues. When I look at your website in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, very good blog! https://onanadiete.ru/alpha-numeric-reasoning-questions-and-answers-pdf.pdf alpha numeric reasoning questions and answers pdf alpha numeric reasoning questions and answers pdf



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 92, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123