Programming the 4x40 LCD in SX/B using 4bit mode
John Couture
Posts: 370
To all,
As promised a couple of weeks ago, I put together a demo for All Electronics 4x40 LCD.· These 7" wide LCD's are very kool and only cost $8.·
http://www.allelectronics.com/cgi-bin/item/LCD-112/365/40_X_4_LCD_DISPLAY_.html
Anyway, the demo puts the LCD into 4bit mode meaning you can address it using only 7 wires (E1,E2,RS,D4-D7).· The demo is adaptable to other LCD configurations (i.e. 1x16, 1x24, 2x20,4x20, etc) and features a function called LCDPos x which positions the cursor at any position on the display.· Thus the last position on a 4x40 LCD would be
LCDPos 159
The demo also features Jon Williams TX_ routines for outputing strings and a couple of routines for converting a register into an ASCII number.
There are LOTS of comments for beginners (635 lines total) and it was programmed using the smallest SX chip (SX18) with plenty of room to spare· (takes up about 563h).· The program can be trimmed down if you need memory or you can move it to the SX48 and have tons of memory.
06/16/2006 - just uploaded a fresh version with updated comments (hopefully a little easier to read)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Post Edited (john couture) : 6/16/2006 3:40:16 PM GMT
As promised a couple of weeks ago, I put together a demo for All Electronics 4x40 LCD.· These 7" wide LCD's are very kool and only cost $8.·
http://www.allelectronics.com/cgi-bin/item/LCD-112/365/40_X_4_LCD_DISPLAY_.html
Anyway, the demo puts the LCD into 4bit mode meaning you can address it using only 7 wires (E1,E2,RS,D4-D7).· The demo is adaptable to other LCD configurations (i.e. 1x16, 1x24, 2x20,4x20, etc) and features a function called LCDPos x which positions the cursor at any position on the display.· Thus the last position on a 4x40 LCD would be
LCDPos 159
The demo also features Jon Williams TX_ routines for outputing strings and a couple of routines for converting a register into an ASCII number.
There are LOTS of comments for beginners (635 lines total) and it was programmed using the smallest SX chip (SX18) with plenty of room to spare· (takes up about 563h).· The program can be trimmed down if you need memory or you can move it to the SX48 and have tons of memory.
06/16/2006 - just uploaded a fresh version with updated comments (hopefully a little easier to read)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Post Edited (john couture) : 6/16/2006 3:40:16 PM GMT
SXB
23K
Comments
·· I haven't tried the code, but it was very nice of you to share your work with the Forum Community.· I'm sure it will help a lot of new users to the SX (probably some veterans as well).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!