| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Problems encountered along the way

Page history last edited by camerons 13 years, 10 months ago

 

When I used my headphones it would not play the mp3s ever. For the longest time I thought this was my code not working, but I eventually realized my headphones had too large an impedance to be driven by the teensy and started using smaller headphones which worked.

 

Serial port initialize crashes program. I still have no idea what causes this crash, but I realized that if I take out the serial port begin call it fixes alot of things. Serial port also has other bugs like it takes awhile to initialize and skips lines sometimes, or sometimes it just flakes out and doesnt print at all, which makes debugging hell. Moral of the story- try to stay away from serial port for larger programs. I feel that the problem might be that the serial port is taking up alot of memory.

 

I tried to bend back my sd card so it would fit in the book. I accidently partially broke a solder joint but it looked like it was making a connection so I never noticed. The symptom was the mp3 player randomly changing songs. You can imagine how hard this was to find. I checked for loose wires 3 or 4 times and never found them. I eventually realized this and resoldered and the problem went away. This was probably the 2nd worst problem I had during the course of this project and must have added at least 10-15 extra hours of me debugging parts of the circuit that were unrelated to the problem.

 

The WORST problem of all:  This problem added at least 15 hours extra of debugging. The symptom: I took a method at the bottom which was not getting called and deleted it. I ran the code and the code worked fine. I pasted the method back in without making any changes (so the method is still obviously not referenced) and the program compiles but crashes during run time. I finally realized that this is because I was running out of stack space. Here is the breakdown of stack space.

Serial buffer     512

mp3 decoder   512

SD Card           512

song list           100

other variables  100

the teensy claims that I get 2560 bytes SRAM.

This seems safe- here's the catch. Debug printlns("hello welcome") take up alot of sram because the string literal is stored in SRAM (why it is not in progmem, i dont know). The method I was copy pasting had a debug println like Serial.println("button pressed"); and the addition of this method EVEN THOUGH IT WAS NEVER REFERENCED crashed the program. So much for compiler optimization. This took me forever to figure out. I fixed it by commenting all serial printlns and storing the song list in EEPROM.

 

Symptom: The code would crash in the setup method when you ran it from the battery but not when you ran it from the serial plug. 1) Voltage regulator I started with could not source as much current as USB- I changed regulators to one rated to higher than USB. 2) USB can actually source more current than its rated for for short periods of time while the regulator cannot. 3) Giant spikes in voltage of battery are not happy. Put in capacitors between + and - to smooth this out. Battery could not source enough power to power on all my components at startup.

     Solution: Put 200 ms delays between each initialization call to the different components.

 

Many remote libraries did not work- went through at least 4 libraries, wading through .cpp files and register settings to try to fix them but none of them worked.      I eventually just wrote my own code after spending hours and hours on the oscilloscope trying to decode the different wave forms that came out of the IR receiver. I compared this to the known sony protocol and figured out what the thresholds should be for a 0 or 1 and learned that there is a start marker pulse from the oscilloscope. I played with this for awhile and figured out how the keys translate into binary waveform outputs and mapped each key to a number.

 

Mp3 does not always play because of decoder problems even though its working. This was terrible before I realized it because I thought my code was not working when it would flake out like 10 times in a row and spend hours trying to find bugs. I also rechecked my cables MANY times throughout this to find loose connections and even replugged everything in again.

     You need to unplug and replug in the power cable sometimes because the decoder goes into an error state and wont come out of it.

 

 

 

I wanted to put my mp3 player in a big boook. I tried carving it with a knife for like 3 hours. It only got like 1/10 of the way through this 3000 page book so I gave up and got a smaller book.

 

Audio jack mislabeled

     David helped me with this

Plugged in the LCD backwards because pinout was labeled differently on the website and mine did not have a sticker pinout.

     Figured it out eventually

 

 

 

 

Comments (0)

You don't have permission to comment on this page.