Character LCD Demo 2 lines

<< Click to Display Table of Contents >>

Navigation:  STM32F4 Target > Demos > Hardware Modules Demos > Character LCD >

Character LCD Demo 2 lines

Previous pageReturn to chapter overviewNext page

demo File: clcd_demo.mdl

amg_clcd_demo_model

Description

From above demo model, LCD line1 will display sample time index. LCD line2 will display analog reading value (0-3.3V).

Software Setup

1. "Target Setup" block, this block is needed for STM32F4 target. Select the right MCU part, compiler, automatic compile & download and more. This demo use sample time is 1ms.

2. "Character LCD Setup" block. This block located in LCD Setup subsystem, for configure MCU pin to control LCD display.

amg_clcd_demo2_mask

3. "Volatile Data Storage" and "Volatile Data Storage1" blocks are configured as string buffer, storing string/ message for LCD line2 and line1 respectively.

3. "Character LCD Write" block use for write LCD line with string/ message from buffer (Volatile  Data storage1).

4. "Character LCD Write1" block use for write LCD line with string/ message from "Volatile Data Storage" block.

5. "printf2" block, generate formatted string: Index: %u and store into "Volatile Data Storage1" block. %u will be replaced with unsigned int32 value from counter free running block.

6. "printf" block, generate formatted string: Value: %1.3f V and store into "Volatile Data Storage" block. %1.3f will replaced with single value from ADC module.

Hardware Setup

Follow Hardware connection between character LCD and target board.

Testing

Build this demo model into target board (STM32F4 board).

1. Update model, by click "Update diagram" on tool bar or press Cntrl + D keys to update the sample time of blocks. You may need to update diagram two times to make sample time showing correctly.

2. Build model into target board. By click icon "Incremental build" on toolbar or press Cntrl + B then wait until Auto compile & Download finish.

amg_clcd_demo_hw2