The MCR20A Wireless UART application functions as an wireless UART bridge between two (one-to-one) or several (one to many) boards. The application can be used with both a TERM, or with software that is capable of opening a serial port and writing to or reading from it. The characters sent or received are not necessarily ASCII printable characters.

Dependencies:   fsl_phy_mcr20a fsl_smac mbed-rtos mbed

Fork of mcr20_wireless_uart by Freescale

By default, the application uses broadcast addresses for OTA communication. This way, the application can be directly downloaded and run without any user intervention. The following use case assumes no changes have been done to the project.

  • Two (or more) MCR20A platforms (plugged into the FRDM-K64F Freescale Freedom Development platform) have to be connected to the PC using the mini/micro-USB cables.
  • The code must be downloaded on the platforms via CMSIS-DAP (or other means).
  • After that, two or more TERM applications must be opened, and the serial ports must be configured with the same baud rate as the one in the project (default baud rate is 115200). Other necessary serial configurations are 8 bit, no parity, and 1 stop bit.
  • To start the setup, each platform must be reset, and one of the (user) push buttons found on the MCR20A platform must be pressed. The user can press any of the non-reset buttons on the FRDM-K64F Freescale Freedom Development platform as well. *This initiates the state machine of the application so user can start.

Documentation

SMAC Demo Applications User Guide

Committer:
cotigac
Date:
Fri Apr 03 05:23:33 2015 +0000
Revision:
18:b02fc0e53df8
Parent:
17:52cfd7db8da3
Child:
19:71b793021c78
Started creating wireless uart demo based on mbed-rtos

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 0:01fb291427ce 1 #include "mbed.h"
cotigac 18:b02fc0e53df8 2 #include "rtos.h"
sam_grove 2:3e7685cfb2a7 3
cotigac 18:b02fc0e53df8 4 DigitalOut led1(LED1);
cotigac 18:b02fc0e53df8 5 InterruptIn sw2(SW2);
cotigac 18:b02fc0e53df8 6 uint32_t button_pressed;
cotigac 18:b02fc0e53df8 7 Thread *thread2;
sam_grove 2:3e7685cfb2a7 8
cotigac 18:b02fc0e53df8 9 void sw2_press(void)
cotigac 18:b02fc0e53df8 10 {
cotigac 18:b02fc0e53df8 11 thread2->signal_set(0x1);
cotigac 18:b02fc0e53df8 12 }
sam_grove 2:3e7685cfb2a7 13
cotigac 18:b02fc0e53df8 14 void led_thread(void const *argument)
cotigac 18:b02fc0e53df8 15 {
cotigac 18:b02fc0e53df8 16 while (true) {
cotigac 18:b02fc0e53df8 17 led1 = !led1;
cotigac 18:b02fc0e53df8 18 Thread::wait(1000);
sam_grove 2:3e7685cfb2a7 19 }
sam_grove 2:3e7685cfb2a7 20 }
sam_grove 2:3e7685cfb2a7 21
cotigac 18:b02fc0e53df8 22 void button_thread(void const *argument)
sam_grove 2:3e7685cfb2a7 23 {
cotigac 18:b02fc0e53df8 24 while (true) {
cotigac 18:b02fc0e53df8 25 Thread::signal_wait(0x1);
cotigac 18:b02fc0e53df8 26 button_pressed++;
cotigac 18:b02fc0e53df8 27 }
sam_grove 2:3e7685cfb2a7 28 }
sam_grove 2:3e7685cfb2a7 29
sam_grove 2:3e7685cfb2a7 30 int main()
sam_grove 2:3e7685cfb2a7 31 {
cotigac 18:b02fc0e53df8 32 Thread thread(led_thread);
cotigac 18:b02fc0e53df8 33 thread2 = new Thread(button_thread);
sam_grove 2:3e7685cfb2a7 34
cotigac 18:b02fc0e53df8 35 button_pressed = 0;
cotigac 18:b02fc0e53df8 36 sw2.fall(&sw2_press);
cotigac 18:b02fc0e53df8 37 while (true) {
cotigac 18:b02fc0e53df8 38 Thread::wait(5000);
cotigac 18:b02fc0e53df8 39 printf("SW2 was pressed (last 5 seconds): %d \r\n", button_pressed);
cotigac 18:b02fc0e53df8 40 fflush(stdout);
cotigac 18:b02fc0e53df8 41 button_pressed = 0;
sam_grove 2:3e7685cfb2a7 42 }
sam_grove 2:3e7685cfb2a7 43 }