1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

SD Card Project

Discussion in 'Microcontrollers' started by AtomSoft, Aug 11, 2008.

  1. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    You can get whatever you want. :D Ya, the 4525 is a fine chip. Very similar to the 4620 (same datasheet). Same amount of RAM. I think the only difference might be 48K of Flash instead of the 4620's 64K.

    Tell me about it. Starting early July the amount of work I had ramped up from fairly slow to insane-in-the-brain-busy. I'd work seven days a week, but it would kill me (need one day to recover a bit - I'm not so young anymore) so I work six days a week. When I'm busy like this I don't always have time for hobbies.
     
    Last edited: Aug 26, 2008
  2. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    OK i should have my pics in about 2-3 days. While i wait. I wanted to know if this looked ok. I made it for a 16mbit chip i have its the AT45DB161D (ATMEL) its SPI and i wanted to know if i should be good if i connect it like this with voltage dividers. Would this work? The TO PIC MICRO header is there to signify connections to a pic like SDO, SDI, SCK and other pins that may be used from pic to chip and chip to pic.

    [​IMG]
     

    Attached Files:

  3. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    U1 is the SD card? SI is CMD and SO is DAT0?

    What is RESET then? Should be no such line required to the SD.

    SD needs 3.3V, GND, CD (CS - chip select), CMD (data in), DAT0 (data out), and CLK (clock). The card-detect and write-protect lines are optional.

    Pullups (to the 3.3V VDD) are required on all data & clock lines to the SD (and write-protect/card-detect as well, I think).

    I assume you've done the math for those voltage divider resistors? I'm too lazy to check. :p
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,228
    Likes:
    641
    Location:
    Derbyshire, UK
    ONLINE

    Aren't the level shifting resistors rather low values?, seems a waste of current for no reason?.
     
  6. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    futz please re-read my post lol that was for

    "16mbit chip i have its the AT45DB161D (ATMEL) its SPI "

    Since im waiting for the micros. I thought id study spi in another form. But this still requires 512byte buffer.

    I wanted to know if a connection like that is possible? Im not sure you can tell but they are pulled up.

    when you send a 0 then the line is 0 since 0v & GND doesnt make a voltage. When its a 1 the line is 3.x volts. Since 5v and 2 resistors(voltage dividers) to gnd = a high voltage.
     
  7. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US

    Please do make a recommendation.
     
  8. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,228
    Likes:
    641
    Location:
    Derbyshire, UK
    ONLINE
    Try multiplying them by at least ten for a start.
     
  9. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    so a 10k and a 15k i will try later on. Its a holiday here and i still have to work lol
     
  10. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    how about R1= 33k & R2= 17k
    That should be a exact 3.3 Volts @ about 100ma

    OR

    R1 = 12K
    R2 = 6K
    Would make 3.3 Volts @ 277ma

    I have on hand many resistors but none exact. Like i have a 12k & 5.6K which would make it 3.40 Volts @ 284ma
     
    Last edited: Sep 1, 2008
  11. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Ahh! I see! Never mind :p Should have read more carefully, but Sunday is foggy-brain day for me. :D

    Me too. Sucks, but I'm SO far behind... And there's nobody on the site to bug me and get in my way on a holiday Monday. :D
     
    Last edited: Sep 1, 2008
  12. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    ok so now i ask again lol does this seem like it would work? like if i connect it like that schem i should not have a hardware or wiring issue right?
     
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    ok please read the following quote

    "DO NOT WORRY ABOUT RESISTOR VALUES THIS IS JUST A EXAMPLE OF LAYOUT"

    ok with that said how does this look? I know the divider resistor values to use 12k & 5.6k what should the pullup resistor values be?

    Also how does it look overall so far? notice-able issues?

    [​IMG]

    EDIT: NOTE:
    NOTICED a error in vcc pullups need to be to the vcc of the main divider.
     

    Attached Files:

    Last edited: Sep 1, 2008
  14. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Why not run the pic at 3.3V too and throw out the level shifting. 5V PICs run on 3.3V , but it cant work at its max clock rate (There is a graph of max clock vs supply voltage in the datasheet), but mostly half the max speed is fine.

    Or you might also consider getting one or two of the dsPIC33F, They run off 3.3V and run up to 160Mhz from that.That might be useful if you are doing some more advanced projects with it and need some extra processing power.
     
  15. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    i dont want to have to always run away from a issue. At the moment i have 5v pics only and would like to use then. This is something need to learn anyway. Especially if i cant avoid it in the future.
     
  16. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Yeah i know. I had to do level shifting too cause i used a 5V PIC and i wanted to run it at full speed. At first i just used half the speed and ran it all at 3.3V just to firstly get the card working.

    These days its mostly best to run more complicated projects on 3.3V since almost all modern ICs work from 1,8V to 3.3V. This is mainly because ICs use less power at 3.3V also means lower voltage baterys (or getting rid of DC-DCs) Also 3.3V pics have 5V compatible I/O, its a very useful feature if you end up with a IC or two in your design that cant work on 3.3V
     
  17. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    The thing im scared mostly about is using a 3v pic and needing 5 volts output on a pin. Then i would have to use transistors to switch them which means more parts which can malfunction. You understand? I know i can type a good run-on sentence lol. The good news is i should be getting a few Low Voltage chips in such as:

    x = QTY

    PIC18LF4620 x 1

    and normal chips i ordered:

    dsPIC30F4013 x 2
    PIC18F4525 x 2
    PIC18F2455 x 1

    I will try to run the normal (5v) pics from 3.4v to see if it runs good. How can i calculate voltage needed for speed in MHz? Like whats a good voltage for 8mhz and a good minimum voltage for 20 mhz?
     
  18. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    the datasheet for the 18F4550 recommends to go max 16 Mhz at 3V, While the dsPIC30F4013 recommends to stay under 60Mhz for 3,0 to 3.6V operation.

    Well when i was using 3.3V i used 64Mhz (4Mhz xtal + 16x PLL) but it works fine, however i tried to do the full 120Mhz but the PIC just hangs. Altho when running on 5V i once put in a wrong crystal and ran it at 160Mhz it seamed to run on that no problem. So for fun i tryed 200Mhz but then it hangs.PICs generally run pretty fine when overclocked. Seen people run a 20Mhz pic at 35Mhz no porb. But overclock a pic only if you really need the extra bit of juice out of it. And as a general rule use about half the max speed when running it 3.3V
     
  19. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    wow i guess i should read datasheet more thoroughly from now on.
     
  20. Someone Electro

    Someone Electro New Member

    Joined:
    Sep 10, 2003
    Messages:
    2,579
    Likes:
    2
    Location:
    A boring village in Europe (slovene)
    Yup. This stuff is all under Electrical Characteristics over in the last pages of the datasheet. They also tell you the current consumption for each configuration and clock rate and other stuff like what currents are allowed for what pins etc
     
  21. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    ok im using a LF4620 now and i can even read sector 0. The same data on sector 0 is what i can dump when i connect card to pc and manually check it.

    Some links on how to handle the data in MBR?

    That: http://home.teleport.com/~brainy/fat16.htm

    Isnt really informational. Any other links on Fat16 or Fat32. Anything. Thanks!
     

Share This Page