LCD display interface 4-bit vs 8 bit vs SPI - Page 1
Forum section: electronics / projects

author: ricko_uk
author_rank: Super Contributor
timestamp: June 09, 2020, 09:03:35 pm
content: Hi,with ref to the attached alphanumeric display, it has 3 interfaces available 4-bits, 8-bits and SPI.1) Assuming you have plenty of pins and also SPI available on the micro, which one would you choose and why?2) why do they have an 8-bits interface when if you want to use parallel then the 4-bits offer the same and save pcb traces? I don't think it is for speed reasons because the amount of data is so tiny even in the worst case scenario. Maybe that's not the case? Maybe for fast display update for fast animations? Even then the maximum refresh speed required to perceive smooth animation is only 30 to 50 Hz...Thank you

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 09, 2020, 09:49:20 pm
content: Handy to toss on a bus?Oh, hey, it's HD44780 compatible, isn't it -- command set and everything? Though a lot slower, at 600us max per instruction... which is pretty disgusting to write 80 characters in one go, that's a 20 FPS refresh rate? Yuck... Hopefully it can go faster on some operations, but who knows...So that, and they've tacked on SPI too, which is nice.I recently did a project with a parallel bus to RAM and DAC; the display was HD44780 based anyway, and I didn't have many spare IOs after allocating the bus, so it was a natural fit. It would be hard to do serial (DAC, display or other things) on that particular project, but with more pins available it would've been fine.If on the other hand, you're doing just a lot of stuff with the GPIOs, and can't easily afford to multiplex them -- saving a few pins here and there with a serial bus is an excellent idea.Tim

author: thm_w
author_rank: Super Contributor
timestamp: June 09, 2020, 09:51:32 pm
content: What is the maximum SPI speed of the display, and of your controller? If that is enough to reach the required refresh rate then go with that. Since it is a character display it seems likely.In some cases SPI will not let you read display memory. Or have other limitations that would make you want to use 4/8bit.I don't know specifically why they offer both 4 and 8, but it gives the most flexibility. Some displays will offer I2C/SPI/parallel even. Maybe legacy compatibility.

author: jpanhalt
author_rank: Super Contributor
timestamp: June 09, 2020, 09:56:19 pm
content: There is virtually no difference in speed between 4-bit and 8-bit interfaces. 8-bit just requires more wires/port pins.The biggest difference between the serial and 4-bit is whether the screen and busy pin can be read with a serial interface. For a lot, perhaps the vast majority of such devices, that is not possible. I didn't spend a lot of time on your datasheet. It does not appear you can read the busy pin or the display ram.For a character display, reading the display is relatively unimportant. I do have routines to clear "rest of line" which read the display. Reading the busy flag can speed things up a tiny bit.If you do any sort of graphics (I realize it is a character display), then reading the display can be a bigger help as you can read, modify, and write.For a character display, I would use the 4-bit parallel or SPI interface depending on whichever you are more comfortable with and how many pins your MCU has to spare.

author: mariush
author_rank: Super Contributor
timestamp: June 09, 2020, 09:59:32 pm
content: Could be spi input uses a microcontroller to convert spi to 4 bit or 8 bit and route it to the actual lcd driver that talks hd44780You get the processing latency of the micro PLUS the latency of the actual lcd driver.As for 8bit vs 4 bit ... 4 bit saves io pins, but twice as slow ... from memory i think it's at least 100ns per update ... so 200ns vs 100ns for every character.

author: jpanhalt
author_rank: Super Contributor
timestamp: June 09, 2020, 10:07:06 pm
content: Quote from: mariush on June 09, 2020, 09:59:32 pmNo where near "twice" as slow. The two nibbles are given an rapid succession (no wait). In Assembly, its about 2 Tcy slower than 8-bit. The slow part is waiting between characters.

author: ricko_uk
author_rank: Super Contributor
timestamp: June 09, 2020, 10:22:17 pm
content: As Tim pointed out it is 600us per instruction is extremely slow. Then it looks like that performance wise, as far as the user is concerned, the refresh rate does not change between any of the interfaces.Does anybody have used perhaps a similar OLED but faster?Thank you

author: jpanhalt
author_rank: Super Contributor
timestamp: June 09, 2020, 10:36:22 pm
content: Quote from: ricko_uk on June 09, 2020, 10:22:17 pmI wonder if 600us is a misprint? Clearing display, which usually means writing a null to each character is only 2 ms, which is more typical. (Initially with poor eyesight and a small screen, I read that as 600 ns.)