i m learning tImer 0 for interrupt of 16F877A...
i see the equation for calculate the period...
for internal clock Fosc=4Mhz, period=(256-TMR0)X4ToscXprescaler...
but if i put my hardware crystal is20MHz, then this 20MHz is my internal clock or external clock???
so, my interrupt equation should use 4MHz or 20MHz as calculate??
i feel confuse with it...:???:
pls giving advance...
That's timer 0 internal clock, and its frequency is a fourth part of the Crystal frequency (in your case: 20MHz / 4 = 5MHz)
Timer 0 external clock must be connected to T0CKI pin, and the Timer setup registers should be properly configured to run from this clock.