Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Calculus about internal oscillation with LCD display

Status
Not open for further replies.

Fever

Junior Member level 1
Joined
Apr 25, 2018
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
176
Hi,

For my new project, I need to use a LCD display that has 320x240 pixels among other things.

I am currently evaluating the MCU specs needed to run everything, and more importantly I need to decide what minimal frequency I need to run the LCD in a decent way.

I decided to go with this display in 16bits/px parallel mode.

https://www.digikey.com/products/en?mpart=4DLCD-28QA&v=1613

My problem is that I'm not confident about my calculus.

For now I went with :

320x240 = 76800px
76800px * 2 = 153600 bytes (2 bytes/px)

Let's say I want a frame to be printed in 50ms, and since parallel mode allows us to write data as fast as we can toggle a pin, we get :

153,600 bytes * 20 = 3,072,000 bytes
24,576,000 bits/s

So I guess I would need at least a speed of 25Mhz to do what I want.

Am I right to think like that ?

Thank you for your help.
 

You're way off.

That display has a 16 bit bus (not 8, as per your calculation) which means you can write one pixel per clock.

76800 px/frame X 20 frames/sec=1.536MHz
 
  • Like
Reactions: Fever

    Fever

    Points: 2
    Helpful Answer Positive Rating
Thanks for your answer.

I don't get it to be honest. I get that 1 pixel is 16 bits, but to be able to toggle the 16 ports, I should need 16 clock cycles. Or toggling one pin does not take 1 clock cycle ?

Thanks
 

It sounds like you need to learn something about digital systems. If you have a 16-bit bus, it takes one clock cycle to write all 16 bits. (If you have a 128-bit bus, it also takes only 1 clock cycle.) What makes you think you can only toggle one bit at a time?
 
  • Like
Reactions: Fever

    Fever

    Points: 2
    Helpful Answer Positive Rating
Well, let's imagine I have 16 wires connected on 16 different ports on my MCU.
Let's say I want to write 0b0101010101010101 for my pixel.
I will need to set the port D0 to 0, then D1 to 1, the D2 to 0, then D3 to 1 ect...
I mean my program has to toggle the 16 pins, and in my head this should take 16 instructions.

I am trying to figure out what should be the speed of my MCU, how fast is has to toggle the 16 pins to know what should be the speed of FOSC so I can get my 20 frames/s.

Thanks
 

Which MCU has 16 ports? I have never seen one with that many.
If you are correct, it would take 16 instructions at least to set or reset the bits but on all MCU I've ever encountered, there is more than one bit per port. Even two 8-bit ports can write 16 bits in 2 instructions.

Brian.
 
  • Like
Reactions: Fever

    Fever

    Points: 2
    Helpful Answer Positive Rating
Sorry I meant 16 GPIO.

I think I get where I'm wrong. If a port is 8 bits, it means that writing something like PORTB = 0b01010101 takes 1 instruction ?
 

Unless you wanna play full screen video, there is no point to update whole screen. It requeres to much memory and time. Normally we update only particular part.
 

Yes I can imagine. I am just evaluation depending on the worst case scenario.

After reading a bit more about how instructions and clock cycles, I learned that a clock cycle is not just 1 bit but the size of the MCUs bus (in my case 32 bits)
So I guess writing to PORTB which is 16 pins, equals 1 instruction. So since my LCD has a 16bits bus, I can write 2 bytes in 1 instruction.
Meaning that 1 pixel is 1 instruction, I would need 76800 px/frame X 20 frames/sec=1.536MHz like barry said.

Am I right now ?

I really appreciate your help.
 

Yes I can imagine. I am just evaluation depending on the worst case scenario.

After reading a bit more about how instructions and clock cycles, I learned that a clock cycle is not just 1 bit but the size of the MCUs bus (in my case 32 bits)
So I guess writing to PORTB which is 16 pins, equals 1 instruction. So since my LCD has a 16bits bus, I can write 2 bytes in 1 instruction.
Meaning that 1 pixel is 1 instruction, I would need 76800 px/frame X 20 frames/sec=1.536MHz like barry said.

Am I right now ?

I really appreciate your help.

Right. But I think you're asking for trouble jumping into a microprocessor project like this.
 

You are probably right. I am a S.E student, and next year I would like to start an E.E course. I bought The Art of Electronics to start learning basics.
Anyway I don't start this project before being confident about the basics, which is why it is only theoretical for now.

Anyway thank you a lot for your help everyone, I really learned something I mark this thread as solved.

Have a nice day.
 

To relate LCD data throughput to processor speed, you need to think more about processor interfaces.

Using general IO is totally ineffective and won't give even a fraction of the intended bandwidth. You need to use a processor with true data bus, e.g. ARM or at least a microprocessor with a 16 bit (in case of need 8 bit) "parallel master port" with automatic RD/WR control and DMA capability. Also sufficient internal RAM to store complete frames.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top