This program just echos back characters from the PC Console Interface. It does no further testing outside the M3 processor.

Dependencies:   C027-REVB mbed

Files at this revision

API Documentation at this revision

Comitter:
dixter1
Date:
Sat Dec 14 01:22:44 2013 +0000
Commit message:
First pass this program. Simple serial echo.

Changed in this revision

C027-REVB.lib Show annotated file Show diff for this revision Revisions of this file
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 cd857d770d29 C027-REVB.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C027-REVB.lib	Sat Dec 14 01:22:44 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dixter1/code/C027-REVB/#2ae219d82c0e
diff -r 000000000000 -r cd857d770d29 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Dec 14 01:22:44 2013 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "C027.h"
+
+DigitalOut mdm_activity(LED);
+
+int main() 
+{
+    int led_toggle_count = 5;
+
+    C027 c027;
+    c027.mdmPower(true,false);
+    
+#if 0
+    while(1) {
+        mdm_activity = !mdm_activity;
+        wait(0.2);
+    }
+#else
+    while( led_toggle_count-- > 0 )
+    {
+        mdm_activity = !mdm_activity;
+        wait(0.2);
+    }
+#endif
+
+    // open the mdm serial port
+    Serial mdm(MDMTXD, MDMRXD);
+    mdm.baud(MDMBAUD);
+    // tell the modem that we can always receive data
+    DigitalOut mdmRts(MDMRTS);
+    mdmRts = 0; // (not using flow control)
+    
+    // open the PC serial port and (use the same baudrate)
+    Serial pc(USBTX, USBRX);
+    pc.baud(MDMBAUD);
+    
+    while (1)
+    {
+        // transfer data from pc to modem
+        if (pc.readable() && pc.writeable())
+            pc.putc(pc.getc());
+    }
+}
diff -r 000000000000 -r cd857d770d29 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Dec 14 01:22:44 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file