Pages

MSP430FG4618 device present a message on the LCD Basic

Summary: Using the MSP-EXP430FG4618 Development Tool and the MSP430FG4618 device present a message on the LCD Basic Timer1.


LCD message display

Introduction

This hands-on laboratory consists of configuring the LCD_A controller of the MSP430FG4618 device of the Experimenter’s board to display a message on the LCD display. This laboratory has been developed for Code Composer Essentials version 3 software development tool only.

Overview

This laboratory will explore the LCD_A controller of the MSP430FG4618 device included on the Experimenter’s board. This application ( Lab1_LCD.c) demonstrates the activation of various LCD segments.

Resources

The Experimenter’s board uses a LCD, which does not have its own controller. The operation is controlled by MSP430FG4618.
The interface between these two components is described in the Experimenter’s Board datasheet slau213a.pdf
It is also recommended that the LCD datasheet be read.
Based on this information, it is possible to define the values to write to each of the memory registers to turn on the desired segments, or to set several of them, as is the case with numbers. The definitions are listed in LCD_defs.h.
From analysis of the Experimenter’s Board schematics, it can be seen that there is a 10 µF between the LCDCAP pin and ground, which means it is possible to use the charge pump.
The segments shared by the I/O function are not used by the LCD, being connected to the segments S4 to S25. The four lines COM0, COM1, COM2, and COM3 are used. The last three lines are shared by ports P5.2, P5.3 and P5.4, respectively. The LCD is operated in 4-mux mode.
The pins R03, R13, R23 and LCDCAP\R33 are used to provide the V5, V4, V3, V2 and V1 (VLCD) voltages, using an external resistor network. They are available at Header H5.
In the current Experimenter’s Board configuration, it is possible to select the AVss or charge pump to provide the V1 (VLCD), V2, V3, V4 and V5 voltages. These voltages are only generated when LCD_A module and the ACLK clock are active. This allows the use of low power mode 3 (LPM3).
Timer_A, together with the TACCR0 unit are used to generate an interrupt once every second. LED1 and LED2 are switched at each Timer_A interrupt.
The push button SW1 is used to change the value of voltage generated by the charge pump. The push button SW2 is used to change the LCD frequency.

Software application organization

The application starts by configuring the Ports P5.2, P5.3, P5.4 to special function COM1, COM2 and COM3, respectively. The function of COM0 is not shared with the digital I/O functions.
Then, the pins with multiplexed functions are selected to perform the functions necessary to control the LCD segments.
The LCD_A control register and the voltage configuration register are also configured.
There then follows the execution of the LCD clear routine LCD_all_off(), which ensures that all segments of the LCD are off.
Timer_A is configured with its TACCRO unit to generate an interrupt once every second. The ISR generates the memory clock with msec, sec and min, and also connects/disconnects the remaining LCD symbols.
The port pins P2.1 and P2.2 drive LED2 and LED1, respectively. Hence, these ports are configured as digital outputs.
Push buttons SW1 and SW2 have the capacity to generate an interrupt through a change at ports P1.0 and P1.2 respectively. The interrupt ISR, after decoding its source, modifies the LCD operation frequency or modifies the VLCD voltage.
Finally, all the interrupts are activated and the system enters low power mode LPM3.

System configuration

LCD_A interface with the LCD configuration

Select the function COM1, COM2 and COM3. What is the value to write to these registers?
P5DIR |= 0x1E; // Ports P5.2, P5.3 and P5.4 as outputs
P5SEL |= 0x1E; // Ports P5.2, P5.3 and P5.4 as special function (COM1, COM2 and COM3)
    
The LCD segments are controlled by the S4 to S25 LCD memory segments. Activate these segments by writing to correct value to the following register:
LCDAPCTL0 = LCDAPCTL0 = LCDS24 | LCDS20 | LCDS16 | LCDS12 | LCDS8 | LCDS4; // Enable S4 to S25
    

LCD operation frequency

The LCD is to operate in 4-mux mode, with a 30 Hz to 100 Hz refresh frequency. It uses the following equation to determine the LCD operation frequency, fLCD:
fLCD = 2 x mux x fframe
Choose the frequency that provides greatest energy savings.

LCD_A configuration

The LCD_A module is to be activated in 4-mux mode from a 32768 Hz clock. What value should be written to the following register?
LCDACTL = LCDFREQ_192 | LCD4MUX; // (ACLK = 32768)/192
    // and 4-mux LCD
LCDACTL |= LCDSON | LCDON; // LCD_A and Segments on
    
Use the charge pump to internally generate all the voltages necessary for the operation of the LCD, using a bias 1/3. What is the value to write to the register?
LCDAVCTL0 = LCDCPEN; // Charge pump enable
The charge pump generates a LCD voltage of 3.44 volts. Configure the following register:
LCDAVCTL1 = VLCD_3_44; // VLCD = 3.44 V

Timer_A configuration

The Timer_A generates an interrupt once every second. It uses the TACCR0 unit. Configure the following registers:
TACCTL0 = CCIE; // TACCR0 interrupt enabled
TACCR0 = 3268; // this count correspond to 1 msec
TACTL = TASSEL_1 | MC_1 | ID_0; // ACLK, up mode
    

Output ports configuration

Configure the ports connected to LED1 and LED2 in order to make one of them active and the other inactive at system start up:
P2DIR |= 0x06; // P2.1 and P2.2 as output
P2OUT |= 0x04; // LED2 off and LED1 on
    

Input ports configuration

The push buttons SW1 and SW2 generate an interrupt on a low-to-high transition. Configure the necessary registers:
P1DIR &= ~0x03; // P1.0 and P1.1 digital inputs
P1IES |= 0x03; // low-to-high transition interrupts
P1IE |= 0x03; // enable port interrupts
    

Analysis of operation

Compile the project, load it into microcontroller’s memory and execute the application. For each value of the operating frequency and voltage generated by the charge pump, measure the electrical current consumption. Draw a graph of these results and draw conclusions concerning the energy consumption.
This example and many others are available on the MSP430 Teaching ROM.
Request this ROM, and our other Teaching Materials here https://www-a.ti.com/apps/dspuniv/teaching_rom_request.asp

0 comments:

Post a Comment

Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.