PV198 - LCD One-chip Controllers Daniel Dlhopolček, Marek Vrbka, Jan Koniarik, Oldřich Pecák, Tomáš Rohlínek, Ján Labuda, Jan Horáček, Matúš Škvarla, Ondřej Bleha, Martin Klimeš, Adam Valt Faculty of Informatics, Masaryk University 11/2024 Introduction Intro Switch the branch to Week_11! Discussion of HW9 ·PV198 - LCD ·11/2024 2 / 12 LCD LCD LCD = Liquid Crystal Display Usage Printers Routers Industrial equipment Consumer equipment – washing machines, ... ... ·PV198 - LCD ·11/2024 3 / 12 LCD 1602A LCD 1602A Display for 16×2 characters HD44780U Display Controller – datasheet Basic connection: DB4–DB7 (4-bit parallel transfer) RS — Register Select R/W – Read/Write select E – Starts data read/write ·PV198 - LCD ·11/2024 4 / 12 LCD 1602A Message ·PV198 - LCD ·11/2024 5 / 12 LCD 1602A FRDM-K66F – LCD 1602A Connection FRDM-K66F LCD 1602A GND GND 1 VSS P5V_USB 5V 2 VDD DAC0_OUT DAC0_OUT 3 V0 PTA27 LCD_RS 4 RS PTA26 LCD_RW 5 R/W PTA4 LCD_E 6 E PTA6 LCD_DB4 11 DB4 PTA7 LCD_DB5 12 DB5 PTA8 LCD_DB6 13 DB6 PTA9 LCD_DB7 14 DB7 Digital-to-Analog-Converter (DAC) is used to control LCD contrast. Use pins A (anode – connect to 3V3) & K (cathode – connect to GND) to drive backlight. ·PV198 - LCD ·11/2024 6 / 12 Driver Driver Support for 4bit communication initialization SysTick timer used for delays Basic command and data transfer functions Does not read busy flag – uses delays instead ·PV198 - LCD ·11/2024 7 / 12 Driver Driver Pins The LCD driver requires to define the following identifiers in the Pins tool for GPIO output pins: LCD_RS, LCD_RW, LCD_E, LCD_DB4, LCD_DB5, LCD_DB6, LCD_DB7. ·PV198 - LCD ·11/2024 8 / 12 Driver Driver Interface void LCD_4BitsInit(uint32_t systick_clk_freq, bool cursor_on, bool cursor_blinking) void LCD_Clear() void LCD_Home() void LCD_SetPosition(uint8_t x, uint8_t y) void LCD_PutChar(uint8_t character) void LCD_Print(char s[]) void LCD_SendCommand(uint8_t command) void LCD_SendData(uint8_t data, MessageType_t messageType) ·PV198 - LCD ·11/2024 9 / 12 Seminar task Template Real date and time display demo Download from study materials Content: LCD driver initialization RTC peripheral initialization while loop: obtain current date & time, print on display ·PV198 - LCD ·11/2024 10 / 12 Seminar task Seminar task Implement a function LCD_SendData according to the message format picture. void LCD_SendData(uint8_t data, MessageType_t messageType) Bonus: display floating text on the display. ·PV198 - LCD ·11/2024 11 / 12 Homework Homework Generate something else on the LCD string (be creative). Tests check for initialization and if there is something on the screen. Avoid adding drivers, they will break the project. ·PV198 - LCD ·11/2024 12 / 12