Go Down

Topic: MSGEQ7 and Analog Input (Read 1 time) previous topic - next topic

Cintax

Well, I found a solution to my problem.

I used some RG-58A/U cable for the analog signal wire and some shielded 18-6 wire for the audio signal wires. Grounded the shield at one end and problem solved.

Not sure why I didn't think of all this sooner.

Hair_of_the_Dog

After looking at the msgeq7 datasheet I modified the code listed above in an attempt to get the timing closer to






tr - Reset Pulse Width100 nS min
trs - Reset to StrobeDelay72 uS min
ts - Strobe Pulse Width18 uS min
tss - Strobe to StrobeDelay72 uS min
to - Output Settling Time36 uS min
                                     
             
Code: [Select]

int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values

void setup()
{
  Serial.begin(9600);
  pinMode(analogPin, INPUT);
  pinMode(strobePin, OUTPUT);
  pinMode(resetPin, OUTPUT);
  analogReference(DEFAULT);

  digitalWrite(resetPin, LOW);
  digitalWrite(strobePin, HIGH);

}

bufferEQ();

void loop()
{
bufferEQ();
}

void bufferEQ() {
  digitalWrite(resetPin, HIGH);
  digitalWrite(resetPin, LOW);
 
  delayMicroseconds(72);

  long strobePulseStart = 0;

  for (int i = 0; i < 7; i++)
  {
    delayMicroseconds(36); // to allow the output to settle
    digitalWrite(strobePin, LOW);
    strobePulseStart = micros();
    spectrumValue[i] = analogRead(analogPin);
    delayMicros(constrain(18 - (micros()  - strobePulseStart), 0, 18));  // finish strobe pulse width
    digitalWrite(strobePin, HIGH);
   
    delayMicros(constrain(72 - ((micros()-strobePulseStart) -18), 0 ,72)); // adjust for if the strobe pulse width went long
  }
}


Please let me know this looks about right or if I am way off.

BTW: I had the same experience with the 0 signal with noise. I'll check out the
Quote
RG-58A/U cable for the analog signal wire and some shielded 18-6 wire for the audio signal wires
to see if that helps me.

brucethehoon

I spoke to John Ambrose (high up) at mix-sig and he reminded me that the device has a reasonable amount of amplification built in, so SOME noise at 0 is expected and should be compensated for in the code.


Hair_of_the_Dog

Did he say what a resonable amount is?

I noticed most freqs with between 5-10% noise floor.

brucethehoon

I don't have it in front of me - on my phone- but the data sheet does list it

Go Up