Hi -
I'm trying to send commands from a Teensy 4.1 to a RS232 light controller and it's not working.
The light controller serial settings are: 115200baud, no parity, 8 data bits and 1 stop bit. The chip inside the controller used for serial communications is a Max3221 (Datasheet here)
The wiring is as follow:
RS232 DEVICE:
Pin 5 = GND connected to Teensy Ground
Pin 2 = TX connected to Teensy pin 7 (RX2)
Pin 3 = RX connected to Teensy pin 8 (TX2)
For testing I installed 2 push buttons on a breadboard with the Teensy and used the code below to send these commands:
Button 1 command: RT1,0.1μS,0.500,700;
Button 2 command: RT1,0.1μS,0.500,0;
I tried using Serial.print, Serial.println etc but the controller doesn't respond.
If I connect a USB to Serial Adapter Cable from the controller to my PC and use the Arduino Serial monitor, I can successfully send the commands to the controller.
Thanks for looking at this.
I'm trying to send commands from a Teensy 4.1 to a RS232 light controller and it's not working.
The light controller serial settings are: 115200baud, no parity, 8 data bits and 1 stop bit. The chip inside the controller used for serial communications is a Max3221 (Datasheet here)
The wiring is as follow:
RS232 DEVICE:
Pin 5 = GND connected to Teensy Ground
Pin 2 = TX connected to Teensy pin 7 (RX2)
Pin 3 = RX connected to Teensy pin 8 (TX2)
For testing I installed 2 push buttons on a breadboard with the Teensy and used the code below to send these commands:
Button 1 command: RT1,0.1μS,0.500,700;
Button 2 command: RT1,0.1μS,0.500,0;
Code:
#include <ezButton.h>
ezButton button1(2); // create ezButton object that attach to pin
ezButton button2(3); // create ezButton object that attach to pin
void setup() {
Serial2.begin(115200);
button1.setDebounceTime(50); // set debounce time to 50 milliseconds
button2.setDebounceTime(50); // set debounce time to 50 milliseconds
}
void loop() {
button1.loop(); // MUST call the loop() function first
button2.loop(); // MUST call the loop() function first
if(button1.isReleased())
Serial2.write("RT1,0.1μS,0.500,700;\r\n");
if(button2.isReleased())
Serial2.write("RT1,0.1μS,0.500,0;\r\n");
}
I tried using Serial.print, Serial.println etc but the controller doesn't respond.
If I connect a USB to Serial Adapter Cable from the controller to my PC and use the Arduino Serial monitor, I can successfully send the commands to the controller.
Thanks for looking at this.