#include<reg51.h> void delay() //Function to provide a time delay of approx. 1 second. Timer 1. { int i; for(i=0;i<20;i++) { TL1=0xFD; TH1=0x4B; TR1=1; while(TF1==0); TR1=0; TF1=0; } } void main() { char num[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67};// Hex values corresponding to digits 0 to 9 int c; while(1) { for(c=0;c<10;c++) { P1=num[c]; delay(); } } }
Hi guys, I am not getting delay of 1 sec.blinking rate of 7 segment is too fast in comparison of delay calculated(=1sec). Any help will be appreciated.. thanks
I'm also referring the same document
Figure 8 on page 27
did u directly jump to this page or you had a brief look at first page first line also.
If you're getting double then it supports my suggestion ...
Or you are just finding something to support your argument? If you have frustration keep it to yourself don't show me. got it.
Now see first page second paragraph. A key feature of the P89V51RD2 is its X2 mode option. The design engineer can choose to run the application with the conventional 80C51 clock rate (12 clocks per machine cycle) or select the X2 mode (6 clocks per machine cycle) to achieve twice the throughput at the same clock frequency. Another way to beneï¬t from this feature is to keep the same performance by reducing the clock frequency by half, thus dramatically reducing the EMI.
And I think before going to find something relevant at page 34, 7.12.2 you stopped at Figure 8 on page 27 Clock doubling option By default, the device runs at 12 clocks per machine cycle (x1 mode). The device has a clock doubling option to speed up to 6 clocks per machine cycle (please see Ta bl e 5 8 ). Clock double mode can be enabled either by an external programmer or using IAP. When set, the EDC bit in FST register will indicate 6 clock mode.
When set, the EDC bit in FST register will indicate 6 clock mode. and only when set !! otherwise default.. u might hv read! o but might hv nt undrstood, bt i cnt do anythng about tht.
You are looking at text of how to run instructions at twice the speed.
But why not jump to the chapter about the timer? It does mention the use of a div-6 clock.
And when you test - does your test match the timer chapter or the instruction speed information?
Or you are just finding something to support your argument?
I did find something to support it and I did mention it.
If you have frustration keep it to yourself don't show me. got it.
If you got it going, that's great. If you haven't then you should at least appreciate suggestions.
u might hv read! o but might hv nt undrstood, bt i cnt do anythng about tht.
Ok chum. That's enough!!! Your original post suggested you needed some help, subsequent posts suggested you really needed some help. I don't have to suggest anything to you and I've got plenty of paid work to do.