Code Monkey home page Code Monkey logo

lpc11u35_st7032_lcd_example's Introduction

LPC11U35_ST7032_LCD_Example

I have introduced the LPC11U35 processor local development environment based on GNU ARM Embedded Toolchain in my LPC11U35 LED BLINK EXAMPLE repo. My eventual aim is to use this processor as a standalone data acquisition board that can be connected over USB and send data to any PC through a CDC device structure. In this repo, I show two things:

  • How to use the I2C port on the LPC11U35
  • How to drive a character LCD using the Sitronix ST7032 driver chip.

It looks like this:

This LCD driver is actually compatible with the popular HD44780 driver chip which has been around almost as long as myself (which is quite some time!)

This code uses the same simple libraries as my introductory repo, and thus it is extremely lightweight. The I2C interface is used in an interrupt setting, so the interrupt handler must be registered within the startup script startupARMCM0.S. This has already been done in this code, of course.

The code is simple to use. It provides the following functions:

  • void lcd_i2cInit (void); //Initialize I2C interface.
  • void lcd_init(void); //Initialize LCD registers.
  • void lcd_putchar (uint8_t character); //Write 1 character.
  • void lcd_writecmd (uint8_t command); //Write 1 command
  • void lcd_message (uint8_t * msgbuf); //Write a message.
  • void lcd_goto (uint8_t line, uint8_t posn); //Goto a position on LCD.

The user must include the file lcd_st7032.h in their code, and call the following functions to initialize the LCD:

  lcd_i2cInit();
  lcd_init();

During normal use, the following commands will be used such as:

  lcd_goto (0,2);
  lcd_message ("NXP LPC11U35");

The code first displays the greeting message as in the photo, then after 2 seconds, it displays the value of a number converted from int to ASCII.

"Share and Enjoy!"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.