Wich counter? The PIC TIMER0,1,2?
Code:
'
' PIC Configuration
' =================
@ __CONFIG _HS_OSC & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON
DEFINE OSC 20
'
' Hardware configuration
' ======================
TRISB=%11111111 ' PORTB<7:0> => all set to input
T1CON = %00000110 ' TIMER1 counter :
' Prescaller 1:1
' Oscillator shut off
' no synchronisation
' use PORTB.6 as clock input
'
' Variables/Alias definition
' ==========================
TMR1ON VAR T1CON.0
CounterA VAR WORD
Start:
TMR1L=0 ' Clear
TMR1H=0 ' Counter
'
TMR1ON=1 ' Start counter
PAUSE 1000 ' Sampling time
TMR1ON=0 ' Stop counter
'
CounterA.HIGHBYTE=TMR1H ' Get results
CounterA.LOWBYTE=TMR1L '
'
' Blah blah blah
'
goto start
Last edited by mister_e; - 18th May 2006 at 15:28.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks