Go Down

Topic: ATMega1284p issues with SD Card (Read 2 times) previous topic - next topic

bratan

May 05, 2013, 05:14 pm Last Edit: May 06, 2013, 01:55 pm by bratan Reason: 1
I just finished building new prototype (V2) for my xronos clock, this one has audio/microSD card and RF12B receiver on board. However I'm having a strange issue. With ATMega644p (Sanguino) almost everything works, microSD is read normally, but RF12B is not working. Knowing how buggy Sanguino is, I installed ATMega1284p chip (Bobuino) and now SD card is not working at all :(  (RF12B is working).
Now the most strange thing is when I take this same 1284p chip and put it into my V1 board (that has WaveShield connected as shield, but no RF12B) it can read SD card!
:smiley-eek:
I have no clue what to look for. If problem is in my hardware, then why 644p can read SD card. If it's software then why 1284p works on another board (where I have same exact IC pins connected to WaveShield)...
Is RF12B connected to same SPI as SD card interfere somehow? I'm using different CS pins for each.  Any suggestions? :)
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

pito

#1
May 05, 2013, 05:40 pm Last Edit: May 06, 2013, 03:59 pm by CrossRoads Reason: 1
..I would not mess with those HC125 drivers as the 1284p runs fine at 3.3V/16MHz..

bratan

#2
May 05, 2013, 05:52 pm Last Edit: May 06, 2013, 03:59 pm by CrossRoads Reason: 1

..I would not mess with those HC125 drivers as the 1284p runs fine at 3.3V/16MHz..

Hmm, that's true... I guess I can redesign the board, since I already have 3V reg. I only need 5V to drive LED matrix...
Thanks.

P.S. It seems issue with pin definitions somehow... I tried these bootloaders on same 1284p chip and here's result:

  • Mighty 1284 w/ Optiboot: RF12B Module works. SD card doesn't work

  • Bobuino: RF12B Module Doesn't work (I know I stated in my OP that it worked, but I was wrong). SD Card Doesn't work

  • Sanguino  1284 : RF12B Module doesn't work. SD Card WORKS!  


How do I get both working? :(
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

pito

#3
May 05, 2013, 06:04 pm Last Edit: May 06, 2013, 03:59 pm by CrossRoads Reason: 1
..have a look on the pin definitions in "pins_aruino.h" and do check the stuff around:
Code: [Select]

..
static const uint8_t SS   = 4;
static const uint8_t MOSI = 5;
static const uint8_t MISO = 6;
static const uint8_t SCK  = 7;
..


bratan

#4
May 05, 2013, 06:59 pm Last Edit: May 06, 2013, 04:00 pm by CrossRoads Reason: 1

..have a look on the pin definitions in "pins_aruino.h" and do check the stuff around:
Code: [Select]

..
static const uint8_t SS   = 4;
static const uint8_t MOSI = 5;
static const uint8_t MISO = 6;
static const uint8_t SCK  = 7;
..



Tried changing it, but no difference. In fact I'm surprised that SS is defined like that, it can be any pin...
BTW speaking of powering whole thing at 3.3V I realized that my DC1307 chip requires 5V.  Do you know if it will operate with 3.3V logic if I connect it to 5V VCC?
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

fungus

#5
May 05, 2013, 07:10 pm Last Edit: May 06, 2013, 04:00 pm by CrossRoads Reason: 1
SD cards need 3.6V.

Less than that, they may work, they may do weird things...you can never tell.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

pito

#6
May 05, 2013, 07:39 pm Last Edit: May 06, 2013, 04:00 pm by CrossRoads Reason: 1
Quote
I realized that my DC1307 chip requires 5V.  Do you know if it will operate with 3.3V logic if I connect it to 5V VCC?

Since it is an I2C guy it may work (I2C is an open-collector based stuff)..

Quote
SD cards need 3.6V.

Nono, Never do it.. They need max 3.3V.

fungus

#7
May 05, 2013, 09:09 pm Last Edit: May 06, 2013, 04:00 pm by CrossRoads Reason: 1

Quote
SD cards need 3.6V.

Nono, Never do it.. They need max 3.3V.


Here's the spec, read it for yourself:

https://www.sdcard.org/downloads/pls/simplified_specs/part1_410.pdf

3.2 Supply Voltage
In terms of operating supply voltage, two types of SD Memory Cards are defined:
• High Voltage SD Memory Cards that can operate the voltage range of 2.7-3.6 V.
• UHS-II SD Memory Card that can operate the voltage ranges VDD1: 2.7-3.6 V, VDD2: 1.70-1.95V



Many SD cards will NOT work at 3.3V.

3.5V is probably good enough for most cards but in theory they can require 3.6V.


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

pito

#8
May 05, 2013, 09:55 pm Last Edit: May 06, 2013, 04:01 pm by CrossRoads Reason: 1
Quote
Many SD cards will NOT work at 3.3V.

I've never met such a card. Maybe the power supply was weak or bad decoupled - therefore you needed 3.6V (a card may take 200mA peak)..

fungus

#9
May 05, 2013, 10:10 pm Last Edit: May 06, 2013, 04:01 pm by CrossRoads Reason: 1

Quote
Many SD cards will NOT work at 3.3V.

I've never met such a card.


Well that proves it then. No card needs more than that.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

oric_dan

#10
May 06, 2013, 12:53 am Last Edit: May 06, 2013, 04:02 pm by CrossRoads Reason: 1
Quote
Quote
• High Voltage SD Memory Cards that can operate the voltage range of 2.7-3.6 V.
• UHS-II SD Memory Card that can operate the voltage ranges VDD1: 2.7-3.6 V, VDD2: 1.70-1.95V


Many SD cards will NOT work at 3.3V.

Quote
SD cards need 3.6V.

Seems to me these statements are inconsistent. The first one indicates the SD card should work down
to 2.7V. So, ????

To OP, I think your ckt is ok, as is. The problem may be that, when you use the SPI peripheral with -CS
other than the standard SS pin, you still need to set the SS pin = OUTPUT, else the peripheral will revert
to slave mode.

bratan

#11
May 06, 2013, 05:55 am Last Edit: May 06, 2013, 04:02 pm by CrossRoads Reason: 1

To OP, I think your ckt is ok, as is. The problem may be that, when you use the SPI peripheral with -CS
other than the standard SS pin, you still need to set the SS pin = OUTPUT, else the peripheral will revert
to slave mode.


Thanks, I will keep looking for a solution. It's very helpful to at least eliminate hardware as source of the issue :)
As to SD card voltage (to the person who hijacked my thread :) , I'm not an expert but from what I've learned in the past year, every circuit I've seen uses 3.3V for regular SD cards, no exceptions... And from posted specs in voltage range of 2.7 - 3.6V, 3.3V seems like a sweet spot :)
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

CrossRoads

#12
May 06, 2013, 07:04 am Last Edit: May 06, 2013, 04:02 pm by CrossRoads Reason: 1
What does this have to do with Bobuino? Nothing that I can see.  I request you take Bobuino out of the title.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

fungus

#13
May 06, 2013, 07:47 am Last Edit: May 06, 2013, 04:02 pm by CrossRoads Reason: 1

Quote
Quote
• High Voltage SD Memory Cards that can operate the voltage range of 2.7-3.6 V.
• UHS-II SD Memory Card that can operate the voltage ranges VDD1: 2.7-3.6 V, VDD2: 1.70-1.95V


Many SD cards will NOT work at 3.3V.

Quote
SD cards need 3.6V.

Seems to me these statements are inconsistent. The first one indicates the SD card should work down
to 2.7V. So, ????


The way it works is you query the card on initialization (command 58, "READ_OCR") and the card tells you how many volts it needs. If you don't have that many volts, you're not supposed to use that card (and especially don't try to write to it).

So, 2.7V is an allowed voltage under the specification but it doesn't mean that cards will work at 2.7V - the card can ask for more, up to 3.6V.

If you ask real-life cards, most will say 3.3V but if your power supply has the slightest problem, even a tiny fraction of a volt less than that or any problems in decoupling, some cards won't work. SD cards need a lot of current, if the power droops even slightly, it will fail. This isn't something where you can do the usual hand-wave say "Well MY card works so it must be OK", it needs proper engineering practice. Adding a bit more voltage (even a tenth of a volt more) means you're much, much more likely to succeed.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

oric_dan

#14
May 06, 2013, 09:28 am Last Edit: May 06, 2013, 04:03 pm by CrossRoads Reason: 1
That's a very good description, although it still all seems inconsistenly
bizarre with the section 3.2 spec info you gave in reply #7. Do they
possibly sell different SD cards in europe than in the US?

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview