Title: Wearable Tracking Device for Miners
By: sunnyiut
Previous Blogs | |
---|---|
01: Introduction | 02: The Kit |
03: Review_MSP432P401R | 04: Review_430BOOST-SHARP96 |
05: Review_BOOSTXL-SENSORS | 06: Review_DLP7970ABP |
07: Project proposal update |
Design Challenge: Safe and Sound Wearables
Blog number: 08
Intro:
This blog is based on MSP432P401r and 320x240 pixel TFT display interface.
Objective:
According to my project proposal I have to design a wearable device mounted on the wrist of the Miners.
This wearable device consists of several sensors to collect environmental information.
The MSP432P401r MCU will collect the data from the sensors and display on the TFT.
In this blog post, I'll focus on
- the interfacing of the TFT and the MSP432P401r MCU
- display some dummy data to mimic the final system
Compiler:
MikroC pro for ARM - from MikroElektronika
Firmware:
Full source code and circuit diagram can be found in LIBSTOCK.
Display module:
I am using a TFT display for my project instead of the provided SHARP96 LCD, because I need a bigger display which is visible at low light.
This TFT display module has following features -
- 320x240 display resolution
- ILI 9341 controller
- 262.000 colours
- Touch panel [not using for this project]
- Back-light
- 3.3V power supply voltage
It is interfaced with the MSP432P401r MCU via 8-bit parallel connection.
IM[3:0]----------INTERFACE MODE----------USED PINS
__________________________________________
0011 -----------8-BIT INTERFACE -----------DB[17:10]
// TFT module connections char TFT_DataPort at DIO_P7OUT; sbit TFT_RST at DIO_P9OUT.B2; sbit TFT_RS at DIO_P9OUT.B6; sbit TFT_CS at DIO_P9OUT.B7; sbit TFT_RD at DIO_P9OUT.B4; sbit TFT_WR at DIO_P9OUT.B5; sbit TFT_BLED at DIO_P9OUT.B3; char TFT_DataPort_Direction at DIO_P7DIR; sbit TFT_RST_Direction at DIO_P9DIR.B2; sbit TFT_RS_Direction at DIO_P9DIR.B6; sbit TFT_CS_Direction at DIO_P9DIR.B7; sbit TFT_RD_Direction at DIO_P9DIR.B4; sbit TFT_WR_Direction at DIO_P9DIR.B5; sbit TFT_BLED_Direction at DIO_P9DIR.B3; // End TFT module connections
dependencies -
- TFT librabry
- TFT_def library
resources -
// Resources const code char Nasalization_Rg22x23_Regular[]; const code char Tahoma19x19_Bold[]; const code char Tahoma11x13_Regular[]; const code char cover_screen_jpg[61813]; const code char screen1_jpg[50682];
CKT diagram:
Display Initialization:
// Display Initialize void DisplayInit() { //TFT_Init_ILI9341_8bit(320, 240); TFT_Init(320,240); TFT_BLED = 1; TFT_Fill_Screen(CL_BLACK); TFT_Set_Font(TFT_defaultFont, CL_WHITE, FO_HORIZONTAL); TFT_Set_Brush(1,CL_BLACK, 0, LEFT_TO_RIGHT, CL_BLACK, CL_BLACK ); } void InitialDisplay() { TFT_Fill_Screen(CL_BLACK); TFT_Set_Font(Nasalization_Rg22x23_Regular, CL_GREEN, FO_HORIZONTAL); TFT_Write_Text("TFT display demo", 40, 40); TFT_Write_Text("________________", 40, 60); TFT_Set_Font(TFT_defaultFont, CL_WHITE, FO_HORIZONTAL); TFT_Write_Text("safe&sound", 135, 210); TFT_Set_Font(Nasalization_Rg22x23_Regular, CL_WHITE, FO_HORIZONTAL); }
Safe&Sound cover screen:
Environmental Info screen with dummy data:
void cover_screen() { TFT_Image_Jpeg(0, 0, cover_screen_jpg); } void screen1() { TFT_Image_Jpeg(0, 0, screen1_jpg); } void demo_data() { IntToStr (light, text_temp); TFT_Write_Text(text_temp, 55, 45); TFT_Write_Text("LUX", 120, 45); IntToStr (ambient_tmp, text_temp); TFT_Write_Text(text_temp, 55, 130); TFT_Write_Text("'C", 115, 130); IntToStr (humidity, text_temp); TFT_Write_Text(text_temp, 170, 45); TFT_Write_Text("%", 220, 45); IntToStr (pressure, text_temp); TFT_Write_Text(text_temp, 140, 130); TFT_Write_Text("KPA", 190, 130); }
That's the end of this blogpost. In my next blog, I'll interface the Ambient Light sensor OPT3001 and display the output data on TFT.
Top Comments