- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi community,
anybody out there ever programmed the Newhaven LCD on the Altera SoC (Cyclone V) DevKit baremetal? If I didn't miss something Altera's hwlib doesn't provide support for I2C (not to mention support for the LCD). As I'm not a linux expert the linux i2c driver isn't very helpfull either. If someone could give me a hint where to look for a starting point, that would be really great. Thanks a lot for your support!Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to give you some hints to get it running. it's not very difficult to get it running on a baremetal system. You can still use the hwlib. There is a headerfile called alt_i2c.h. This file contains a lot of definitions, needed to implement an i2c driver for your application. To write something to the LCD you have to do the following steps: first step: you need to write an init-function for the i2c interface. here you have to do the following steps:- Disable the i2c controller by clearing the enabled bit in the alt_i2c_en register
- set the controller to master mode (register alt_i2c_con_mst_mod)
- set the speed to standard (the newheaven display only supports 100khz clock rate) (register alt_i2c_con_speed)
- enable the i2c controller (set enabled bit in the alt_i2c_en register)
- write the address of the slave to the alt_i2c_tar register
- to send data you have to set the ALT_i2c_data_cmd_cmd Register to WRITE
- write the data to the alt_i2c_data_cmd_dat Register
- Slave address is 0x28 (and not 0x50)
- between the commands you send, you need a delay (normally 100µs).
- A full list of special commands for the display you can find in the newheaven specification. (Download it from the newheaven website. The LCD is the NHD-0216K3Z)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page