Discussion in "8051 Discussion Forum" started by    andrefrejat    Apr 4, 2014.
Fri Apr 04 2014, 03:22 am
#1
Hello

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,
André
Fri Apr 04 2014, 12:26 pm
#2
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, 09:24 pm
#3
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,
André
Wed Apr 09 2014, 03:57 pm
#4
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.
Mon Jun 16 2014, 02:07 am
#5
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:

IDLE_STATE
SD_TIME_OUT
SD_ERROR
SD_DATA_SIZE

Did you find it on your code?

Thanks in advance,
Andre
Mon Jun 16 2014, 12:34 pm
#6
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, 10:25 pm
#7
Hi,

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

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am