Hello world for lpclcd module https://strawberry-linux.com/catalog/items?code=12014

Dependencies:   I2cLCD mbed

Program "lpclcd" sample via USB Bootloader using offline uVision toolchain(MDK)

NXP USB Bootloader needs checksum. if you use MDK, needs extra command to create checksum before create .bin file.

You must add project option's "Run User Program After build" section,

 $K\ARM\BIN\ELFDWT.EXE !L

/media/uploads/mio/calcchecksum.png

see http://www.keil.com/support/docs/3592.htm and http://www.keil.com/support/man/docs/uv4/uv4_ut_elfdwt.htm

If you create .bin on mbed online compiler, or program via JTAG(SWD), this process(option) is not needed.

Files at this revision

API Documentation at this revision

Comitter:
mio
Date:
Sun Jun 09 11:02:11 2013 +0000
Commit message:
hello world for lpclcd

Changed in this revision

I2cLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/I2cLCD.lib	Sun Jun 09 11:02:11 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/KatsushiOgawa/code/I2cLCD/#8a9ac3d4afdf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jun 09 11:02:11 2013 +0000
@@ -0,0 +1,50 @@
+//
+// for strawberry-linux.com's "lpclcd" 11U24 Board
+// https://strawberry-linux.com/catalog/items?code=12014
+//
+#include "mbed.h"
+#include "I2cLCD.h"
+
+// SW,LED,PULLUP
+// P0_1  : USER SW (ISP)
+// P0_6  : LED
+// P0_23 : I2C PULLUP
+
+//
+// I2C LCD SlaveAddress = 0x7c 
+//  SlaveAddress , commands and the initialize sequence are almost 
+//  same as "i2c low voltage lcd module" by strawberry-linux. 
+//  (http://strawberry-linux.com/catalog/items?code=27001)
+//
+//  So I2cLCD library seems to work well.
+//
+// P0_25 : RESET
+// P0_4  : SCL
+// P0_5  : SDA
+// P1_3  : LCD BACKLIGHT
+//
+
+DigitalIn sw(P0_1);
+DigitalOut backlight(P1_3);
+DigitalOut led(P1_6); // The manual says "P0_6" but schematic is "P1_6"
+I2cLCD lcd(P0_5, P0_4,P0_25);
+Ticker timer;
+
+int count = 0 ;
+
+void attime()
+{
+    lcd.locate(0,0);
+    lcd.printf("Hello World! %d\r\n",count);
+    led = !led;
+    count++ ;
+} 
+
+int main() 
+{
+    backlight = 0;
+    timer.attach(&attime, 1);
+    while(1)
+    {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jun 09 11:02:11 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file