Hi,
I connect the serial module (rS232) to a stand alone keyboard emulator that connected to another computer.
I try to write to the computer by the serial:
rS232.Initialize();
if (rS232.serialPort.IsOpen)
{
rS232.serialPort.Write("A");
rS232.serialPort.Write("sentence");
}
but it don’t write anything.
I try to write with byte like this:
I dont think you can communicate directly with a pc as the signal is inverted. Someone else will give you some more accurate information but there is a way to flip the signal using a Max232 chip.
Wish I could be more helpful but I hit this problem a while back and cant remember all the details :o(
So you have a RS232 module, that goes to what? A Keyboard emulator? What kind of connection does it have, and where are it’s specs. As @ bodward is hinting at, some devices need TTL level signals to communicate, others need RS232; they won’t play nice if you have an RS232 sender connected to something that expects TTL.
What mainboard are you using?
If you’re getting characters that don’t resemble what you sent, then the #1 culprit is baud rate. You need to select a different rate. You need to match the rate that the receiving device expects.
The #1 culprit is UART Dyslexia. Make sure you understand RX and TX are probably meant to be plugged into each other.
The way I would first try to deal with this issue though is to make sure you can receive what you send. Write a program that both sends and receives through your RS232 module. Then, connect the RX and TX together - now everything you send should be echoed into your receive.
the RS232 module is connected to ‘stand alone’ keyboard emulator which have a serial port (it’s because I need to use KBE at BIOS and now the USB DP client doesn’t work as KBE when OS is not up)
I’m using a FEZ spider as mainboard.
What I need is a KBE when OS is not up, and I’m trying to do it with serial (RS232) and stand alone KBE, if you know about another ways to implement it i’ll be happy to know how.
BTW - could you please give more explation about TTL?
(Does TTL come to replace the KBE or as additional equipment to connect the KBE to the serial module?)
Hi Judith,
I think it is necessary to know what kind of „keyboard emulator you use. Brand? Type? Interfaces? A keyboard with serial interface does not send the hex-codes of the (for example ASCII characters). It sends Scan Codes, these Scan codes tell the PC when a key was hit and another Scan code, when a key is released. The PC then looks in a table for the hex code of the ASCII characters. May be, that you must send the scan-codes to your keyboard emulator.
Besides this you must have the correct baud-rate and the other settings of the serial port as Brett already mentioned.
TTL means Tranistor-transistor-logic, it is only that logic-high = 5 V, logic-low = 0V. A RS232 Interface uses positive and negative voltages as logic-levels for example +12 V and -12V.
Roland
If so then it accepts Ascii codes so you should be ok sending Ascii codes to the device. Baud rate by default is 9600 but can be changed via switches. See the link above :o)
I hope that helps :o)
Edit: Also check your stop bits and parity are correct
The USB-335 uses the following RS-232 format: 1 start bit, 1 stop bit, 8 data bits, and no parity
the issue indeed was with the Baud rate
I changed the rate to 9600 and now it’s working
(the default rate in gadgeteer is 38400, so need to defined it explicitly)