-
Marcin
- (3 posts)
Posted: 11 Jun 2012, 15:06
Hello,
Does anyone knows LCD HD44780 driver that is compaible with microbuilder LPC1114 codeBase ? What I was able to find was written for CMSIS package, and changes mean writing from begining :) (what I started but maybe there is already one ?)
Regards,
Reply
Posted: 12 Jun 2012, 14:06
You're actually the second person to ask me this week about the HD44780, but I haven't used them in years so there's no driver, no. Any CMSIS driver shouldn't be too hard to port, though, since the register names I use are almost always identical (since they come directly from the user manual). The GPIO access will likely need some work to change, though.
Unfortunately, I don't even know if I have an HD44780 display here to add a driver in myself! :(
Posted: 13 Jun 2012, 04:06
Those displays use 4 or 8 data lines so most of libraries I saw is using masked access to whole port not single GPIO pins operation. Is there exposed easy way to set port register ?
For example "gpioPortSet(0, 1<<3|1<<4|1<<8) to set bits 3,4 and 8 on GPIO_0 within one command ?
Spock
Posted: 14 Jun 2012, 04:06
The LPC1343 and LPC1114 both have 'bit-banding' for the GPIO pins, meaning that you can access a special address that will only effect the pins that you are interested in. This allows you to set some specific pins in a single clock cycle, etc., which was used a lot to optimise some of the LCD drivers that make heavy use of GPIO.
| // These registers allow fast single operation clear+set of bits (see section 8.5.1 of LPC1343 UM) |
| #define ILI9328_GPIO2DATA_DATA (*(pREG32 (GPIO_GPIO2_BASE + (ILI9328_DATA_MASK << 2)))) |
You just need to replace 'ILI9328_DATA_MASK' with the bits you wish to access, and then you can do things like: ILI9328_GPIO2DATA_DATA = 0xFFFF and only bits you indicated will be changed.
In the example above ILI9328_GPIO2DATA_DATA is 0x1FE, which means bits 1..8 will be used. If you are using GPIO 0, 1, 2, or 3 just change the number in GPIO_GPIOx_BASE.
Hope this helps clarify thing.
Posted: 14 Jun 2012, 11:06
Thank you :)
This solves my probles - I can create my own #defines easy to manipulate all GPIO ports in one cycle.
Now it will be easy to port almost any driver I've found.
Spock
Posted: 15 Jun 2012, 10:06
Spock said:
Thank you :)
This solves my probles - I can create my own #defines easy to manipulate all GPIO ports in one cycle.
Now it will be easy to port almost any driver I've found.
Spock
By coincidence, I just ported the Arduino LiquidCrystal driver for HD44780 compatibles to a LPC1343 with microbuilder codebase.
The source is here https://github.com/bobc/bobc_hardware/tree/master/Firmware/control_panel_v2.