Loading ...
Sorry, an error occurred while loading the content.
 

18F4550+SD card problems

Expand Messages
  • Fabian Pedrosa
    Hi list! Some time ago I managed to get a 16F877 read and write an SD, using Matt´s ideas about hard and soft. The problem is that I´m trying now to migrate
    Message 1 of 30 , Mar 1, 2011
      Hi list!
      Some time ago I managed to get a 16F877 read and write an SD, using Matt´s ideas about hard and soft.
      The problem is that I´m trying now to migrate to a 18F4550 and the comunication with the SD is driving me crazy. The hard is the same, but I get inconsistant results and so far I´m not sure if it´s a firmware problem or the SPI hard of the 18F4550 is different from the 877´s.
      I´m using the jallib libraries, by the way.
      Any idea, advice, comment, etc will be welcome.
      Thanx!

      Fabián
    • vasi
      I also have problems with a 18F2550 :( . I can t get the SD card initialized. The same card (1Gb) is successfully used in an ATmega644P logger. Fat32 format.
      Message 2 of 30 , Mar 1, 2011
        I also have problems with a 18F2550 :( . I can't get the SD card initialized. The same card (1Gb) is successfully used in an ATmega644P logger. Fat32 format.

        Vasi

        --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
        >
        > Hi list!
        > Some time ago I managed to get a 16F877 read and write an SD, using Matt´s ideas about hard and soft.
        > The problem is that I´m trying now to migrate to a 18F4550 and the comunication with the SD is driving me crazy. The hard is the same, but I get inconsistant results and so far I´m not sure if it´s a firmware problem or the SPI hard of the 18F4550 is different from the 877´s.
        > I´m using the jallib libraries, by the way.
        > Any idea, advice, comment, etc will be welcome.
        > Thanx!
        >
        > Fabián
        >
      • Serdar K.
        I haven t had any chance to work on SD card, but only an idea : The working clock speed is 4-20 MHz with 16FF877, but i guess now you are using 18F2550 / 4550
        Message 3 of 30 , Mar 1, 2011
          I haven't had any chance to work on SD card, but only an idea : The working
          clock speed is 4-20 MHz with 16FF877, but i guess now you are using 18F2550
          / 4550 with USB and 48MHz clock rate. Some timing problem must be occuring
          because of this difference.

          Of course it can be something about the initialization of the ports, because
          there are different peripherals using same pins.

          Greetings,
          Serdar

          2011/3/1 vasi <funlw65@...>

          >
          >
          > I also have problems with a 18F2550 :( . I can't get the SD card
          > initialized. The same card (1Gb) is successfully used in an ATmega644P
          > logger. Fat32 format.
          >
          > Vasi
          >
          >
          > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
          > >
          > > Hi list!
          > > Some time ago I managed to get a 16F877 read and write an SD, using
          > Matt�s ideas about hard and soft.
          > > The problem is that I�m trying now to migrate to a 18F4550 and the
          > comunication with the SD is driving me crazy. The hard is the same, but I
          > get inconsistant results and so far I�m not sure if it�s a firmware problem
          > or the SPI hard of the 18F4550 is different from the 877�s.
          > > I�m using the jallib libraries, by the way.
          > > Any idea, advice, comment, etc will be welcome.
          > > Thanx!
          > >
          > > Fabi�n
          > >
          >
          >
          >



          --
          *Serdar KIZILTOPRAK
          Intelligence **Technology Systems
          info@...
          http://www.its3k.com
          +90(216) 518 15 00*
          **


          [Non-text portions of this message have been removed]
        • vasi
          SPI allows a maximum of 12MBps data rate (at 48MHz) but I don t know if SD card have a maximum allowed... Vasi
          Message 4 of 30 , Mar 1, 2011
            SPI allows a maximum of 12MBps data rate (at 48MHz) but I don't know if SD card have a maximum allowed...

            Vasi

            --- In jallist@yahoogroups.com, "Serdar K." <skiziltoprak@...> wrote:
            >
            > I haven't had any chance to work on SD card, but only an idea : The working
            > clock speed is 4-20 MHz with 16FF877, but i guess now you are using 18F2550
            > / 4550 with USB and 48MHz clock rate. Some timing problem must be occuring
            > because of this difference.
            >
            > Of course it can be something about the initialization of the ports, because
            > there are different peripherals using same pins.
            >
            > Greetings,
            > Serdar
            >
            > 2011/3/1 vasi <funlw65@...>
            >
            > >
            > >
            > > I also have problems with a 18F2550 :( . I can't get the SD card
            > > initialized. The same card (1Gb) is successfully used in an ATmega644P
            > > logger. Fat32 format.
            > >
            > > Vasi
            > >
            > >
            > > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@> wrote:
            > > >
            > > > Hi list!
            > > > Some time ago I managed to get a 16F877 read and write an SD, using
            > > Matt´s ideas about hard and soft.
            > > > The problem is that I´m trying now to migrate to a 18F4550 and the
            > > comunication with the SD is driving me crazy. The hard is the same, but I
            > > get inconsistant results and so far I´m not sure if it´s a firmware problem
            > > or the SPI hard of the 18F4550 is different from the 877´s.
            > > > I´m using the jallib libraries, by the way.
            > > > Any idea, advice, comment, etc will be welcome.
            > > > Thanx!
            > > >
            > > > Fabián
            > > >
            > >
            > >
            > >
            >
            >
            >
            > --
            > *Serdar KIZILTOPRAK
            > Intelligence **Technology Systems
            > info@...
            > http://www.its3k.com
            > +90(216) 518 15 00*
            > **
            >
            >
            > [Non-text portions of this message have been removed]
            >
          • Matt
            I don t think there is any max data rate for SPI. It depends on the device. SD card max speed is 25mhz. However, you may have issues on your breadboard. Maybe
            Message 5 of 30 , Mar 1, 2011
              I don't think there is any max data rate for SPI. It depends on the device. SD card max speed is 25mhz.

              However, you may have issues on your breadboard. Maybe try 74HCT08 for voltage conversion, or just go to a 3.3v PIC.

              I did have sd card working fine on 18f4550.

              Matt.

              --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
              >
              > SPI allows a maximum of 12MBps data rate (at 48MHz) but I don't know if SD card have a maximum allowed...
              >
              > Vasi
              >
              > --- In jallist@yahoogroups.com, "Serdar K." <skiziltoprak@> wrote:
              > >
              > > I haven't had any chance to work on SD card, but only an idea : The working
              > > clock speed is 4-20 MHz with 16FF877, but i guess now you are using 18F2550
              > > / 4550 with USB and 48MHz clock rate. Some timing problem must be occuring
              > > because of this difference.
              > >
              > > Of course it can be something about the initialization of the ports, because
              > > there are different peripherals using same pins.
              > >
              > > Greetings,
              > > Serdar
              > >
              > > 2011/3/1 vasi <funlw65@>
              > >
              > > >
              > > >
              > > > I also have problems with a 18F2550 :( . I can't get the SD card
              > > > initialized. The same card (1Gb) is successfully used in an ATmega644P
              > > > logger. Fat32 format.
              > > >
              > > > Vasi
              > > >
              > > >
              > > > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@> wrote:
              > > > >
              > > > > Hi list!
              > > > > Some time ago I managed to get a 16F877 read and write an SD, using
              > > > Matt´s ideas about hard and soft.
              > > > > The problem is that I´m trying now to migrate to a 18F4550 and the
              > > > comunication with the SD is driving me crazy. The hard is the same, but I
              > > > get inconsistant results and so far I´m not sure if it´s a firmware problem
              > > > or the SPI hard of the 18F4550 is different from the 877´s.
              > > > > I´m using the jallib libraries, by the way.
              > > > > Any idea, advice, comment, etc will be welcome.
              > > > > Thanx!
              > > > >
              > > > > Fabián
              > > > >
              > > >
              > > >
              > > >
              > >
              > >
              > >
              > > --
              > > *Serdar KIZILTOPRAK
              > > Intelligence **Technology Systems
              > > info@
              > > http://www.its3k.com
              > > +90(216) 518 15 00*
              > > **
              > >
              > >
              > > [Non-text portions of this message have been removed]
              > >
              >
            • Fabian Pedrosa
              Hi! Thanx everybody for the answers. I´ve got a few updates to comment. First, some hard details: 18F4550 working at 20 MHz, because I thought it may be too
              Message 6 of 30 , Mar 2, 2011
                Hi!
                Thanx everybody for the answers. I´ve got a few updates to comment.

                First, some hard details:
                18F4550 working at 20 MHz, because I thought it may be too fast at 48. It´s not (now) at a breadboard, it´s a dual side PCB. I´ll try 48 Mhz as soon as it is working ok. Sidenote: on this board I´ve put a lot of other things, e.g.: LCD display, RTC, shift registers for digital input-ouput, software RS232. All of this works as intended. USB connectivity is here too, but that is waiting to be solved.

                Important: I changed the card (1 GB Kingston brand) for another of 2 GB (Kingston branded too, but who know for real), and it worked at once. The 1 GB card can be read and written without fuss with an Encore card reader, so I supposed it would be OK. Maybe that´s not really the case.

                Now, the problem is that if I try to make a read AFTER I make a WRITE the firmware freezes! And it does so at the "sd_read_data(data,data1)" instruction. The CS pin stays low after this, by the way.

                Longshot: could this constant (SD_ALWAYS_SET_SPI_MODE) be related? What is its purpose, by the way?

                Again, thanx a lot to all who answered and I still accept advice!

                Fabián
              • Matt
                ... I had this issue in the past, I can t quite remember the exact problem but I have a feeling it is a voltage level issue. Incorrect voltage levels can give
                Message 7 of 30 , Mar 2, 2011
                  > Now, the problem is that if I try to make a read AFTER I make a WRITE the firmware freezes! And it does so at the "sd_read_data(data,data1)" instruction. The CS pin stays low after this, by the way.

                  I had this issue in the past, I can't quite remember the exact problem but I have a feeling it is a voltage level issue. Incorrect voltage levels can give you all sorts of weird problems.

                  Did it work on a breadboard? do you have a pull-up resistor on the cs line?

                  Is there a small capacitor near the sd card accross GND/3v?

                  Did you try 74HCT08 as suggested?

                  Are you using the most recent sd card library?
                  http://jallib.googlecode.com/svn/trunk/include/external/storage/sd_card/

                  > Longshot: could this constant (SD_ALWAYS_SET_SPI_MODE) be related? What is its purpose, by the way?

                  This is used only if you have other SPI devices on the same bus.

                  Matt.
                • Fabian Pedrosa
                  @Matt: checking with an oscilloscope I can´t see any wrong voltages. There´s a 470 ohm resistor pulling up CS line. There´s a .22 uF poliester between the
                  Message 8 of 30 , Mar 3, 2011
                    @Matt:
                    checking with an oscilloscope I can´t see any wrong voltages.
                    There´s a 470 ohm resistor pulling up CS line.
                    There´s a .22 uF poliester between the 3.3 V regulator (a LM317LZ) and the card, near to both.
                    I´m working on a real board so I can´t try the 74HC08 approach.
                    Thanks for the info about that constant. It would be nice if these things were more documented.
                    Update: If I put a sd_init() (and a 300 ms delay) statement AFTER the write section and BEFORE the read section, and the freezing problem dissapears... Ugly solution but (as usual) I´m in a hurry.
                    By teh way, the 18F4550 is working (now) at 48 MHz, and the SPI bus is set at SPI_RATE_FOSC_16 (higher doesnt work).

                    Thanx!
                  • vasi
                    My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card
                    Message 9 of 30 , Mar 3, 2011
                      My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board

                      --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
                      >
                      > Hi!
                      > Thanx everybody for the answers. I´ve got a few updates to comment.
                      >
                      > First, some hard details:
                      > 18F4550 working at 20 MHz, because I thought it may be too fast at 48. It´s not (now) at a breadboard, it´s a dual side PCB. I´ll try 48 Mhz as soon as it is working ok. Sidenote: on this board I´ve put a lot of other things, e.g.: LCD display, RTC, shift registers for digital input-ouput, software RS232. All of this works as intended. USB connectivity is here too, but that is waiting to be solved.
                      >
                      > Important: I changed the card (1 GB Kingston brand) for another of 2 GB (Kingston branded too, but who know for real), and it worked at once. The 1 GB card can be read and written without fuss with an Encore card reader, so I supposed it would be OK. Maybe that´s not really the case.
                      >
                      > Now, the problem is that if I try to make a read AFTER I make a WRITE the firmware freezes! And it does so at the "sd_read_data(data,data1)" instruction. The CS pin stays low after this, by the way.
                      >
                      > Longshot: could this constant (SD_ALWAYS_SET_SPI_MODE) be related? What is its purpose, by the way?
                      >
                      > Again, thanx a lot to all who answered and I still accept advice!
                      >
                      > Fabián
                      >
                    • Matt
                      Some people have had issues with Kingston brand. I don t have one my self so I can t test. Maybe it will work with only the 300ms delay. Some cards take a
                      Message 10 of 30 , Mar 3, 2011
                        Some people have had issues with Kingston brand. I don't have one my self so I can't test. Maybe it will work with only the 300ms delay.

                        Some cards take a longer time to do the write process then others. I tried to fix this in the newest sd card lib.

                        Matt.

                        --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
                        >
                        > @Matt:
                        > checking with an oscilloscope I can´t see any wrong voltages.
                        > There´s a 470 ohm resistor pulling up CS line.
                        > There´s a .22 uF poliester between the 3.3 V regulator (a LM317LZ) and the card, near to both.
                        > I´m working on a real board so I can´t try the 74HC08 approach.
                        > Thanks for the info about that constant. It would be nice if these things were more documented.
                        > Update: If I put a sd_init() (and a 300 ms delay) statement AFTER the write section and BEFORE the read section, and the freezing problem dissapears... Ugly solution but (as usual) I´m in a hurry.
                        > By teh way, the 18F4550 is working (now) at 48 MHz, and the SPI bus is set at SPI_RATE_FOSC_16 (higher doesnt work).
                        >
                        > Thanx!
                        >
                      • Matt
                        So, what s the difference in the init process?
                        Message 11 of 30 , Mar 3, 2011
                          So, what's the difference in the init process?

                          --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
                          >
                          > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                        • vasi
                          In this archive http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1 you have the both
                          Message 12 of 30 , Mar 3, 2011
                            In this archive
                            http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                            you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.

                            --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@...> wrote:
                            >
                            > So, what's the difference in the init process?
                            >
                            > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                            > >
                            > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                            >
                          • Matt
                            Thanks Vasi, unfortunately this doesn t help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you
                            Message 13 of 30 , Mar 3, 2011
                              Thanks Vasi, unfortunately this doesn't help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you could review it so we can improve the jallib library.

                              Matt.

                              --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
                              >
                              > In this archive
                              > http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                              > you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.
                              >
                              > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                              > >
                              > > So, what's the difference in the init process?
                              > >
                              > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                              > > >
                              > > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                              > >
                              >
                            • vasi
                              Hi Matt, Can you provide me a schematic that you know it works (you tested it) for 18F2550/4550 (without that IC buffer you are using)? Thank you! I m
                              Message 14 of 30 , Mar 3, 2011
                                Hi Matt,
                                Can you provide me a schematic that you know it works (you tested it) for 18F2550/4550 (without that IC buffer you are using)? Thank you!

                                I'm interested to see (and use) your library working because I see it more appropriate for appending data at the end of file than is Petit FatFS of Chan.

                                Vasi

                                P.S. In your example about small FAT32 lib, you do not say if the DATA.DAT file must exist already on the SD Card, or is created by the library (the same thing about the SD Card label - it is mandatory to have and specify a label?). Also, from your example I removed the code referring to the external memory - I understand is there only as example, for anyone needing an extra memory?

                                --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@...> wrote:
                                >
                                > Thanks Vasi, unfortunately this doesn't help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you could review it so we can improve the jallib library.
                                >
                                > Matt.
                                >
                                > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                > >
                                > > In this archive
                                > > http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                                > > you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.
                                > >
                                > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                > > >
                                > > > So, what's the difference in the init process?
                                > > >
                                > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                > > > >
                                > > > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                                > > >
                                > >
                                >
                              • Matt
                                Thanks, I ll hook it up tonight and let you know. I ll connect it the same as yours: http://and-tech.pl/EvB4.3/schemat_v4.png Which FAT32 lib do you wish to
                                Message 15 of 30 , Mar 3, 2011
                                  Thanks, I'll hook it up tonight and let you know. I'll connect it the same as yours: http://and-tech.pl/EvB4.3/schemat_v4.png

                                  Which FAT32 lib do you wish to use? My large one or small version?

                                  Matt.

                                  --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
                                  >
                                  > Hi Matt,
                                  > Can you provide me a schematic that you know it works (you tested it) for 18F2550/4550 (without that IC buffer you are using)? Thank you!
                                  >
                                  > I'm interested to see (and use) your library working because I see it more appropriate for appending data at the end of file than is Petit FatFS of Chan.
                                  >
                                  > Vasi
                                  >
                                  > P.S. In your example about small FAT32 lib, you do not say if the DATA.DAT file must exist already on the SD Card, or is created by the library (the same thing about the SD Card label - it is mandatory to have and specify a label?). Also, from your example I removed the code referring to the external memory - I understand is there only as example, for anyone needing an extra memory?
                                  >
                                  > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                  > >
                                  > > Thanks Vasi, unfortunately this doesn't help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you could review it so we can improve the jallib library.
                                  > >
                                  > > Matt.
                                  > >
                                  > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                  > > >
                                  > > > In this archive
                                  > > > http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                                  > > > you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.
                                  > > >
                                  > > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                  > > > >
                                  > > > > So, what's the difference in the init process?
                                  > > > >
                                  > > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                  > > > > >
                                  > > > > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                                  > > > >
                                  > > >
                                  > >
                                  >
                                • Matt
                                  SD card works & fat32_small both work fine on 18f4550. I just noticed a small issue on 2.4n so try the newest sample. I used the same resistors as in EvB4.3
                                  Message 16 of 30 , Mar 4, 2011
                                    SD card works & fat32_small both work fine on 18f4550. I just noticed a small issue on 2.4n so try the newest sample. I used the same resistors as in EvB4.3 board.

                                    4.7k/10k voltage dividers on sdo, sck, ss

                                    I also added a 10k pull-up resistor at pin_ss, I find the sd card does not init properly sometimes otherwise. I don't see this in EvB4.3 board schematic.

                                    Sorry, I didn't see your "PS" before with questions about fat32_small. The sd card must be formatted first with any volume label. After you run fat32_small for the first time, it will overwrite whatever volume label you have given. The volume label must be set by the PIC.

                                    The external memory 23k256 code can be removed. No external memory is needed for this lib. I should remove the code in my fat32_small samples.

                                    Please try it out when you get a chance.

                                    Matt.

                                    --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@...> wrote:
                                    >
                                    > Thanks, I'll hook it up tonight and let you know. I'll connect it the same as yours: http://and-tech.pl/EvB4.3/schemat_v4.png
                                    >
                                    > Which FAT32 lib do you wish to use? My large one or small version?
                                    >
                                    > Matt.
                                    >
                                    > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                    > >
                                    > > Hi Matt,
                                    > > Can you provide me a schematic that you know it works (you tested it) for 18F2550/4550 (without that IC buffer you are using)? Thank you!
                                    > >
                                    > > I'm interested to see (and use) your library working because I see it more appropriate for appending data at the end of file than is Petit FatFS of Chan.
                                    > >
                                    > > Vasi
                                    > >
                                    > > P.S. In your example about small FAT32 lib, you do not say if the DATA.DAT file must exist already on the SD Card, or is created by the library (the same thing about the SD Card label - it is mandatory to have and specify a label?). Also, from your example I removed the code referring to the external memory - I understand is there only as example, for anyone needing an extra memory?
                                    > >
                                    > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                    > > >
                                    > > > Thanks Vasi, unfortunately this doesn't help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you could review it so we can improve the jallib library.
                                    > > >
                                    > > > Matt.
                                    > > >
                                    > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                    > > > >
                                    > > > > In this archive
                                    > > > > http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                                    > > > > you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.
                                    > > > >
                                    > > > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                    > > > > >
                                    > > > > > So, what's the difference in the init process?
                                    > > > > >
                                    > > > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                    > > > > > >
                                    > > > > > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                                    > > > > >
                                    > > > >
                                    > > >
                                    > >
                                    >
                                  • Matt
                                    Please tell me your setup, what voltage divider resistors do you use? I ll try it out. Matt.
                                    Message 17 of 30 , Mar 4, 2011
                                      Please tell me your setup, what voltage divider resistors do you use? I'll try it out.

                                      Matt.

                                      --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
                                      >
                                      > @Matt:
                                      > checking with an oscilloscope I can´t see any wrong voltages.
                                      > There´s a 470 ohm resistor pulling up CS line.
                                      > There´s a .22 uF poliester between the 3.3 V regulator (a LM317LZ) and the card, near to both.
                                      > I´m working on a real board so I can´t try the 74HC08 approach.
                                      > Thanks for the info about that constant. It would be nice if these things were more documented.
                                      > Update: If I put a sd_init() (and a 300 ms delay) statement AFTER the write section and BEFORE the read section, and the freezing problem dissapears... Ugly solution but (as usual) I´m in a hurry.
                                      > By teh way, the 18F4550 is working (now) at 48 MHz, and the SPI bus is set at SPI_RATE_FOSC_16 (higher doesnt work).
                                      >
                                      > Thanx!
                                      >
                                    • vasi
                                      Thank you Matt, I will try it tomorrow. ... This intrigued me from the start. It may be the issue.. BTW, you are using SS pin from the PIC for selecting the SD
                                      Message 18 of 30 , Mar 4, 2011
                                        Thank you Matt, I will try it tomorrow.

                                        --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@...> wrote:
                                        >
                                        > SD card works & fat32_small both work fine on 18f4550. I just noticed a small issue on 2.4n so try the newest sample. I used the same resistors as in EvB4.3 board.
                                        >
                                        > 4.7k/10k voltage dividers on sdo, sck, ss
                                        >
                                        > I also added a 10k pull-up resistor at pin_ss, I find the sd card does not init properly sometimes otherwise. I don't see this in EvB4.3 board schematic.

                                        This intrigued me from the start. It may be the issue..
                                        BTW, you are using SS pin from the PIC for selecting the SD Card? Can be used any other pin?

                                        >
                                        > Sorry, I didn't see your "PS" before with questions about fat32_small. The sd card must be formatted first with any volume label. After you run fat32_small for the first time, it will overwrite whatever volume label you have given. The volume label must be set by the PIC.
                                        >
                                        > The external memory 23k256 code can be removed. No external memory is needed for this lib. I should remove the code in my fat32_small samples.
                                        >
                                        > Please try it out when you get a chance.
                                        >
                                        > Matt.
                                        >
                                        > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                        > >
                                        > > Thanks, I'll hook it up tonight and let you know. I'll connect it the same as yours: http://and-tech.pl/EvB4.3/schemat_v4.png
                                        > >
                                        > > Which FAT32 lib do you wish to use? My large one or small version?
                                        > >
                                        > > Matt.
                                        > >
                                        > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                        > > >
                                        > > > Hi Matt,
                                        > > > Can you provide me a schematic that you know it works (you tested it) for 18F2550/4550 (without that IC buffer you are using)? Thank you!
                                        > > >
                                        > > > I'm interested to see (and use) your library working because I see it more appropriate for appending data at the end of file than is Petit FatFS of Chan.
                                        > > >
                                        > > > Vasi
                                        > > >
                                        > > > P.S. In your example about small FAT32 lib, you do not say if the DATA.DAT file must exist already on the SD Card, or is created by the library (the same thing about the SD Card label - it is mandatory to have and specify a label?). Also, from your example I removed the code referring to the external memory - I understand is there only as example, for anyone needing an extra memory?
                                        > > >
                                        > > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                        > > > >
                                        > > > > Thanks Vasi, unfortunately this doesn't help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you could review it so we can improve the jallib library.
                                        > > > >
                                        > > > > Matt.
                                        > > > >
                                        > > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                        > > > > >
                                        > > > > > In this archive
                                        > > > > > http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                                        > > > > > you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.
                                        > > > > >
                                        > > > > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                        > > > > > >
                                        > > > > > > So, what's the difference in the init process?
                                        > > > > > >
                                        > > > > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                        > > > > > > >
                                        > > > > > > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                                        > > > > > >
                                        > > > > >
                                        > > > >
                                        > > >
                                        > >
                                        >
                                      • Matt
                                        Yes, you can use any pin for SS / chip select. Matt.
                                        Message 19 of 30 , Mar 4, 2011
                                          Yes, you can use any pin for SS / chip select.

                                          Matt.

                                          --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
                                          >
                                          > Thank you Matt, I will try it tomorrow.
                                          >
                                          > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                          > >
                                          > > SD card works & fat32_small both work fine on 18f4550. I just noticed a small issue on 2.4n so try the newest sample. I used the same resistors as in EvB4.3 board.
                                          > >
                                          > > 4.7k/10k voltage dividers on sdo, sck, ss
                                          > >
                                          > > I also added a 10k pull-up resistor at pin_ss, I find the sd card does not init properly sometimes otherwise. I don't see this in EvB4.3 board schematic.
                                          >
                                          > This intrigued me from the start. It may be the issue..
                                          > BTW, you are using SS pin from the PIC for selecting the SD Card? Can be used any other pin?
                                          >
                                          > >
                                          > > Sorry, I didn't see your "PS" before with questions about fat32_small. The sd card must be formatted first with any volume label. After you run fat32_small for the first time, it will overwrite whatever volume label you have given. The volume label must be set by the PIC.
                                          > >
                                          > > The external memory 23k256 code can be removed. No external memory is needed for this lib. I should remove the code in my fat32_small samples.
                                          > >
                                          > > Please try it out when you get a chance.
                                          > >
                                          > > Matt.
                                          > >
                                          > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                          > > >
                                          > > > Thanks, I'll hook it up tonight and let you know. I'll connect it the same as yours: http://and-tech.pl/EvB4.3/schemat_v4.png
                                          > > >
                                          > > > Which FAT32 lib do you wish to use? My large one or small version?
                                          > > >
                                          > > > Matt.
                                          > > >
                                          > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                          > > > >
                                          > > > > Hi Matt,
                                          > > > > Can you provide me a schematic that you know it works (you tested it) for 18F2550/4550 (without that IC buffer you are using)? Thank you!
                                          > > > >
                                          > > > > I'm interested to see (and use) your library working because I see it more appropriate for appending data at the end of file than is Petit FatFS of Chan.
                                          > > > >
                                          > > > > Vasi
                                          > > > >
                                          > > > > P.S. In your example about small FAT32 lib, you do not say if the DATA.DAT file must exist already on the SD Card, or is created by the library (the same thing about the SD Card label - it is mandatory to have and specify a label?). Also, from your example I removed the code referring to the external memory - I understand is there only as example, for anyone needing an extra memory?
                                          > > > >
                                          > > > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                          > > > > >
                                          > > > > > Thanks Vasi, unfortunately this doesn't help me much since I cannot reproduce the problem and do not know how to compile C. If you ever have time, maybe you could review it so we can improve the jallib library.
                                          > > > > >
                                          > > > > > Matt.
                                          > > > > >
                                          > > > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                          > > > > > >
                                          > > > > > > In this archive
                                          > > > > > > http://sites.google.com/site/funlw65/evb-projects/projects-using-arduino-language/arduino_extlibs.zip?attredirects=0&d=1
                                          > > > > > > you have the both libraries of Sanguino (Fat16 and SDFat which is 32FAT library) if you want to look inside.
                                          > > > > > >
                                          > > > > > > --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@> wrote:
                                          > > > > > > >
                                          > > > > > > > So, what's the difference in the init process?
                                          > > > > > > >
                                          > > > > > > > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                          > > > > > > > >
                                          > > > > > > > > My Card is also 1Gb capacity - it is working great with Sanguino and his FAT32 library... and it does not pass the initialization in Jal library. The SD Card is on EvB4.3 board
                                          > > > > > > >
                                          > > > > > >
                                          > > > > >
                                          > > > >
                                          > > >
                                          > >
                                          >
                                        • Fabian Pedrosa
                                          @Matt: I´m using 1K-2K2 dividers with 470 ohms pull-ups on CS and CLK pins. Fabián
                                          Message 20 of 30 , Mar 9, 2011
                                            @Matt:
                                            I´m using 1K-2K2 dividers with 470 ohms pull-ups on CS and CLK pins.

                                            Fabián
                                          • Matt
                                            It works fine for me with this setup, and this sample. Is this the sample your using? http://jallib.googlecode.com/svn/trunk/sample/18f4550_sd_card.jal Have
                                            Message 21 of 30 , Mar 9, 2011
                                              It works fine for me with this setup, and this sample. Is this the sample your using?
                                              http://jallib.googlecode.com/svn/trunk/sample/18f4550_sd_card.jal

                                              Have you tried another sd card? What type and size sd card are you using?

                                              I would like to fix these issues, but I don't have any sd cards that don't work. If you still can't get it to work, I am actually willing to purchase your sd card from you so I can do some testing. You can buy a new one :)

                                              Matt.

                                              --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
                                              >
                                              > @Matt:
                                              > I´m using 1K-2K2 dividers with 470 ohms pull-ups on CS and CLK pins.
                                              >
                                              > Fabián
                                              >
                                            • vasi
                                              Matt, You can try any card of 1Gb size :) as is mine. You tried the sample with USB bootloader? Vasi
                                              Message 22 of 30 , Mar 9, 2011
                                                Matt,

                                                You can try any card of 1Gb size :) as is mine. You tried the sample with USB bootloader?

                                                Vasi

                                                --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@...> wrote:
                                                >
                                                > It works fine for me with this setup, and this sample. Is this the sample your using?
                                                > http://jallib.googlecode.com/svn/trunk/sample/18f4550_sd_card.jal
                                                >
                                                > Have you tried another sd card? What type and size sd card are you using?
                                                >
                                                > I would like to fix these issues, but I don't have any sd cards that don't work. If you still can't get it to work, I am actually willing to purchase your sd card from you so I can do some testing. You can buy a new one :)
                                                >
                                                > Matt.
                                                >
                                                > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@> wrote:
                                                > >
                                                > > @Matt:
                                                > > I´m using 1K-2K2 dividers with 470 ohms pull-ups on CS and CLK pins.
                                                > >
                                                > > Fabián
                                                > >
                                                >
                                              • Fabian Pedrosa
                                                @Matt: I´ve tried successfully an old 32 MB (yes, that´s MEGABYTES) and a 2 GB Kingston card. Besides, I´ve tried UNSUCCESSFULLY a 1 GB card (Kingston too,
                                                Message 23 of 30 , Mar 10, 2011
                                                  @Matt:
                                                  I´ve tried successfully an old 32 MB (yes, that´s MEGABYTES) and a 2 GB Kingston card. Besides, I´ve tried UNSUCCESSFULLY a 1 GB card (Kingston too, and one that works in a 16F877 board ).
                                                  I´m now using the 2 GB one, and that´s the one that needs a sp_init between a write and a read (didn´t tried this with the 32 MB one, though).
                                                  And yes, I based my code in the jallib sample you mention.

                                                  Fabián
                                                • Matt
                                                  So the only possible solutions are: 1. Ignore the problem 2. You can test, research and fix the library 3. allow me to purchase your sd cards that don t work,
                                                  Message 24 of 30 , Mar 10, 2011
                                                    So the only possible solutions are:

                                                    1. Ignore the problem
                                                    2. You can test, research and fix the library
                                                    3. allow me to purchase your sd cards that don't work, so I may test.

                                                    I assume all cards work fine on a PC, so therefore there must be some problem in the circuit or library.

                                                    Matt.

                                                    --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
                                                    >
                                                    > @Matt:
                                                    > I´ve tried successfully an old 32 MB (yes, that´s MEGABYTES) and a 2 GB Kingston card. Besides, I´ve tried UNSUCCESSFULLY a 1 GB card (Kingston too, and one that works in a 16F877 board ).
                                                    > I´m now using the 2 GB one, and that´s the one that needs a sp_init between a write and a read (didn´t tried this with the 32 MB one, though).
                                                    > And yes, I based my code in the jallib sample you mention.
                                                    >
                                                    > Fabián
                                                    >
                                                  • Fabian Pedrosa
                                                    @Matt Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card
                                                    Message 25 of 30 , Mar 11, 2011
                                                      @Matt

                                                      Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card from Argentina to your country may be a bit unnecessary expensive.
                                                      Perhaps Vasi (who reported a similar problem, IIRC) is closer to you?

                                                      My take: as the 1 GB card works with a 16f877 board, I think the problem is in the 4550 SPI module (and its registers, as initialized by the library), or it´s a weird electronic problem (noise, crosstalk between tracks, who knows).

                                                      Thanx anyway!


                                                      Fabián
                                                    • Fabian Pedrosa
                                                      @Matt Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card
                                                      Message 26 of 30 , Mar 11, 2011
                                                        @Matt

                                                        Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card from Argentina to your country may be a bit unnecessary expensive.
                                                        Perhaps Vasi (who reported a similar problem, IIRC) is closer to you?

                                                        My take: as the 1 GB card works with a 16f877 board, I think the problem is in the 4550 SPI module (and its registers, as initialized by the library), or it´s a weird electronic problem (noise, crosstalk between tracks, who knows).

                                                        Thanx anyway!


                                                        Fabián
                                                      • vasi
                                                        The card I m using is working perfect with ATmega644P and Arduino SD Card library. But it does not work good with 18F2550 and Hi-Tech PICC-18 with Petit FatFS
                                                        Message 27 of 30 , Mar 11, 2011
                                                          The card I'm using is working perfect with ATmega644P and Arduino SD Card library. But it does not work good with 18F2550 and Hi-Tech PICC-18 with Petit FatFS (http://www.electronicslab.ph/forum/index.php?topic=17055.0). It does not work good with another compiler using FAT16 and the example included in the package (it works randomly - one time is working, many times not, at the initialization moment). I will test it with another package to see how it goes. And this mean, the fourth SD library under test...

                                                          I can't emit a conclusion yet. This is the standard schematic also for ATmega:
                                                          https://lh6.googleusercontent.com/_Z3E9awpWQh4/TXqGFfgus9I/AAAAAAAAJaM/8kS7hskS54Y/s800/sdcard_connection.jpg
                                                          but it seems that other cards can work only with pull-up resistors:
                                                          https://lh3.googleusercontent.com/_Z3E9awpWQh4/TXqG5burRvI/AAAAAAAAJaQ/f7B2pqNEDzY/s800/PIC18F2550%20WAV%20Player.jpg
                                                          http://www.sfcompiler.co.uk/forum/viewtopic.php?t=606&postdays=0&postorder=asc&start=15&sid=00caf70e9dc0bf2a740dbcb5e3759071

                                                          If is a SPI HW problem on 2550/4550 (for some cards, of course), then I'm wonder how is working with SPI SW (software)...

                                                          Vasi

                                                          --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@...> wrote:
                                                          >
                                                          > @Matt
                                                          >
                                                          > Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card from Argentina to your country may be a bit unnecessary expensive.
                                                          > Perhaps Vasi (who reported a similar problem, IIRC) is closer to you?
                                                          >
                                                          > My take: as the 1 GB card works with a 16f877 board, I think the problem is in the 4550 SPI module (and its registers, as initialized by the library), or it´s a weird electronic problem (noise, crosstalk between tracks, who knows).
                                                          >
                                                          > Thanx anyway!
                                                          >
                                                          >
                                                          > Fabián
                                                          >
                                                        • Matt
                                                          Some other thoughts... I remember I had seen a while ago a schematic with pull-up resistors on all spi pins. Maybe floating voltage levels on PIC start up are
                                                          Message 28 of 30 , Mar 11, 2011
                                                            Some other thoughts...

                                                            I remember I had seen a while ago a schematic with pull-up resistors on all spi pins. Maybe floating voltage levels on PIC start up are affecting sd card init.

                                                            I wonder if voltage levels could be tested if we could slow down the clock enough. Then compare to other libraries and chips to find differences. SD cards don't worry about slow speeds.

                                                            Another crazy idea is to hack some device to run slow so we can test it's voltage levels, or does anyone here have a logic analyzer?

                                                            Matt.

                                                            --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
                                                            >
                                                            > The card I'm using is working perfect with ATmega644P and Arduino SD Card library. But it does not work good with 18F2550 and Hi-Tech PICC-18 with Petit FatFS (http://www.electronicslab.ph/forum/index.php?topic=17055.0). It does not work good with another compiler using FAT16 and the example included in the package (it works randomly - one time is working, many times not, at the initialization moment). I will test it with another package to see how it goes. And this mean, the fourth SD library under test...
                                                            >
                                                            > I can't emit a conclusion yet. This is the standard schematic also for ATmega:
                                                            > https://lh6.googleusercontent.com/_Z3E9awpWQh4/TXqGFfgus9I/AAAAAAAAJaM/8kS7hskS54Y/s800/sdcard_connection.jpg
                                                            > but it seems that other cards can work only with pull-up resistors:
                                                            > https://lh3.googleusercontent.com/_Z3E9awpWQh4/TXqG5burRvI/AAAAAAAAJaQ/f7B2pqNEDzY/s800/PIC18F2550%20WAV%20Player.jpg
                                                            > http://www.sfcompiler.co.uk/forum/viewtopic.php?t=606&postdays=0&postorder=asc&start=15&sid=00caf70e9dc0bf2a740dbcb5e3759071
                                                            >
                                                            > If is a SPI HW problem on 2550/4550 (for some cards, of course), then I'm wonder how is working with SPI SW (software)...
                                                            >
                                                            > Vasi
                                                            >
                                                            > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@> wrote:
                                                            > >
                                                            > > @Matt
                                                            > >
                                                            > > Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card from Argentina to your country may be a bit unnecessary expensive.
                                                            > > Perhaps Vasi (who reported a similar problem, IIRC) is closer to you?
                                                            > >
                                                            > > My take: as the 1 GB card works with a 16f877 board, I think the problem is in the 4550 SPI module (and its registers, as initialized by the library), or it´s a weird electronic problem (noise, crosstalk between tracks, who knows).
                                                            > >
                                                            > > Thanx anyway!
                                                            > >
                                                            > >
                                                            > > Fabián
                                                            > >
                                                            >
                                                          • Sebastien Lelong
                                                            From what I could read, some don t use pullups at all, as they usually are found inside sd card. That said, I ve never tried sd card, but should soon... Seb
                                                            Message 29 of 30 , Mar 12, 2011
                                                              From what I could read, some don't use pullups at all, as they usually are
                                                              found inside sd card. That said, I've never tried sd card, but should
                                                              soon...

                                                              Seb

                                                              2011/3/12 Matt <matthewschinkel@...>

                                                              >
                                                              >
                                                              > Some other thoughts...
                                                              >
                                                              > I remember I had seen a while ago a schematic with pull-up resistors on all
                                                              > spi pins. Maybe floating voltage levels on PIC start up are affecting sd
                                                              > card init.
                                                              >
                                                              > I wonder if voltage levels could be tested if we could slow down the clock
                                                              > enough. Then compare to other libraries and chips to find differences. SD
                                                              > cards don't worry about slow speeds.
                                                              >
                                                              > Another crazy idea is to hack some device to run slow so we can test it's
                                                              > voltage levels, or does anyone here have a logic analyzer?
                                                              >
                                                              > Matt.
                                                              >
                                                              >
                                                              > --- In jallist@yahoogroups.com, "vasi" <funlw65@...> wrote:
                                                              > >
                                                              > > The card I'm using is working perfect with ATmega644P and Arduino SD Card
                                                              > library. But it does not work good with 18F2550 and Hi-Tech PICC-18 with
                                                              > Petit FatFS (http://www.electronicslab.ph/forum/index.php?topic=17055.0).
                                                              > It does not work good with another compiler using FAT16 and the example
                                                              > included in the package (it works randomly - one time is working, many times
                                                              > not, at the initialization moment). I will test it with another package to
                                                              > see how it goes. And this mean, the fourth SD library under test...
                                                              > >
                                                              > > I can't emit a conclusion yet. This is the standard schematic also for
                                                              > ATmega:
                                                              > >
                                                              > https://lh6.googleusercontent.com/_Z3E9awpWQh4/TXqGFfgus9I/AAAAAAAAJaM/8kS7hskS54Y/s800/sdcard_connection.jpg
                                                              > > but it seems that other cards can work only with pull-up resistors:
                                                              > >
                                                              > https://lh3.googleusercontent.com/_Z3E9awpWQh4/TXqG5burRvI/AAAAAAAAJaQ/f7B2pqNEDzY/s800/PIC18F2550%20WAV%20Player.jpg
                                                              > >
                                                              > http://www.sfcompiler.co.uk/forum/viewtopic.php?t=606&postdays=0&postorder=asc&start=15&sid=00caf70e9dc0bf2a740dbcb5e3759071
                                                              > >
                                                              > > If is a SPI HW problem on 2550/4550 (for some cards, of course), then I'm
                                                              > wonder how is working with SPI SW (software)...
                                                              > >
                                                              > > Vasi
                                                              > >
                                                              > > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@> wrote:
                                                              > > >
                                                              > > > @Matt
                                                              > > >
                                                              > > > Yes, those seem to be the options. Right now, I´m applying #1. If I
                                                              > manage to obtain time to try #2, I´ll give it a shot. And about #3, sending
                                                              > a card from Argentina to your country may be a bit unnecessary expensive.
                                                              > > > Perhaps Vasi (who reported a similar problem, IIRC) is closer to you?
                                                              > > >
                                                              > > > My take: as the 1 GB card works with a 16f877 board, I think the
                                                              > problem is in the 4550 SPI module (and its registers, as initialized by the
                                                              > library), or it´s a weird electronic problem (noise, crosstalk between
                                                              > tracks, who knows).
                                                              > > >
                                                              > > > Thanx anyway!
                                                              > > >
                                                              > > >
                                                              > > > Fabián
                                                              > > >
                                                              > >
                                                              >
                                                              >


                                                              [Non-text portions of this message have been removed]
                                                            • vasi
                                                              Hi Matt, ... In the last test used, the initialization of the card (which seems to not have those pull ups inside) is made at the lowest SPI speed and some
                                                              Message 30 of 30 , Mar 12, 2011
                                                                Hi Matt,

                                                                --- In jallist@yahoogroups.com, "Matt" <matthewschinkel@...> wrote:
                                                                >
                                                                > Some other thoughts...
                                                                >
                                                                > I remember I had seen a while ago a schematic with pull-up resistors on all spi pins. Maybe floating voltage levels on PIC start up are affecting sd card init.
                                                                >
                                                                > I wonder if voltage levels could be tested if we could slow down the clock enough. Then compare to other libraries and chips to find differences. SD cards don't worry about slow speeds.
                                                                >
                                                                > Another crazy idea is to hack some device to run slow so we can test it's voltage levels, or does anyone here have a logic analyzer?
                                                                >
                                                                > Matt.


                                                                In the last test used, the initialization of the card (which seems to not have those pull ups inside) is made at the lowest SPI speed and some times is working, some times not. It seems that having pull-ups for cards with problems is a must (thinking also at what said Seb). So, I suspect the Arduino SD library activate the pull-ups on the microcontroller target. If not, then SPI from ATmega is better designed.


                                                                >
                                                                > --- In jallist@yahoogroups.com, "vasi" <funlw65@> wrote:
                                                                > >
                                                                > > The card I'm using is working perfect with ATmega644P and Arduino SD Card library. But it does not work good with 18F2550 and Hi-Tech PICC-18 with Petit FatFS (http://www.electronicslab.ph/forum/index.php?topic=17055.0). It does not work good with another compiler using FAT16 and the example included in the package (it works randomly - one time is working, many times not, at the initialization moment). I will test it with another package to see how it goes. And this mean, the fourth SD library under test...
                                                                > >
                                                                > > I can't emit a conclusion yet. This is the standard schematic also for ATmega:
                                                                > > https://lh6.googleusercontent.com/_Z3E9awpWQh4/TXqGFfgus9I/AAAAAAAAJaM/8kS7hskS54Y/s800/sdcard_connection.jpg
                                                                > > but it seems that other cards can work only with pull-up resistors:
                                                                > > https://lh3.googleusercontent.com/_Z3E9awpWQh4/TXqG5burRvI/AAAAAAAAJaQ/f7B2pqNEDzY/s800/PIC18F2550%20WAV%20Player.jpg
                                                                > > http://www.sfcompiler.co.uk/forum/viewtopic.php?t=606&postdays=0&postorder=asc&start=15&sid=00caf70e9dc0bf2a740dbcb5e3759071
                                                                > >
                                                                > > If is a SPI HW problem on 2550/4550 (for some cards, of course), then I'm wonder how is working with SPI SW (software)...
                                                                > >
                                                                > > Vasi
                                                                > >
                                                                > > --- In jallist@yahoogroups.com, Fabian Pedrosa <pendor2k@> wrote:
                                                                > > >
                                                                > > > @Matt
                                                                > > >
                                                                > > > Yes, those seem to be the options. Right now, I´m applying #1. If I manage to obtain time to try #2, I´ll give it a shot. And about #3, sending a card from Argentina to your country may be a bit unnecessary expensive.
                                                                > > > Perhaps Vasi (who reported a similar problem, IIRC) is closer to you?
                                                                > > >
                                                                > > > My take: as the 1 GB card works with a 16f877 board, I think the problem is in the 4550 SPI module (and its registers, as initialized by the library), or it´s a weird electronic problem (noise, crosstalk between tracks, who knows).
                                                                > > >
                                                                > > > Thanx anyway!
                                                                > > >
                                                                > > >
                                                                > > > Fabián
                                                                > > >
                                                                > >
                                                                >
                                                              Your message has been successfully submitted and would be delivered to recipients shortly.