Hi,
i got some weird behaviour with my MSGEQ7 Chip.
First i have to say, i wired it up correctly, i tried 2 chips and i tried different wirings, cause every website and datasheets tell you some different Values. I think the most correct info is the sparkfun datasheet and the sparkfun shield. But the shield has different values than the datasheet for the ic itself o.O I also tried different delays in the programm. nothing is working
Okay, so my MSGEQ7 is working quite okay, but i got sometimes very low values at a special reading sequence. Normally the values are between 45 and 1023. But if i do this and analyse the minum peak value for each array value i got the following output. (The value is NOT ALWAYS 0, but it can be unter the normal minimum of 45. as you can see the average (av) value is still as high as the others.) I should also notice, that this problem is only if i play musik. paused musik outputs minimums of 45-60
digitalWrite(resetPin, HIGH); //resets the IC to start at 63Hz value
digitalWrite(resetPin, LOW);
delayMicroseconds(72); // to allow the reset to settle
for (int i = 0; i < 7; i++){
digitalWrite(strobePin, LOW); //Next value for the IC
delayMicroseconds(36); // to allow the output to settle
//63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25KHz, 16kHz
spectrumValueRight[i] = analogRead(analogPinRight);
spectrumValueLeft[i] = analogRead(analogPinLeft);
digitalWrite(strobePin, HIGH); //Prepare for next value
}
Output: (left is connected to gnd, thatswhy 0)
0: MaxL0 MaxR1015 MinL0 MinR0 AvL0 AVR205
1: MaxL0 MaxR1017 MinL0 MinR55 AvL0 AVR296
2: MaxL0 MaxR1018 MinL0 MinR51 AvL0 AVR257
3: MaxL0 MaxR1018 MinL0 MinR48 AvL0 AVR197
4: MaxL0 MaxR1015 MinL0 MinR57 AvL0 AVR147
5: MaxL0 MaxR995 MinL0 MinR41 AvL0 AVR105
6: MaxL0 MaxR1017 MinL0 MinR52 AvL0 AVR167
And now the weird things start (all values are ablosute minimums!):
1-6 reads: everything is fine
7 reads: the first [.0]value can get 0 (also for muliples like 14 reads, but only the very first reading cycle. reading #8 is clear!)
8 reads: the 2nd [.1] value can get 0 (15 reads)
9 reads: value can get ~20 (16 reads
if i write the for as a long code i have the same behaviour. The problem is not in the for, not the array itself, not the typ int, it is not the delay anywhere in my code. i seems the ic has some problems if i read it a 7th time and then it has to resett. seems like it cant handle this resett from the high number, or the reset is unclear, so i better dont use any resett.
ANY IDEA? It drives my crazy. I dont wanna deal with these abnormal bugs. this shouldnt happen.
some extra tests:
i counted how often i have to start the read function to get a zero value.
with the code above (i=0;i<7;i++) and no fake read it takes 37-600 times (just a few tries)
If i run it from 1 to 7 or from 0 to 6 is got 6 values and all 6 are okay. Why the hell is the last reading messing everything up? The weird thing is, that i just attach one more read after the code but it messes up the 1st reading.