Wave Shield only works when reset
Moderators: adafruit_support_bill, adafruit

Wave Shield only works when reset

by Bratan on Fri Nov 23, 2012 10:07 am

I'm having real bizarre issue with Wave Sheild connected to Mega 2560 R3. After I upload sketch, everything is frozen until I either hit reset or initiate Serial Communication (which I guess resets the board). Also if it's powered on/off same thing, I always have to reset before it starts working. From that point everything works great.
I suspect issue might be with connections to the Arduino board. I don't have it "plugged in" instead I just ran jumper wires, so it's possible I missed one?
I have all 8 data pins (DAC and SD) connected (correctly), 1 ground wire, 5V and 1 Reset wire on the opposite side.
It's hard to diagnose problem due to Serial Monitor not running when Arduino powered on. As soon as I start Serial Monitor it starts resets and starts working. I've reformatted SD card with SDFormatter...
I've tried uncommenting while(1); in the Setup but it still freezes.
Any suggestions?
Here's my Setup just in case.
Code: Select all | TOGGLE FULL SIZE
void setup () 
{
  ht1632_setup();  // Setup LED Deisplay
  setBrightness(1); // Set Brightness
  //randomSeed(analogRead(1));
  Serial.begin(9600);
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if(timeStatus()!= timeSet)
     Serial.println("Unable to sync with the RTC");
  else
     Serial.println("RTC has set the system time");   
  // Uncomment following two lines and modify to set time. After setting time, commend them and re-upload sketch
  //setTime(13,04,0,9,11,12); // Set time on Arduino (hr,min,sec,day,month,yr). Use with RTC.set(now());
  //RTC.set(now()); // Write Time data to RTC Chip. Use with previous command
  analogReference(EXTERNAL); // Set reference voltage check to 3.3 V for Temperature measuring
   
  // Wave Shield init
 // if (!card.init(true)) { //play with 4 MHz spi if 8MHz isn't working for you
  if (!card.init()) {         //play with 8 MHz spi (default faster!) 
    putstring_nl("Card init. failed!");  // Something went wrong, lets print out why
    sdErrorCheck();
    while(1);                            // then 'halt' - do nothing!
  }
  // enable optimize read - some cards may timeout. Disable if you're having problems
  card.partialBlockRead(true);
 
 
// Now we will look for a FAT partition!
  uint8_t part;
  for (part = 0; part < 5; part++) {     // we have up to 5 slots to look in
    if (vol.init(card, part))
      break;                             // we found one, lets bail
  }
  if (part == 5) {                       // if we ended up not finding one  :(
    putstring_nl("No valid FAT partition!");
    sdErrorCheck();      // Something went wrong, lets print out why
    while(1);                            // then 'halt' - do nothing!
  }
 
  // Lets tell the user about what we found
  putstring("Using partition ");
  Serial.print(part, DEC);
  putstring(", type is FAT");
  Serial.println(vol.fatType(),DEC);     // FAT16 or FAT32?
 
 
  // Try to open the root directory
  if (!root.openRoot(vol)) {
    putstring_nl("Can't open root dir!"); // Something went wrong,
    while(1);                             // then 'halt' - do nothing!
  }
 
  // Whew! We got past the tough parts.
  putstring_nl("Ready!");
}
Bratan
 
Posts: 35
Joined: Sun Mar 25, 2012 1:08 pm

Re: Wave Shield only works when reset

by Bratan on Fri Nov 23, 2012 10:15 am

I can't Edit my post?
Anyway I wanted to add issue happens even with default "daphc" sketch in the Examples of the library.
Bratan
 
Posts: 35
Joined: Sun Mar 25, 2012 1:08 pm

Re: Wave Shield only works when reset

by adafruit_support_rick on Fri Nov 23, 2012 10:31 am

Sounds like a timing issue on startup. A simple thing to try would be to move the display initialization to after the serial and rtc setup. You could also add a delay() to give you a chance to open the serial monitor.

Code: Select all | TOGGLE FULL SIZE
void setup () 
{
  //randomSeed(analogRead(1));
  Serial.begin(9600);
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if(timeStatus()!= timeSet)
     Serial.println("Unable to sync with the RTC");
  else
     Serial.println("RTC has set the system time");   
  ht1632_setup();  // Setup LED Deisplay
  setBrightness(1); // Set Brightness
 
User avatar
adafruit_support_rick
 
Posts: 12140
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Wave Shield only works when reset

by Bratan on Fri Nov 23, 2012 2:21 pm

Thanks, but it didn't help. Issue happens even with example sketch :(
Bratan
 
Posts: 35
Joined: Sun Mar 25, 2012 1:08 pm

Re: Wave Shield only works when reset

by adafruit_support_rick on Fri Nov 23, 2012 6:16 pm

Bratan wrote:Thanks, but it didn't help. Issue happens even with example sketch

Post detailed pictures of both sides of the shield.
User avatar
adafruit_support_rick
 
Posts: 12140
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Wave Shield only works when reset

by Bratan on Mon Nov 26, 2012 3:55 pm

Post detailed pictures of both sides of the shield.

Connected to Arduino or disconnected?
Bratan
 
Posts: 35
Joined: Sun Mar 25, 2012 1:08 pm

Re: Wave Shield only works when reset

by adafruit_support_rick on Mon Nov 26, 2012 4:44 pm

Disconnected. Make sure the pictures are clear and focused, sop we can check the assembly and soldering.
User avatar
adafruit_support_rick
 
Posts: 12140
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Wave Shield only works when reset

by Bratan on Wed Jan 02, 2013 6:06 pm

Sorry for late reply. By the time I had chance to took detailed pictures, I got problem resolved :) I soldered all connections with wires instead of using breadboard, and now I'm not hanging. It was hanging while trying to read the card, and wires were either too long or had bad contact.
Bratan
 
Posts: 35
Joined: Sun Mar 25, 2012 1:08 pm

Re: Wave Shield only works when reset

by adafruit_support_rick on Wed Jan 02, 2013 7:10 pm

Bratan wrote:I soldered all connections with wires instead of using breadboard, and now I'm not hanging. It was hanging while trying to read the card, and wires were either too long or had bad contact.


That's a real common problem. Glad you figured it out :D

For anyone else who finds this thread and has the same problem: Try different wires, try different breadboard positions, or just solder it !
User avatar
adafruit_support_rick
 
Posts: 12140
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY