fleck
New Member
Posts: 3
|
Post by fleck on Aug 5, 2020 23:05:23 GMT -8
Hello, yesterday I received Gameduino 3 from Cool Components. Pretty fast I started to notice, there is something wrong with GD3, at first I thought it was slowly dying, but then, trying different things I noticed it's related to SD card and SPI. I tried: 1) Two different UNO boards 2) 3 different USB cables 3) external power supply 4) 4 different SD card models Nothing helped, so there is clearly something wrong on GD3 board. Here is the video of what happens when I insert SD card (hear the click sound when SD card is inserted): fleck.rullz.lv/gameduino/Also selftest fails with SD card inserted all over the place, sometimes it's clock, sometimes it's RAM, sometimes GD3 doesn't even start selftest! I will hook up scope later to SPI lines and check whats going on, seems like there is a noise problem (ground loop or smthn), ideas where should I dig? I can re-solder pretty much anything on that board, so just have to figure out what's causing this! Thanks in advance!
|
|
fleck
New Member
Posts: 3
|
Post by fleck on Aug 6, 2020 0:49:32 GMT -8
OK so, with scope I see that MISO line drops really low when SD is inserted, using kenney as my test sketch I enabled GD_STORAGE in setup(): GD.begin(GD_STORAGE); // I did enable GD_STORAGE, was ~GD_STORAGE before This makes it work if I don't remove SD Card, if I eject SD and put it back - I get glitches again, it seems that, there is a problem with bus-sharing. elm-chan.org/docs/mmc/mmc_e.htmlHere is actually some notes under "Cosideration on Multi-slave Configuration": To make MMC/SDC release the MISO line, the master device needs to send a byte after the CS signal is deasserted. So basically, when SD card is inserted AFTER all inits, SD is in native mode and drives MISO, this is bad! Maybe thats why some users report dead SD cards? Or am I missing something here?
|
|
yusuf
New Member
Posts: 3
|
Post by yusuf on Aug 6, 2020 3:15:04 GMT -8
I have the same problem, The problem is constantly sending data over spi, working properly with no sd card I think the video ram is distorted I tried spi line serial resistance on sd card control pins (3x22R), it got better but the problem is observed
|
|
|
Post by jamesbowman on Aug 6, 2020 8:39:48 GMT -8
Right, SD cards start up in non-SPI mode. Then GD.begin() puts the SD card into SPI mode. So if you hot-insert a card, it joins a running SPI bus when it is not in SPI mode. Likewise if you start with a card inserted, but do GD.begin(~GD_STORAGE) to switch off the SD init code. This varies by card manufacturer, because all microSD cards are different. The ones in the Excamera Store from SanDisk do not seem to suffer from these problems. If you have an idea for a fix that can be made, please let me know - or even send a pull request: github.com/jamesbowman/gd2-lib/blob/master/GD2.h#L178-L451(On the GD3X "Dazzler", the FPGA arbitrates the SPI bus and separates them. So the SD card only ever sees SD traffic.)
|
|
fleck
New Member
Posts: 3
|
Post by fleck on Aug 6, 2020 11:37:48 GMT -8
I don't think this should be fixed in software, it has to be done in hardware! I wonder, if single 3-state buffer with inverted Output-Enable pin (connected to SD CS PIN) on SD cards MISO line would do the trick? When SD CS is HIGH, SD MISO would have HIGH impedance on SPI bus. Then just pullup resistor on SD CS line, if MCU is not using the pin (usually stays as input), it get pulled HIGH.
|
|