I'm trying to use mbed to control a piece of equipment. As a test, I hooked up p28 and p27 of mbed (Serial Tx/Rx respectively) to the usb port of a computer through an RS232/usb adapter. On the mbed, I had the talk-back code running
#include "mbed.h"
Serial pc(p28,p27); // tx, rx
int main() {
pc.printf("Hello");
while(1) {
pc.putc(pc.getc());
}
}
I then connected to mbed using the serial cable (not USB), reset the mbed and received the following response instead of "Hello"
or in binary
10101011 00111010 00111010 00001010 00000010
Clearly, the code doesn't work. I then tested it with another program
#include "mbed.h"
Serial device(p28, p27); // tx, rx
int main() {
while (1) {
device.putc('8');
wait(0.2);
}
}
By changing from '8' to various letters, I see that the signal as read by RS232 port monitoring program doesn't agree with the input of the program. Here're some of the examples (in binary form)
Input...Output
- 01100001...01001111
- 01100010...00100111
- 00111000...00001100
Connecting mbed directly to an actual com port of a linux box (not using the adapter anymore) results in the same wrong outputs.
Any ideas on this issue?
Any help would be greatly appreciated. I've been staring at these confusing outputs for a while now.
I'm trying to use mbed to control a piece of equipment. As a test, I hooked up p28 and p27 of mbed (Serial Tx/Rx respectively) to the usb port of a computer through an RS232/usb adapter. On the mbed, I had the talk-back code running
I then connected to mbed using the serial cable (not USB), reset the mbed and received the following response instead of "Hello"
or in binary
Clearly, the code doesn't work. I then tested it with another program
By changing from '8' to various letters, I see that the signal as read by RS232 port monitoring program doesn't agree with the input of the program. Here're some of the examples (in binary form)
Input...Output
Connecting mbed directly to an actual com port of a linux box (not using the adapter anymore) results in the same wrong outputs.
Any ideas on this issue?
Any help would be greatly appreciated. I've been staring at these confusing outputs for a while now.