RS485 testing on the Anthem PCB

Dependencies:   mbed

Fork of Serial_HelloWorld_Mbed by mbed official

Files at this revision

API Documentation at this revision

Comitter:
bgrissom
Date:
Thu Aug 21 18:19:13 2014 +0000
Parent:
0:879aa9d0247b
Commit message:
This program successfully works for communicating to the Anthem PCB via the Sparkfun RS485 converter with a terminal program at 9600 Baud.

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 879aa9d0247b -r 7a5b1550838c main.cpp
--- a/main.cpp	Tue Feb 12 17:39:05 2013 +0000
+++ b/main.cpp	Thu Aug 21 18:19:13 2014 +0000
@@ -1,10 +1,35 @@
 #include "mbed.h"
+
+// 2014.08.21 
+// Brad Grissom
+// This program successfully works for communicating to the Anthem PCB
+// via the Sparkfun RS485 converter with a terminal program at 9600 Baud.
+
  
-Serial pc(USBTX, USBRX); // tx, rx
+ 
+Serial pc(PB_6, PB_7); // tx, rx
+DigitalOut LeftTX_EN(PA_12);
  
 int main() {
-    pc.printf("Hello World!\n");
+    int get = 0;
+    LeftTX_EN = 1;
+    // ORIG:  pc.baud(9600);
+    // The clock on the Anthem board is running faster than the Nucleo,
+    // so one hack is to slow down our baud rate.  This runs at 9600 baud
+    // on the scope.
+    pc.baud(6400);
+    
     while(1) {
-        pc.putc(pc.getc() + 1);
+        // pc.printf("U");    
+        // wait_ms(10);
+        
+        LeftTX_EN = 0;
+        wait_ms(1);
+        get = pc.getc(); //+ 1;
+        
+        LeftTX_EN = 1;
+        wait_ms(1);
+        pc.putc(get);
+        wait_ms(2);
     }
 }
\ No newline at end of file
diff -r 879aa9d0247b -r 7a5b1550838c mbed.bld
--- a/mbed.bld	Tue Feb 12 17:39:05 2013 +0000
+++ b/mbed.bld	Thu Aug 21 18:19:13 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/0954ebd79f59
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file