Timer

Cheers Adam, i saw that when i bought the vs1002 breakout board, but my worry is there is so much stuff on it, i wont know where to start!

Can i run the program on my avr that plays an mp3 file based on certain button pushes like the timings program we originally started with at the beginning of this thread? all the connections would be different and i;m not sure i wouldbe able to modify my code to these new connections. It looks quite daunting!!!

In relation to the power supply, the vs1002 breakout board needs 9v and the avr needs 3.5 so they connect to different places on my breadboard, which means i can just plug in and unplug the vs1002 board while the avr is being powered from a different place. it was a mistake when i turned the power on and the vs1002 was plugged in and the led on the dreq line didnt come on…

there is no voltage from the dreq pin of avr (pin 24) to the dreq of the vs1002 breakout, but there is from pin 24 to RST, and 24 to GBUF, which are either side of DREQ. The voltage is 0.42 volts???

when the vs1002 has power the voltage from pin 24 to gnd is 0.46 volts
when the vs1002 has no power and therefore the led is on the voltage is 2.02.

does this suggest a short somwehre?

Those voltages sound very odd, I’m not sure what’s going on there.

You should be able to use this board with your current software, since essentially it’s just a “breakout board” for the VS1002 chip, including power for it and its connections to the SD card socket (and some nice extras, like the chip’s built-in functions accessible from that nav-switch). I think all the pins that connect to the AVR in your schematic (including a 3.3V power source) are all brought out to that ten-pin header socket on this board, so you should be able to build an AVR board that this one plugs into, and run everything off of that one AA battery.

Since we still haven’t figured out the problem with your current setup I can’t say for sure that this will work either, but I think it will, and it seems like a much cheaper next step!

-Adam

I am going to try and sort these odd voltages before i buy it, a) because it takes three weeks to arrive, and b) because i have got this far, and two little voltages is not enough to defeat me quite yet. i did a continuity test and there between RST and DREQ there is little continuity but it is definately not off the scale.

does the fact that the led go off suggest that there is an easier route to ground, so it is bypassing the led?

I bought myself a new 12MP Digital slr camera the other day, and I am now putting it to good use, no more straining the eyes trying to find shorts, check it out:
ksd-design.co.uk/walker/photos.html

i am doing a few tests with this dreq led. when the vs1002 is not getting any power, there is continuity between ground and the dreq pin, but it is less than the continuity via the led, hence the led is on. but when the vs1002 is getting power, the continuity between gnd and dreq pin is about 20. so thats why the led goes out. that also suggests doesnt it, that it is not my solders that are shorting the circuit but seomthing on the breakout board? am i correct?

also i have run the mp3 player program through, with the dreq line disconnected, and no sd card hoping to see the leds telling me there are errors, and they are not coming on - although i know they work. is there a way to see the code running through at all?

right, ignore post above, i have moved it all back to beadboard now, so solders are no longer an issue. if i program the avr at one voltage and run it at another, thats not a problem is it?

i think i have come to realise that the problem was actually on the vs1002 breakout board. i think this is right because when i orignally moved to strip board. i thought my first vs1002 board may have a problem. bought another and changed them. which meant i had one to test against. now with the original one on the breadboard, the dreq light comes on, when i run the following program:

#include <avr/io.h>
int main( void )
        {
DDRD |= (1<< PD2);
DDRC |= (1<< PC1);
DDRC |= (1<< PC5);
DDRB |= (1<< PB1);
while(1)
{
		while(PIND&(1<<PD2))
		{
		}

		PORTC |= (1<< PC1);
		PORTC |= (1<< PC5);
		PORTB |= (1<< PB1);
}
   return 1;

        }

it just turns all the leds on.

so now, i am going to re download the code for the mp3 player off avr freaks, and run a totally fresh copy. because the copies i have i dont trust anymore (and they dont work on the breadboard version). after that i am going to set the thing a light, and watch it burn!

p.s ksd-design.co.uk/walker/photos.html

the photos are big but control and scroll wheel will zoom them out

EDIT:

Did that, and still no leds, the only other thing different now is i havent got the buttons that are in the schematic, but the avr doesnt know that?

an error light would be nice. it would tell me the code is running!!!

i soldered a resistor to an led and have ben poking around for a voltage. - nothing on the SI SO CLK and CS lines. what supplies these with voltage the breakout board or the avr? in other words what is the cause of the prob here?

there are also some test on page 35 of the vs1002 datahsheet. i wondered whether any would tell me whether my breakout was working properly?

Wow, sorry. I totally got sidetracked there for a couple of weeks.

Programming your AVR is a totally digital operation, so if it works at all, it works completely, regardless of running it at different voltages, so that’s something at least.

With this SPI communication protocol (Serial Peripheral Interface) voltage on the communication lines is generated by the AVR or the mp3 chip, so there’s nothing special you need to do on the breadboard.

I’m confused that you’re trying to recreate something that was working before and isn’t now. Can you think of anything that might be different? Leaving off the buttons shouldn’t be a problem, in this case it’s just like having them there but not pressing them. Unless the sample program you’re using requires a button-press before it will do anything maybe?

-Adam

P.S. Wow, those photos are huge! What happened to the bottom edge of your mp3 breakout board?

hey adam, sry have no internet in new house, trying to sort it out, but grabbing a chance to check this. i cut it off to fit in a box, its fine though, there are no lines there - asked sparkfun. I have loads of new bit coming, and have put it back on breadboard. gonna try again and then will find out what is wrong. also i have a guy in the states designing my pcb for $30 so when i get that back, would you be able to look at it?

cheers alex

hey adam, wondered whether you could have a look at the chematic i have had drawn up to see if it is correct for the board.

thanks
alex

Sure. You might want to post it here anyway so others can have a look.

-Adam

OK, its attached at bottom as a .brd file i am havbing trouble reading the two layered stuff.
mp3.rar (7.21 KB)

I’m not familiar with .brd files, what program are you using to view it?

-Adam

eagle schematic program

I took a quick look, and it looks to me like your ‘guy’ did a lot of good work for just $30! I don’t see anything blatantly wrong, but there are a couple of things I’m not sure are right (or at least the way you wanted them):

  • This schematic looks like its designed to use the SparkFun microSD breakout board, but in your pictures you have their standard size SD breakout board. Is that what you wanted?
  • There is no ‘Play’ button (AVR Pin 4)
  • The rest of the buttons are in a somewhat odd order (the convenient order of the AVR pins): Mode|V+|Prev|V-|Next. Of course you could change their functions in the AVR software.
  • Make sure you’re using a 3.3V regulator with the pin output order: GND-Output-Input
  • I’m not familiar with the power switch or headphone jack footprints you’re planning on using, do you have schematics or part number or something for those? At least I can tell you that the right wires are going to them

Since there is no programming port you should use a socket on this board, and plan on programming your AVR chip separately before inserting it. It’s probably better this way, since there are other devices connected to the programming pins which might be causing you problems.

-Adam

cheers for that, those problems arent actual problems, just things for me to be aware of???

Back to my breadboard, which is backto how it was when i first started this project, If i write a program on the avr that turns all three leds on, that works, I have a new vs1002 breakout board which i’m using. If while that program runs i plug in the vs1002 board, the DREQ leg goes out, would that make sense - DREQ grounds the pin???

When I run the mp3 player though, through the headphones i just get a buzzing. None of the leds come on - ever. The avr, vs1002 and memory card are all new, I wrote the program to the avr but i still dont get sound. If I debug the program it always stops at the { inside the main loop. is it waiting for something???

if i put my multimeter set on continuity between dreq and the respective avr pin, the headphones crackle a little differently, and the dreq led comes on… I think i read somewhere that DREQ when high, the led ca turn on, and when low the led cant turn on. Is it something in the code or the circuit that is stopping the mp3 player working???

A QUICK IDEA! Since the original program I looked at, I have redownloaded it. It was originally designed for the mega8. Could there be some registry names or something that we changed over and i have forgotten and that is why it doesnt work on my mega168. To get it to run correctly what do i have to make sure of, config options, simulator, and do i have to make a NEW .hex file or can i write over the old one?

Also to see if the vs1002 works, there is a download sine test which on the “line out” will produce a 5062Hx sine wave. Is there a way to read this without an oscilliscope

The debugger/simulator built into AVR Studio probably won’t be useful to you for this program since the AVR is interacting with other electronics. If you want to play around with it though you need to click on the right buttons to step through the code and watch it change the registers. Check out the sub-chapter “Simulation with AVRStudio” starting on page 30 of the C Programming for Microcontrollers Quick Start Guide.

I wouldn’t draw any conclusions from your continuity test, a small amount of current from your multimeter could be lighting up the LED and causing noise on the headphone. I’m not sure if you’re doing this while the boards are powered, but It’s generally not a good idea to do continuity measurements while your electronics are powered on, as you’re making electrical connections between points that are not necessarily supposed to be connected and can cause damage (also the readings you get won’t be really meaningful).

As far as modifying the original project code again, all you have to do is change some register names and that one constant that accounts for the chip being a VS1002 not a VS1003. If you don’t have saved revisions there are some versions of code posted to this forum that I remember worked with your breadboard setup.

If you hook up a pair of headphones to the line out you should be able to hear a 5062Hz sine wave as a very high-pitched whine. Noise/age related hearing loss usually starts in the 4000Hz plus range though, so it will depend on how good your ears are.

-Adam

CHeers Adam. I will continue to poke around, if you get a chance though, I have uploaded some photos to ksd-design.co.uk/walker/photos/photos.html if you get time could you have a look around, after the first two i have moved the breakout board so you can see the connections