Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

T=4/Fosc=4/20Mhz=0.

2 us
Initial value= (ef*ti)-1=5*60-1=299

Effective frequency=20/4=5Mhz
TMR0 f=Focs/4 /prescale=5/4=1.25 Initial value=256-(TMR0 f*ti)=181

Maximum TMR0 tim cap=(2^8*prescaler*T) for T=1/(Fosc/4)<=13ms

Prescaler=256
initial value=60 microsecond
IV=256-(Fosc/4 /pre *ti)=>ti=10000us=10ms

Prescaler=4,Period=192,Postscale=2

TMR2 f=Fosc/4 /prescale=1.25MHz


TMR2 T=1/f=8*10^-7 s =0.8 us
TMR2 interrupt= T*(PR+1)*postscale=308.8us
TMR f=Fosc/4/Pre=5Mhz
Preload=Int/TMR T -1
=40000

2.048/2^8=8mV/bit
0.896/0.008=112
=01110000
2^8-1 and (-2^15 to 2^15-1)

Will do this

miss enable_interrupts(GLOBAL);

You might also like