Show Posts
Pages: 1 ... 7 8 [9] 10 11 ... 14
121  Using Arduino / Programming Questions / Re: quickly "reversing" a byte? on: August 10, 2012, 01:38:29 am
Something like this?
Code:
char rev[256];

rev[1] = 128;
rev[2] = 64;
rev[3] = 192;
...

var = rev[var];
...

I hadn't thought about doing it that way. I don't know a single thing about assembly or how a compiler would assemble that code, but my guess would be that it would need to put rev[y] into a register out of memory (LDS? 2 cycles?), and then store it into var (STS? 2 cycles?). There seem to be a few version of STS and LDS which take either 1 or 2 cycles. Not sure which one is used in this case. 256 bytes of RAM is no problem but this solution isn't very elegant. I found an instruction called SWAP which swaps the nibbles of a byte so I'm sure there's an instruction to swap every single bit. Can't find it though...
122  Using Arduino / Programming Questions / quickly "reversing" a byte? on: August 10, 2012, 12:58:36 am
Is there a very fast way to "reverse" a byte? Like turning 01110010 into 01001110 where bit 0 goes where bit 7 was, bit 1 goes where bit 6 was etc. I could do it in a loop of course but I'm looking for an alternative that only takes a few clock cycles. I'm sure that one of the many instructions can do this in just a few cycles, but I have no idea which one it is.
123  Using Arduino / General Electronics / Re: Minimum input current for a reliable reading? on: August 09, 2012, 08:00:13 pm
Well seeing as my patience is exceedingly low, I can rarely wait 2 and a half weeks for a Tayda delivery (even though it's cheaper overall) when digikey can ship overnight for $8. Never tried dipmicro though, I'll have to check them out.
124  Using Arduino / General Electronics / Re: what is that? on: August 09, 2012, 08:05:28 am
My only guess (and it's pretty far-fetched) is that whenever the oscillator turns on (1/60000 second) the resulting plasma pushes other particles away from the electrodes. Eventually they bounce around and line up into 11 stripes between the electrodes. Basically visible harmonic vibrations. I hope that's the answer because that would be awesome. Try changing the frequency if possible, they might go away.
125  Using Arduino / General Electronics / Re: Minimum input current for a reliable reading? on: August 09, 2012, 06:20:08 am
Alright then, I'll have a capacitor to ground as well. Seeing as the voltage will change less than 1 volt per hour there shouldn't be any problem with a 1uF cap or even higher, correct? I seem to be running out .1uF caps!
126  Using Arduino / General Electronics / Re: Minimum input current for a reliable reading? on: August 09, 2012, 06:05:35 am
That's what I figured. But how low is past the point of "not important at all"? Would you say 50uA is good enough?
127  Using Arduino / General Electronics / Minimum input current for a reliable reading? on: August 09, 2012, 05:48:03 am
I'm going to be monitoring battery voltage and other voltages which are higher than the MCU's Vcc for my next project. Therefore I'm using a simple voltage divider to get the voltage down to an acceptable level. Of course, I'd like to waste as little power as possible in the divider so I need to know what the minimum input current to the ADC is so that I can adjust my resistors accordingly. The conversions will take place once a second if it makes a difference. I've already tested and found that less than 30uA is sufficient for digital inputs but I'm not sure about analog inputs.
128  Using Arduino / Displays / Re: Do LCDs just stop working? on: August 09, 2012, 04:03:38 am
Without a datasheet for you specific LCD its impossible to imagine what could be wrong. However, I've had a problem with a 16x2 display before where one of the data lines was shorted to ground, causing that bit to always be low. It still managed to initialize but all the characters were jumbled. Might be helpful to check the traces.
129  Using Arduino / Storage / Re: Accessing SD card at higher speeds. on: August 09, 2012, 03:02:31 am
>What sort of arduino are you using?
I'm not actually using an arduino. I'm using an ATxmega256D3 on a custom board.

>It could be that your SD card can't go faster. Have you tried another one?
I've tried a 16MB card but it didn't work at any speed (I think it's getting FAT12 formatted instead of FAT16). I also tried a 128MB miscroSD card in an adapter, but it didn't work at any speeds either. My current working card is 512MB if it makes a difference.

>What class of SD card do you have?
If by class you mean speed class then all I know is that there are no high speed marking on it (like these: https://www.sdcard.org/developers/overview/speed_class/host-marks.png). If by class you mean SD vs SDHC vs SDXC, its just plain old SD. The only useful info on the card is SD-M512 which led me to this "datasheet", http://datasheet.octopart.com/SDM512-Toshiba-datasheet-10124.pdf

If the card couldn't go faster then I assume it wouldn't even initialize at 8MHz (like it fails to at 16MHz). The fact that I get 99% of the data back correctly leads me to believe that it's just busy or something and that I have to wait for it. Although it certainly could just be the max SPI speed of the card.

Which leads me to the question, has anyone ever attempted to use an SD card in SD mode (which I assume is faster) on an arduino? Or is it far too complicated/fast for a small MCU to keep up?

Also I just read this: "When the card encounters a data retrieval problem, it will respond with an error response (which
replaces the expected data block)
". This is likely whats happening right now. I'll read up some more on it.
130  Using Arduino / Audio / Re: MP3 decoding code, NOT realtime on: August 08, 2012, 07:00:06 pm
ATxmega256D3, the big brother of ATmega. http://www.atmel.com/devices/atxmega256d3.aspx?tab=documents
131  Using Arduino / Storage / Re: Accessing SD card at higher speeds. on: August 08, 2012, 06:57:13 pm
Ok, I took out the resistors. Made no difference.
132  Using Arduino / Audio / Re: MP3 decoding code, NOT realtime on: August 08, 2012, 06:36:25 pm
@Magician So I'll read a smaller chunk. If I remember, one "page" of mp3 data is about 1K. Even if it's bigger, I still have 15K of RAM to spare.

@frank26080115 A separate DAC gives me the ability to create and send waveforms directly from the MCU as well. If I decide to implement something like a low frequency arb. wave generator then it will be easier to send the data directly to the DAC rather than packing it up into a format that the decoder will understand just for it to be decoded again.

@Grumpy_Mike It's certainly not the best solution to the problem, but for this low cost, low speed application I'm not going to complain. Worst comes to worst, I'll use a bigger SD card with wav files and try to make a fat32 compatible library.
133  Using Arduino / Audio / Re: MP3 decoding code, NOT realtime on: August 08, 2012, 06:16:46 am
How are you planning to output audio?
http://www.analog.com/static/imported-files/data_sheets/AD5663.pdf
I have another topic in the audio section talking about it, as I'm not sure which SPI mode to use to talk to it.
134  Using Arduino / Audio / Re: MP3 decoding code, NOT realtime on: August 08, 2012, 05:36:22 am
I wanted to keep costs down and board layout simple. Seeing as it doesn't have to be realtime, software seemed like a fine solution
135  Using Arduino / Storage / Re: Accessing SD card at higher speeds. on: August 08, 2012, 04:36:37 am
I wasn't sure what the input impedance of the SD card was, hence the resistors. I'll just omit them completely then.
Pages: 1 ... 7 8 [9] 10 11 ... 14