About this demo
This demo was created to give you a headstart for a UART - based GPRS module. The goal was to build the project on top of FreeRTOS ensuring a good implementation for task management and adaptability for any other project based on AT commands using a UART module.
According to the documentation of the module, the SIM800L from SIMCOM is controlled via AT commands. The advantage of using these commands is that, by tweaking some of the tasks, the application can be used for any other AT command based module.
In this demo I'm going to walk you through the key elements that were used and give you a functional project that has the addition of working on a FreeRTOS environment. This offers great reliability for a fully working application that won't hang for an untested reason. Exploring this project should give you a good idea of how semaphores are implemented for various tasks management depending on each priority.
Project Scope
Useful Links
Link | Description |
https://mcuxpresso.nxp.com/en/builder | SDK Builder for the Kinetis K64 |
https://www.simcom.com/product/SIM800.html | SIMCOM SIM800 site documentation |
https://www.freertos.org/xSemaphoreCreateBinary.html | FreeRTOS |
Required Items
Link | Description |
https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-developm... | NXP's FRDMK64 Board |
https://simcom.ee/modules/gsm-gprs/sim800/ | SIMCOM SIM800 GPRS Module |
Buck converter | |
Power supply to deliver up to 4.3 V and 2 Amps | |
Cellular antenna |
Hardware Diagram
SIM 800L ===> FRDM K64
VCC ===> 3V9 Buck Converter
RX ===> TX (PTC17/J1-4)
TX ===> RX (PTC16/J1-2)
GND ===> GND
Step-by-Step Guide for testing the Demo
Attachments are found at the bottom of this document.
Additional Demo Information
These next steps are intended to guide the developer to an easier understanding of the modifications that were made from the base project.
This additional information intends to give you a greater understanding of how the project was built and a further explanation of the different topics this application needs for its implementation.
The usage of FreeRTOS wasn't mandatory, but the usage of an operative system gives the application an additional layer of reliability for safe deployment. In addition to the actual tasks, you could implement a new task for an OTA update for new drivers, a fully functional response parser, or any other addition depending on your project needs. The usage of a task-based project ensures flexibility of the project since many modifications will not require a complete rebuilding of the application. As mentioned before, the implementation of semaphores will provide reliable task management depending on the required function.
The project started from the freertos_uart example and from there three additional tasks were built: a connect task, send task, and a check task. Here is a brief explanation of each task to provide a full understanding of the functionality.
A point that is worth mentioning is that the module works in a 2G bandwidth. This can be a problem in some countries due to the SIM card version incompatibility between your area network and the module. If this is the case in your country, I strongly recommend looking for a 4G module like the SIM7080 or any other NB-IoT module. This might be more expensive but you are ensuring your project will work on top of the newest cellular bands.