Simon Ford / Mbed 2 deprecated serial_framing

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simon
Date:
Thu Oct 14 09:22:08 2010 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 839d381fd33b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 14 09:22:08 2010 +0000
@@ -0,0 +1,25 @@
+// See when the rx UART looses framing based on baudrate shmoo, sford
+// connect p13 to p10
+
+#include "mbed.h"
+
+Serial device(p13, NC);
+Serial m(NC, p10);
+
+int main() {
+    m.baud(4800);
+    m.format(8, Serial::Even, 1);
+    device.format(8, Serial::Even, 1);
+
+    for(int baud_rate=4800; baud_rate>=4000; baud_rate -= 25) {
+        device.baud(baud_rate);
+        device.printf("Hello world! How are you today! Hello world! How are you today!\n");
+
+        wait(0.05);
+
+        int frame_error = (LPC_UART3->LSR >> 3) & 1;
+        m.getc();  
+
+        printf("baud_rate: %d, frame_error: %d\n", baud_rate, frame_error);
+    }
+}
diff -r 000000000000 -r 839d381fd33b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 14 09:22:08 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e