Pages: [1] 2 3   Go Down
Author Topic: ATMega1284p issues with SD Card  (Read 2470 times)
0 Members and 1 Guest are viewing this topic.
New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad  (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? smiley


* xronos_clock_V2_schematic.png (78.1 KB, 2557x1657 - viewed 46 times.)
« Last Edit: May 06, 2013, 06:55:57 am by bratan » Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

..I would not mess with those HC125 drivers as the 1284p runs fine at 3.3V/16MHz..
« Last Edit: May 06, 2013, 08:59:22 am by CrossRoads » Logged

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

..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? smiley-sad
« Last Edit: May 06, 2013, 08:59:38 am by CrossRoads » Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

..have a look on the pin definitions in "pins_aruino.h" and do check the stuff around:
Code:
..
static const uint8_t SS   = 4;
static const uint8_t MOSI = 5;
static const uint8_t MISO = 6;
static const uint8_t SCK  = 7;
..
« Last Edit: May 06, 2013, 08:59:57 am by CrossRoads » Logged

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

..have a look on the pin definitions in "pins_aruino.h" and do check the stuff around:
Code:
..
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?
« Last Edit: May 06, 2013, 09:00:12 am by CrossRoads » Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SD cards need 3.6V.

Less than that, they may work, they may do weird things...you can never tell.
« Last Edit: May 06, 2013, 09:00:27 am by CrossRoads » Logged

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

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 06, 2013, 09:00:43 am by CrossRoads » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


« Last Edit: May 06, 2013, 09:00:59 am by CrossRoads » Logged

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

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2066
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)..
« Last Edit: May 06, 2013, 09:01:22 am by CrossRoads » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 06, 2013, 09:01:38 am by CrossRoads » Logged

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

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2895
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 06, 2013, 09:02:02 am by CrossRoads » Logged

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
As to SD card voltage (to the person who hijacked my thread smiley , 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 smiley
« Last Edit: May 06, 2013, 09:02:22 am by CrossRoads » Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 525
Posts: 26545
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What does this have to do with Bobuino? Nothing that I can see.  I request you take Bobuino out of the title.
« Last Edit: May 06, 2013, 09:02:40 am by CrossRoads » Logged

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.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: May 06, 2013, 09:02:59 am by CrossRoads » Logged

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

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2895
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: May 06, 2013, 09:03:29 am by CrossRoads » Logged

Pages: [1] 2 3   Go Up
Jump to: