Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 4 months ago.
Using uart LPC11U24
Hello
I need to test certain DigitalIn ports and than send a bitsequence of the state through the UART. I have problems with using the UART, the oscilloscope seems to print other values than that I want (garbage values?).
This is my code to test the UART.
#include "mbed.h" int main() { wait(1); const PinName tx = p9; const PinName rx = p10; const int baudrate = 9600; DigitalIn x = p36; Serial out(tx, rx); out.baud(baudrate); out.format(8, SerialBase::Even, 1); while(1) { wait(0.5); if (x == 1) out.putc(7); else out.putc(1); } }
This is what comes up my oscilloscope.
and it continues like that for couple more msecs.
Any idea what the fault may be? Tried printf and other serial classes aswell. When printing to putty via usb, it gives garbage values aswell.
Thanks