Hey Guys,
I have recently hit a road dump on a little Arduino Project and would appreciate any assistance or suggestions.
I have hooked up a Arduino UNO R3 to a TTL RS232 Shifter and hope to control the Dell™ C5518QT Monitor by sending a command through the Arduino serial port. The Arduino receives inputs from 5 external buttons each with their own LED and then sends out the corresponding command to the monitor. These commands are found in the Dell data sheet attached.
At this point in the project everything has been soldered and testing has begun with the monitor. Using the serial monitor built in to the Arduino IDE I can check that the Tx port is outputting the correct bytes. However, the monitor shows no response to the command.
I am unsure if Serial.write(); is sending the command as I have imagined it to, or if the Dell Monitor is receiving the signal properly.
Right now the Tx LED lights up on the TTL - RS232 shifter when a button is pressed.
I have included the code below for reference and I'm currently looking for a way to isolate the problem.
Please let me know what further information may be required to help troubleshoot.
// Define Button pins
const int button_OFF = 2; //button_OFF is connected to port #2
const int button_Computer = 3;
const int button_Laptop = 4;
const int button_Vol_Up = 5;
const int button_Vol_Down = 6;
// Define LED pins
const int led_OFF = 8;
const int led_Computer = 9;
const int led_Laptop = 10;
const int led_Vol_Up = 11;
const int led_Vol_Down = 12;
bool SYSTEM = 0; //System On/Off flag. 0=off, 1 =on.
byte Monitor_ON[] = {0x37, 0x51, 0x03, 0xEA, 0x20, 0x00, 0xAF};
byte Monitor_OFF[] = {0x37, 0x51, 0x03, 0xEA, 0x20, 0x01, 0xAE};
byte Volume_UP[] = {0x37, 0x51, 0x06, 0xEA, 0x62, 0x01, 0x00, 0x00, 0x00, 0xE9};
byte Volume_DOWN[] = {0x37, 0x51, 0x06, 0xEA, 0x62, 0x02, 0x00, 0x00, 0x00, 0xEA};
byte Input_HMDI1[] = {0x37, 0x51, 0x03, 0xEA, 0xB3, 0x01, 0x3D};
byte Input_HMDI2[] = {0x37, 0x51, 0x03, 0xEA, 0xB3, 0x00, 0x3C};
void setup() {
Serial.begin(9600); //set baude rate
// initialize the buttons as input
pinMode(button_OFF, INPUT);
pinMode(button_Computer, INPUT);
pinMode(button_Laptop, INPUT);
pinMode(button_Vol_Up, INPUT);
pinMode(button_Vol_Down, INPUT);
// initialize the LED pins as an output
pinMode(led_OFF, OUTPUT);
pinMode(led_Computer, OUTPUT);
pinMode(led_Laptop, OUTPUT);
pinMode(led_Vol_Up, OUTPUT);
pinMode(led_Vol_Down, OUTPUT);
//Defualt state = OFF
digitalWrite(led_OFF, HIGH);
}
void LED_Reset(){ //Turns all input LED's off
digitalWrite(led_OFF, LOW);
digitalWrite(led_Computer, LOW);
digitalWrite(led_Laptop, LOW);
}
void loop() {
if (digitalRead(button_OFF) == HIGH) {
while(digitalRead(button_OFF) == HIGH){} //wait for button release before action
LED_Reset();
digitalWrite(led_OFF, HIGH);
SYSTEM = 0; //system flag off
Serial.write(Monitor_OFF, sizeof(Monitor_OFF)); //Write to TX pin
Serial.println();
}
if (digitalRead(button_Computer) == HIGH){
while(digitalRead(button_Computer) == HIGH){} //wait for button release before action
LED_Reset();
digitalWrite(led_Computer, HIGH);
SYSTEM = 1; //system flag on
Serial.write(Monitor_ON, sizeof(Monitor_ON)); //Write to TX pin
Serial.println();
Serial.write(Input_HMDI1, sizeof(Input_HMDI1)); //Write to TX pin
Serial.println();
}
if (digitalRead(button_Laptop) == HIGH){
while(digitalRead(button_Laptop) == HIGH){} //wait for button release before action
LED_Reset();
digitalWrite(led_Laptop, HIGH);
SYSTEM = 1; //system flag on
Serial.write(Monitor_ON, sizeof(Monitor_ON)); //Write to TX pin
Serial.println();
Serial.write(Input_HMDI2, sizeof(Input_HMDI2)); //Write to TX pin
Serial.println();
}
if(digitalRead(button_Vol_Up) == HIGH && SYSTEM == 1){
digitalWrite(led_Vol_Up, HIGH);
while(digitalRead(button_Vol_Up) == HIGH){} //wait for button release before action
digitalWrite(led_Vol_Up, LOW);
Serial.write(Volume_UP, sizeof(Volume_UP)); //Write to TX pin
Serial.println();
}
if(digitalRead(button_Vol_Down ) == HIGH && SYSTEM == 1){
digitalWrite(led_Vol_Down, HIGH);
while(digitalRead(button_Vol_Down) == HIGH){} //wait for button release before action
digitalWrite(led_Vol_Down, LOW);
Serial.write(Volume_DOWN, sizeof(Volume_DOWN)); //Write to TX pin
Serial.println();
}
}
REAL_RS232-Protocol-Document.pdf (175 KB)