HD44780 Arduino or AVR input emulation - Page 1
Forum section: electronics / projects

author: Infrared_Fred
author_rank: Regular Contributor
timestamp: February 28, 2021, 11:34:15 pm
content: Hello!Although the project is rather up in the air at the moment, does anyone know if there is a library for Arduino or an AVR microcontroller that I could use for input to the microcontroller where it could interface like a HD44780 type controller but have custom displays or anything else you wanted on the outputs? Long in the short of it, I have a bunch of these displays (HPDL-1414) and I want to make a big 16x2 or 20x2 Alphanumeric board with them but I don't want to hassle with a lot of programming for doing up an interface for the input and to to make it easy to incorporate into a project without a lot of hassle, I figured that an input interface compatible with the standard LCD interface of the HD44780 type controller.Thank you!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 01, 2021, 12:25:56 am
content: Don't know offhand.. possibly?I do know, the bus interface assumes gate logic -- while the write cycles do take quite some time inbetween (plenty of time for an AVR to work), the bus cycle itself (data, D/C setup and hold times, WR strobe time) is on the order of single CPU cycles (100s ns). It's impossible to do interrupt driven IO that fast, polling is iffy.So you might not be able to do it with a naked AVR. But with one or two external latches, it should be very doable.With the MCU alone, you're making more assumptions about the signal source. It might work with some, but not in general. I don't think you'll be able to meet datasheet spec that way. (Possibly one of the faster or beefier XMEGAs can; with clock up to 30MHz or thereabouts, and event or DMA systems, it may be just doable.)Tim

author: pqass
author_rank: Super Contributor
timestamp: March 01, 2021, 02:07:31 am
content: An interrupt service routine can be triggered on the falling edge of the LCD interface's E pin.However, the E pin period can be as fast as 500ns which is shorter than the interrupt latency of the atmega328 (625ns).If your data source can double or quadruple that time, you may have enough time to read the command/data into RAM.Seehttps://www.allaboutcircuits.com/technical-articles/how-to-a-162-lcd-module-with-an-mcu/andhttps://z80avrproject.wordpress.com/2016/10/10/103/

author: WattsThat
author_rank: Frequent Contributor
timestamp: March 01, 2021, 03:49:56 am
content: What’s the point of HD44780 emulation? It’s a 16 segment LED, not a pixel based LCD. Talk about looking at a circle and calling it a square. Just sayin.https://hackaday.io/project/168425-hpdl-1414-16x2-led-displayhttps://github.com/marecl/HPDL1414There’s at least ten more. Lots of YouTube entries with links to code all over the web. If you look, I think you’ll even find various pc boards in KiCad.PS: the hackaday project code is pretty crappy. The library I linked to in GitHub is far more flexible and extendable. It works for me. YMMV.

author: WattsThat
author_rank: Frequent Contributor
timestamp: March 01, 2021, 04:26:31 am
content: A random afterthought:Most of the HP LED displays have an brightness intensity code letter (maybe all, not sure).For the HPDL-1414, it’s on the side with the p/n. Typical part would show “HPDL1414 9811 K” where 9811 is the date code and K is the intensity code. If you want your multi-unit display to match up perfectly, the intensity letters need to be the same code. Being off by one letter usually isn’t noticeable but at two, it will be. The higher the letter, the brighter the display. The -1414 code range is E to K. The intensity table is on the last page of the datasheet but not explained. The coding system dates back to the original seven segment device HP built for the HP-35 calculator.

author: Infrared_Fred
author_rank: Regular Contributor
timestamp: March 01, 2021, 08:50:26 pm
content: Something I should clarify is I am looking to ultimately apply this project as part of a small z80 based homebrew computer or an instrument where I may want to be able to swap it out for an LCD or an OLED depending on how the project goes, and it likely will be only for low bus speed operations (i.e. through a PIO IC). The instrument project may also be something I expand into the future as a DIY kit(??) in which case I would want to be able to use an LCD (less $$$) for the kit, but for my own use, I would much rather an LED display, e.g. longshot anyway for the project, but I wouldn't want to modify the programming really to change the display if possible. Also maybe the74HCT40105FIFO 2x would work for the input, giving the AVR time to respond to the interrupt and switch to that operation as long as the FIFO doesn't fill up first.P.S. Thanks for the help, I may go with the arduino library linked by WattsThat, I am still in design phase so I may just go with these.

author: Ian.M
author_rank: Super Contributor
timestamp: March 01, 2021, 09:51:48 pm
content: A natural interface for that display on a Z80 or other 8 bit bus CPU would be to drive its data pins from the data bus, and digit select pins A0, A1 from the address bus, and drive /WR for each unit from the decoded outputs of a 74xx138 3 to 8 line decoder, with the unit selected by three address bus bits. that leaves you two active low enables, one fro z80 /WR and the other for either /MREQ or /IOREQ depending on whether you want it memory mapped or I/O mapped and an active high enable you can use for further address decoding. Depending on the system clock speed you may also need a wait state generator.A direct to Z80 bus HD44780 interface is also pretty easy to implement.On the software side of things - if you read back the HD44780's control port (RS low) you get the internal address pointer and the busy flag. Wait 2ms and read it twice and no matter what mode the HD44780 is in, you are guaranteed at least one zero bit in the two reads. Assuming you have pullups on the data bus you can thus easily distinguish between a HD44780 and a HPDL-1414 at the same address as the HPDL-1414 is write-only so will never put a zero bit on the bus. You can therefore test for which display is fitted and set a flag that determines which output routine in your monitor ROM is used.Alternatively implement an 8 bit input port connected to an 8 pole DIP switch to allow user configuration. Other worthwhile 'display' options would include a hardware UART, with some of the dip switches used to select the baud rate.