Help with max4314

Can some one help me with the max4314, I’m building a video diversity for 2 video inputs 1 output. (in the future will be 4 in - 1 out)

The part of the code for the video strengh signal ready and working, I’m using digitalWrite, but I never used this, only used for turn on/off a led.

My evaluation board (for switching)

Generic shematic

Datasheet info

Datasheet
http://datasheets.maxim-ic.com/en/ds/MAX4310-MAX4315.pdf

Right now I’m using this part of the code for when rssi_1 is lower than 85% it change for the next best input. the problem is that I can only switch 1 channel…

int MUXSelect_1 = 8;

pinMode(MUXSelect_1, OUTPUT);

static void MUX(void){
  
   if (rssi_1 <= 85) {
    digitalWrite(MUXSelect_1, HIGH);
      }
  else {
    digitalWrite(MUXSelect_1, LOW);
      }

Hope that someone give me a little help :slight_smile:

the problem is that I can only switch 1 channel...

Not too sure what your problem is.

You need to look at the signal strengths from the two video inputs inputs. Then based on the results you need to put the video select pin high or low. So for example you might do nothing if the video input you are currently selecting is greater than some threshold. If it drops below that threshold then you choose the video with the greatest signal strength.

Manualy, if I connect pin 1 to gnd, pin 7 let pass video for output, if I connect pin 1, 2 to gnd pin 5 let pass video for output.

My problem is that I can’t put this into code, I don’t konw if my approch of using digitalWrite, High or Low is correct.

I don’t konw if my approch of using digitalWrite, High or Low is correct.

Yes using digital write is the way to do it.

What exactly is that code doing wrong, it looks fine to me.

I think the problem is only 1 pin is being controlled to go high & low, while your descirption says you need 2 pins to go high & low.

Your layout looks to have a trace going to MAX4314 pin1 (which is A1) and nothing on pin 2 (which is A0).