Error programming with SD Card reader interfaced to SPI

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a very basic circuit circuit setup with an Atmega 8515, LED w/resistor, reset button, bypass cap, and an SPI interface to an AVR Dragon.  No issues in Atmel Studio 7, I can make the LED blink... fine, so now I have a way to output basic status.  The purpose of this circuit is to try reading an SD card so I next interfaced the card reader.  Upon interfacing it I can no longer program the AVR.  Of course I realize there is surely a good reason for this, which is why I'm here to ask for advice.  I figure the issue is related to the fact that I have the card reader hooked up to the same SPI pins as the AVR Dragon uses to communicate to the device.  I'm using one of those generic micro SD-card boards that have on board level conversion (specifically this one https://www.amazon.com/gp/product/B01JYNEX56/) interfaced as follows.

 

CS (PB4)
MOSI (PB5) daisy chained to SPI header
MISO (PB6) daisy chained to SPI header
SCK (PB7) daisy chained to SPI header

VCC (5V+)

GND (GND)

 

I chose the above pinout based on some example schematics and some reading.  When the card reader is interfaced (no card yet) Atmel Studio reports back the the error below when I try to program the device.  When I remove the card reader it works again.  Could someone kindly advise if I have this interfaced incorrectly and perhaps provide a nudge in the right direction?

 

Failed to enter programming mode.  ispEnterProgMode: Error status received: Got 0x0c, epected 0x00.

 

Much appreciated.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mpu pin>....dragon....1k resistor...SPI device...

 

Place 1k resistors between where the dragon connects to the mpu (mosi, miso lines) and your external spi device.

So the dragon can overpower any levels supplied by the device.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Thu. Apr 4, 2019 - 02:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah, thank you.  I had in-fact seen resistors there in some of the schematics I was looking at while others didn't show them.  It makes sense, I'll try it, thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


It's one of (a) AVR040, (b) AVR042 or (c) the actual datasheet that tells you how to "share" ISP with resistors like this - if designing circuits/PCBs it's probably an idea to read them all.

 

EDIT: quick refresh of memory says Chapter 4 in AVR042. Specifically:

 

Last Edited: Thu. Apr 4, 2019 - 02:43 PM