'------------------------------------------------------------------------
-----------------
'name : timer1.bas
'copyright : (c) 1995-2016, MCS Electronics
'purpose : show using Timer1
'micro : 90S8515
'suited for demo : yes
'commercial addon needed : no
'------------------------------------------------------------------------
-----------------
Dim W As Word
'You can read or write to the timer with the COUNTER1 or TIMER1 variable
W = Timer1
Timer1 = W
'Also you can choose to capture the TIMER registers to the INPUT CAPTURE
registers
'With the CAPTURE EDGE = , you can specify to capture on the falling or
rising edge of
'pin ICP
Config Timer1 = Counter , Edge = Falling , Capture_Edge = Falling
'Config Timer1 = Counter , Edge = Falling , Capture Edge = Rising
'To read write the compare registers, you can use the COMPARE1A and
COMPARE1B variables
Compare1a = W
W = Compare1a
'to set the PWM registers, just assign a value to the compare A and B
registers
Compare1a = 100
Compare1b = 200