Author Topic: LCD display interface 4-bit vs 8 bit vs SPI  (Read 2210 times)

0 Members and 1 Guest are viewing this topic.

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
LCD display interface 4-bit vs 8 bit vs SPI
« on: June 09, 2020, 09:03:35 pm »
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 :)
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21686
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #1 on: June 09, 2020, 09:49:20 pm »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: ricko_uk

Online thm_w

  • Super Contributor
  • ***
  • Posts: 6380
  • Country: ca
  • Non-expert
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #2 on: June 09, 2020, 09:51:32 pm »
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.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 
The following users thanked this post: ricko_uk

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 3478
  • Country: us
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #3 on: June 09, 2020, 09:56:19 pm »
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.
« Last Edit: June 09, 2020, 09:58:05 pm by jpanhalt »
 
The following users thanked this post: ricko_uk

Online mariush

  • Super Contributor
  • ***
  • Posts: 5028
  • Country: ro
  • .
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #4 on: June 09, 2020, 09:59:32 pm »
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 hd44780
You 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.
 
The following users thanked this post: ricko_uk

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 3478
  • Country: us
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #5 on: June 09, 2020, 10:07:06 pm »
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.

No 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.
 
The following users thanked this post: ricko_uk

Offline ricko_ukTopic starter

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #6 on: June 09, 2020, 10:22:17 pm »

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
 

Online jpanhalt

  • Super Contributor
  • ***
  • Posts: 3478
  • Country: us
Re: LCD display interface 4-bit vs 8 bit vs SPI
« Reply #7 on: June 09, 2020, 10:36:22 pm »

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

I 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.)
 
The following users thanked this post: ricko_uk


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf