Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SD card write operation interruption problem

Status
Not open for further replies.

my_abousamra

Junior Member level 3
Joined
Nov 25, 2008
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,478
Hi there,

I'm working on an application that writes double blocks to sd card ,which is connected to spi-0 bus alone, every 50 ms and lasts for about 2ms and at the same time receiving interrupts from an external adc, which is connected to spi-1 bus alone, to read data every 2ms and lasts for 330us.

The sd card hangs up when it is interrupted by the adc although they are on different spi buses

why that occurs and how to prevent/overcome it?

Note that when I disable interrupts during writing to the sd card it works properly but I'll lost some data

I'm working on AT91SAM7X microcontroller based on arm7tdmi core.

Thanks,
 
Last edited:

why that occurs and how to prevent/overcome it?
SPI interface is fully static. Seeing the SD card hanging suggests that you have yet unnoticed side effects of the ADC interrupt service affecting SD card operation. Need to find it.
 

SPI interface is fully static. Seeing the SD card hanging suggests that you have yet unnoticed side effects of the ADC interrupt service affecting SD card operation. Need to find it.

What do u mean by spi interface is fully static?

Note that the interrupt itself doesn't cause the sd card hanging but the spi communication to the adc in the interrupt handler cause that problem and if skipped this communication step if the sd card is busy then sd card will continue working properly.

The 2 SPIs are separated so why they are affecting each other!
 

What do u mean by spi interface is fully static?
A well defined technical term. Fully static means, the communication can be paused for infinite time and restarted at any point of the protocol.

The 2 SPIs are separated so why they are affecting each other!
Apparently they are not completely separated in your code, otherwise this wouldn't happen. Probably a small bug.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top