E45_TTL_100, Lora transceiver, tested on KL25Z connection with E45 via RS232. Power 100 mW, 868 MHz, range 2 km

Dependencies:   MODSERIAL mbed

Files at this revision

API Documentation at this revision

Comitter:
GerritPathuis
Date:
Sat Feb 17 10:10:11 2018 +0000
Parent:
1:2b8fa0144c4f
Child:
3:19a244789b2b
Commit message:
Works

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Feb 17 09:44:56 2018 +0000
+++ b/main.cpp	Sat Feb 17 10:10:11 2018 +0000
@@ -8,10 +8,12 @@
 // RXD--------------------PTE22(TX)
 // TXD--------------------PTE23(RX)
 // LORA Radio Transmits @ 868 mHz
+// Expected range 2000m
+// https://quadmeup.com/wp-content/uploads/2017/09/E45-TTL-100_Datasheet_EN_v1.2.pdf
 
 Ticker timer;
-MODSERIAL pc(USBTX, USBRX, 512);    // tx, rx of the pc
-MODSERIAL e45(PTE22, PTE23, 512);   // tx, rx of the E45 radio
+MODSERIAL pc(USBTX, USBRX, 512);    // tx, rx of the pc, (512 char buffer)
+MODSERIAL e45(PTE22, PTE23, 512);   // tx, rx of the E45 radio (512 char buffer)
 InterruptIn aux(PTD4);              // AUX the E45 radio
 DigitalOut m1(PTA12,PullUp);        // M1 the E45 radio
 DigitalOut m0(PTA4, PullUp);        // M0 the E45 radio
@@ -30,7 +32,6 @@
 
 void timer_func()        // Send something every 3s
 {
-    //pc.puts("Try to send\n\r");
     if (myled == 1)  {   // AUX is high (Buffer empty), send something
         wait_ms(3);
         e45.puts("123");
@@ -38,7 +39,7 @@
             pc.puts("Wait for end Transmission\n\r");
             wait_ms(1);
         }
-        pc.puts("Radio has sent 123\n\r");
+        pc.puts("\n\rRadio has sent 123\n\r");
     }
 }
 
@@ -47,26 +48,27 @@
 {
     pc.baud(115200);
     e45.baud(9600);
-    pc.puts("\n\r\nE45-TTL-100 LORA test \n\r");
+    pc.puts("\n\r\nE45-TTL-100 LORA\n\r");
 
     aux.rise(&flank_up);       //Service RISING EDGE Interrupt
     aux.fall(&flank_down);     //Service FALLING EDGE Interrupt
 
-    // set mode, Transmission open
+    // select mode
+    // Transparant Transmission
     m0= 0;
     m1= 0;
+    wait_ms(1);
 
     // wait for E45 to be ready
     while(myled==0) {
         pc.puts("Wait for E45 reset\n\r");
-        wait_ms(1);
+        wait_ms(20);
     }
     wait_ms(2);
     timer.attach(&timer_func, 3.0);
     pc.puts("E45 is now ready to send and receive \n\r");
 
     while(1) {
-        // indicate status aux
         if (myled == 0)  {   // AUX is low, Chars received
             wait_ms(3);
             while(myled==0) {