Discussion in "8051 Discussion Forum" started by    andrefrejat    Apr 3, 2014.
Thu Apr 03 2014, 09:52 PM
#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, 06:56 AM
#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, 03:54 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, 10:27 AM
#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.
Sun Jun 15 2014, 08:37 PM
#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, 07:04 AM
#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, 04:55 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

Conversation

No messages yet.

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 158, Members: 0 ...

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

Members: 38215
Newest member: Mirza123