Tragic protues Simulation

Source: Internet
Author: User

Today, a group member asked me a question about the dynamic display of digital tubes, is the "scm c language programming training 100 cases" 14 K1-K4 control digital shift display (this book can flip ), although I have never played 51 Single-Chip Microcomputer in detail (or I have never played with water lights or digital tubes ). At first, I thought it was just a piece of cake, Baidu's dynamic display of the operating principle, isn't it a matter of writing programs?

 

Because protues simulation is provided in the book, it is used for simulation, and there is no problem with the board.

To put it simply, the function of displaying the shift of the 8-bit 7seg-mpx8-ca digital tube is as follows:

void Show_Count_ON_DSY()  
{
uchar i;
for(i=0;i<8;i++)
{
P0 = DSY_CODE[Display_Buffer[i]];
P2 = DSY_Index[i];

DelayMS(2);
//P2=0x00;
}
}

 

 

The above function first selects the bitwise signal, and then selects the segment signal. The simulation does not respond, but first selects the segment signal, and then selects the bitwise signal. The response is correct. Only one digital tube is available, the comment-out statement is added to the end, that is, it will be done right away.

 

Speechless, why?

Baidu, basically all the posts on the first 10 pages are read ......

Google, still ......

 

Let's explain the dynamic display first. Obviously, in layman's terms, we send character encoding and bit selection signals to all the digital users in turn, and use the human eye's vision to stay for the time being, it seems that several digital tubes are lit at the same time, so that different characters can be displayed simultaneously on different digital tubes. For example, if you take the cigarette lit up in the air at night, you will see a bright line, but it is only a bright line. If you do not know about it, you can go to other documents to view the relevant Visual Knowledge temporarily. Static display is to select multiple digits at the same time. This is the fundamental difference between them.

 

Of course, here some people want to say that I have sold off the customs. In fact, I read the title and should guess that it is a problem of protues simulation. Later I thought of the board and found that the result was the opposite, not shown, instead, 8 is displayed, which can be explained and is a problem of shadow.

 

In fact, on the real board, even if the delay is long, you can also see the phenomenon of "shadow. The reason for this is that the CPU execution speed is very fast. when the data is sent to the bit selection and segment selection, the data is then sent to the bit selection, however, the segment selection data of this bit has not yet been sent, so this bit still maintains the data of the last segment selection, and then the segment selection data of this bit is sent, because of the visual residue, the Display Results of the selected data segments overlap, resulting in confusion. Simply put, a digital tube shows the overlapping effect of the characters to be displayed in the previous position and the characters to be displayed. To avoid "drag-and-drop", you must disable each digital tube after it is displayed. We can add "p2 = 0xff;" so that no digital tube is selected, the next digit will not be affected when it is displayed again. This is called "shadow ".

 

Give a big red letter,Next time you encounter a problem with the protues simulation, you can try it on the board. Sometimes there is no problem with the circuit and the program, but there is a problem with this protues.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.