this cod evil generate every 1mSec a interrupt
[code:1:2a9dfa4a00]
Config_tc0:
Config Tcc0 = Normal , Prescale = 128
Tcc0_per = 250 '32MHz/128 = 0.000004 * 250 --> 1mSecOne Tick
On Tcc0_ovf Tc0_isr 'Setup overflow interrupt of Timer/Counter C0 and
Enable Tcc0_ovf , Lo 'Enable overflow interrupt in LOW Priority
Config_priority:
Config Priority = Static , Vector = Application , Lo = Enabled , Med = Enabled 'Enable Lo Level Interrupts
Start_intterupts:
Enable Interrupts
main:
do
loop
'*******************************************************************************
' Timer 0 isr routine
'*******************************************************************************
Tc0_isr:
' do something
return
[/code:1:2a9dfa4a00]
Tiny
↧