2412 views|1 replies

314

Posts

0

Resources
The OP
 

[Repost] A few simple steps to help you understand the MCU timing diagram [Copy link]

Operation timing is always the most important content of using any IC chip. If you understand the timing diagram, it will be very easy to operate the chip. And extracting useful information from the chip device manual is the most basic step to use the chip.
Take the LCD display chip 1602 as an example
First, let's look at the pin definition of 1602. The pins of 1602 are very neat SIP single-in-line packages. The device manual gives the pin function data table:
[color=rgb(25, 25, We only need to pay attention to the following pins:
We only need to pay attention to the following pins:
Pin 3: VL, liquid crystal display bias signal, used to adjust the display contrast of LCD1602. Generally, an external potentiometer is used to adjust the bias signal. Note that the strongest contrast can be obtained when the voltage of this pin is 0.
4th pin: RS, data/command selection terminal. When this pin is high, data bytes can be transmitted to 1602, and when this pin is low, command bytes are transmitted. Command bytes are bytes used to set some working modes of LCD1602; data bytes are bytes used to display on 1602. It is worth mentioning that the data of LCD1602 is 8 bits.
5th pin: R/W, read/write selection terminal. When this pin is high, data can be read from LCD1602, and vice versa. I think this pin is not very useful. It can be directly grounded and permanently set to low level without affecting its normal operation. However, it has not been verified by complex systems, so I reserve this opinion.
Pin 6: E, enable signal, which is actually the data control clock signal of LCD1602. The rising edge of this signal is used to realize the data transmission of LCD1602.
Pins 7 to 14: 8-bit parallel data port, which makes it much easier to read and write data to LCD1602.
LCD1602 operation timing
There are two write timings:
① If you want to write instruction words, when setting the working mode of LCD1602: you need to set RS to low level, RW to low level, and then send the data to data port D0~D7, and finally write the data to the E pin with a high pulse.
② If you want to write data words, when displaying on 1602: you need to set RS to high level, RW to low level, and then send the data to data port D0~D7, and finally write the data to the E pin with a high pulse.
Did you find that the difference between writing instructions and writing data is only the different RS levels.
The following is the timing diagram of LCD1602:
The general rules followed by the timing diagram
[color=rgb(25, 25, The figure above frames and notes some common sense for understanding this figure:
(1). The leftmost side of the timing diagram is usually the logo of a pin, indicating that this line of lines reflects the changes of the pin. The figure above respectively indicates the timing changes of four types of pins: RS, R/W, E, DB0~DB7.
(2). The part with crossed lines indicates that the level is changing, as marked above. (3) It should be easy to understand. As shown in the upper right corner of the figure above, the two parallel lines correspond to high and low levels respectively, which coincides with the level change in (2).(4) The sealed diamond part at the bottom of the figure above should be sealed, indicating that the data is valid. The word "Valid Data" also shows this. Note: The level changes of each pin in the timing diagram are based on the same time axis. Be sure to observe the timing diagram accurately according to the growth direction of the time axis. Make sure that the device strictly follows the changes in the timing diagram. This requirement is particularly strict in single-bus devices such as 18B20. There are many time annotations on it, which is also very important information. These time annotations indicate the shortest or longest time that certain states need to be maintained. Because the operating speed of the device is also limited and generally cannot keep up with the speed of the main control chip, there must be timing coordination between them. Below is the timing parameter table:
Estimate the instruction time of the main control chip
Some level parameters of the MCU can be found in the official data sheet.
For example, with AVR M16 as the main control chip and an external 12MHz crystal oscillator, the instruction cycle is a clock cycle of (2/12MHz)s, so at least it is determined that the time it takes to execute an instruction is at the us level. We can see that the time parameters given above are all at the ns level, so even if we do not add a delay program in the program, it should be able to meet the timing requirements of LCD1602 very well. How to read this table? It's very simple. We can find TR1 in the timing diagram. Corresponding to the timing parameter table, we can find that this is the E rising edge/falling edge time, with a maximum value of 25ns, indicating that the level change on the E pin must be completed within a maximum of 25ns.
Source: Internet, if infringed, please delete
This post is from Power technology

Latest reply

Really useful stuff, thanks for sharing ^_^  Details Published on 2018-12-10 16:54
 
 

1368

Posts

6

Resources
2
 
Really useful stuff, thanks for sharing ^_^
This post is from Power technology
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list