I am trying to use an arduino to send AT and ST commands to an STN1100, which utilizes a 3 pin UART connection. I am not a professional at communication protocols so I was hoping someone could verify how exactly to set up communication with this device, given the STN's UART settings.
If I understand correctly, the Arduino uno uses pins 0 and 1 as the RX and TX for serial communication. The STN1100 requires that the UART settings are configured as follows:
38400 baud
8 data bits
No parity bit
One stop bit
No handshaking
I understand how to set the baud rate to 38400 via the Serial.begin() function, but what about the other settings? Do I configure the arduino to transmit 8 data bit packets with one stop bit and no parity using some sort of configuration functions, or do I have to somehow structure my code such that the data I write follows these settings?
Basically, my question is how do I configure all of the UART settings when using the Arduino Serial to communicate with another device. From here I wish to send AT commands such as AT, ATD, ATFE, etc.
Basically, my question is how do I configure all of the UART settings when using the Arduino Serial to communicate with another device.
If the device uses 8N1, which is pretty standard, you don't need to do anything more than set the baud rate. If is uses something else, there is an optional second argument to the begin() method that defines the other values, using named constants.
the serial monitor does not offer the option to display at 38400 baud. How can I make this possible?
You can't. 38400 is a MIDI baud rate. It is not a standard serial baud rate. You don't need to use the same baud rate to talk to the device as to talk to the PC, because you shouldn't be trying to use the same serial port to talk to both of them.
Connect the device to another set of pins, and use SoftwareSerial to talk to it, and use the Serial instance to talk to the PC.