seanshpark / at89c2051

play with AT89C2051 and AT89C4051
Apache License 2.0
0 stars 0 forks source link

Digital clock time tune #12

Open seanshpark opened 2 weeks ago

seanshpark commented 2 weeks ago

Tune digital clock time.

seanshpark commented 2 weeks ago

timer1 isr -> use inline or there will be lots of push and pops

seanshpark commented 2 weeks ago

with inline, minimum push and commands

push    acc
push    psw
mov _TH1,#0x4c
mov _TL1,#0x00

...

pop psw
pop acc
reti
seanshpark commented 2 weeks ago

interrupt handle cycle used

total = 17

seanshpark commented 2 weeks ago

with

  TL1 = 0x10;
  TH1 = 0x4c; // for 50msec
  t_20_d++;

there is no push/pop

adjust: loading TH1/TL1 will make timer restart

total = 7

seanshpark commented 2 weeks ago
void timer1_isr(void) __interrupt(3) __using(2)
{
  TL1 = 0x09;
  TH1 = 0x4c; // for 50msec
  t_20_d++;
}