Show Posts
Pages: 1 ... 8 9 [10] 11 12 ... 14
136  Using Arduino / Storage / Re: Accessing SD card at higher speeds. on: August 08, 2012, 04:07:36 am
As I mentioned in the original post, I'm running the MCU at 3.3v
137  Using Arduino / Audio / Re: MP3 decoding code, NOT realtime on: August 08, 2012, 04:05:33 am
Quote
Why does it have to be on an arduino?
It's for a handheld device (think iPod touch) that I'm working on. All of the data for this device (images, songs, text files, etc.) will be stored on an SD card. Every time I want to listen to a song, I'll decode it, play it, and then erase the decoded version. If all my songs were stored as wav files then I wouldn't be able to store nearly as many.
138  Using Arduino / Storage / Re: Accessing SD card at higher speeds. on: August 08, 2012, 03:37:09 am
Ha, something inside of me was saying that 2K was too big as well. I'll desolder them and put in some 220 ohm ones tomorrow. But shouldn't they only affect writing? Like I said, there's no resistor on MISO.
139  Using Arduino / Audio / Re: AD5663 DAC for audio reproduction on: August 08, 2012, 03:29:11 am
While it's true that I haven't tested how long it takes to open the SD card, read a page, and close it, (and now that I think about it it probably does take significantly longer than continuous reading) I can always use the second SPI port for the DAC (probably should have also mentioned I'm using an xmega smiley) and read continuously off the SD card. In that case I'm also not limited to mode 0 or 3. Thanks for the heads up though. Luckily my second SPI port isn't occupied.
140  Using Arduino / Storage / Accessing SD card at higher speeds. on: August 08, 2012, 03:13:36 am
So far the highest SCK speed I can use and still ensure reliable data transfer (specifically reading) is 4MHz. At 8Mhz I get about 99% of the data read correctly off the SD card, but every now and then (always in the same place in the file I'm reading) I get a kilobyte or so of 0xFF instead of the actual data. At 16MHz the SD card won't even initialize. So my question is, is there anything I can do to increase the reliability of my connection so that I can get 100% integrity at 8Mhz? I'm running at 3.3v and the SD card is connected to the SPI pins through 2K resistors for current limiting (except for MISO). I'm also using a very basic custom SD library so that I can read as fast as possible. My guess is that the SD card is busy at the times when it gives me 0xFF so checking if it's busy before reading might solve the problem but there doesn't seem to be a busy bit in any of the SPI registers. I already check if bit 7 of the status register is high before proceeding to read anymore data. It might just be that the data is lost somewhere between the SD card and the MCU though. However, the fact that I get bad data in the same place every time really befuddles me.
141  Using Arduino / Audio / Re: MP3 decoding code, NOT realtime on: August 08, 2012, 02:07:47 am
Thanks for the responses! It's certainly going to take a while to combine and port all this code to an xmega but I'm sure the results will be worth it.
142  Using Arduino / Audio / MP3 decoding code, NOT realtime on: August 07, 2012, 10:53:29 pm
Does anyone have code for decoding MP3 files into PCM? I don't need to have the conversion go on in realtime as the audio is playing, just something that can read an MP3 (in small chunks of course)into memory from an SD card and convert it to PCM so that I could store it in another file for later playback. If not, can someone direct me to an article about decoding huffman code? (which is what most of the MP3 is made up of as far as I can tell)
143  Using Arduino / Audio / Re: AD5663 DAC for audio reproduction on: August 07, 2012, 09:54:14 pm
Also, assuming there are no problems with this DAC, which SPI mode should I use to write to it? By looking at the SPI timing diagrams in the datasheet it looks like data is shifted in on a falling edge of SCK. This means I should either use mode 1 or 2 if I'm reading the ATMEL datasheet correctly (http://www.atmel.com/Images/doc8210.pdf pg.195). But which one is it exactly? The SD card that I'm reading audio data from only works in mode 0 and 3 so I might have to switch modes every time I want to read a new page from the SD card, which would probably waste a lot of time :/
144  Using Arduino / Audio / AD5663 DAC for audio reproduction on: August 07, 2012, 06:25:43 pm
Kind of a simple question really. Does anyone see any reason why the AD5663 DAC wouldn't be suitable for reproducing audio? (http://www.analog.com/static/imported-files/data_sheets/AD5663.pdf). I've already stupidly bought an LTC2606 DAC just to realize that it's I2C interface was to slow for audio. This DAC uses an SPI interface up to 50MHz so I don't think it should be a problem but I want to know if you guys see any obvious reasons this won't work.
145  Using Arduino / Programming Questions / Re: Using ATmega328 PB6 and PB7 as digital pins? on: July 28, 2012, 06:08:27 pm
Quote
Does it effect/upset the analogue pin numbers?
Yes, it does indeed shift the analogue pins numbers up by two. I just redefined the A0-A5 to be two higher. However, if your sketches use 14-19 instead of A0-A5 (like most of mine), then you have to change them all to be two higher.
146  Using Arduino / Programming Questions / Re: Using ATmega328 PB6 and PB7 as digital pins? on: July 28, 2012, 07:25:40 am
Alright, I figured it out. A bit more messing around in pins_arduino.c and I can now use 14 and 15 as PB6 and PB7. Now I have to do the same thing in arduino 1.0.1, which has no pins_arduino.c as far as I can tell.

EDIT: Nevermind, I found pins_arduino.h in 1.0.1
147  Using Arduino / Programming Questions / Re: Using ATmega328 PB6 and PB7 as digital pins? on: July 28, 2012, 06:32:36 am
Not sure what these "ATMEL pin numbers" of which you speak are. If you meant typing something like PB5 rather than 13 when trying to talk to a pin, I'm afraid that the arduino compiler doesn't like it. Also, giving me a 500 page datasheet without giving a clue as to what I should look for in it isn't helping much.
148  Using Arduino / Programming Questions / Re: Using ATmega328 PB6 and PB7 as digital pins? on: July 28, 2012, 06:07:01 am
I've already tried to mess around in pins_arduino.c without success although I'm sure that it is the right way to go about this (I didn't even really know what to change). I'm able to use the pins directly without releasing any magic smoke by typing something along the lines of
Code:
DDRB = 192;
PORTB = 192;
but seeing as I'm trying to implement software serial on the pins, I need an actual pin number to work with.
149  Using Arduino / Programming Questions / Using ATmega328 PB6 and PB7 as digital pins? on: July 28, 2012, 03:15:05 am
Is there anyway to use PB6 and PB7 on an ATmega328 as digital pins? They don't seem to be defined as digital pins anywhere. I'm of course running off the internal oscillator.
150  Using Arduino / Microcontrollers / Re: ATmega2561 cannot enter programming mode? on: July 28, 2012, 02:56:48 am
I'm not using a bootloader at all. I'm trying to load the code hex file directly to the chip via ISP with the AVRISPmkII. If it's any help at all I just realized that Atmel studio is throwing an error message "[ERROR] Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00, ModuleName: TCF (TCF command: Device:startSession failed.)". I can't make heads or tails of it though.
Pages: 1 ... 8 9 [10] 11 12 ... 14