<< Chapter < Page Chapter >> Page >
Using the MSP-EXP430FG4618 Development Tool and the MSP430FG4618 device present a message on the LCD Basic Timer1.

Laboratory lcd controller: lab1 - lcd message display


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.


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.


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 (V LCD ) 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 AV ss or charge pump to provide the V1 (V LCD ), 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, f LCD :

f LCD = 2 x mux x f frame

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 LCDLCDACTL |= 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 msecTACTL = 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 interruptsP1IE |= 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 (External Link)

Questions & Answers

Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
Jyoti Reply
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
yes that's correct
I think
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
how nano science is used for hydrophobicity
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
what is differents between GO and RGO?
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
analytical skills graphene is prepared to kill any type viruses .
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials. OpenStax CNX. May 19, 2009 Download for free at http://cnx.org/content/col10706/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials' conversation and receive update notifications?