LOAD

Top  Previous  Next

Action

Load specified TIMER with a value for auto reload mode.

 

 

Syntax

LOAD TIMER , value

 

 

Remarks

TIMER

TIMER0, TIMER1 or TIMER2.

Value

The variable or value to load.

 

When you use the ON TIMERx statement with the TIMER/COUNTER in mode 2,

you can specify on which interval the interrupt must occur.

The value can range from 1  to 255 for TIMER0 and TIMER1.

For TIMER2 the range is 1-65535.

 

The LOAD statement calculates the correct reload value out of the parameter.

The formula :  TLx = THx = (256-value)

For TIMER2 : RCAP2L = RCAP2H = (65536 - value)

 

The load statement is not intended to assign/read a value to/from the timers/counters. Use COUNTERx instead.

 

 

See Additional hardware for more details

 

 

 

Example

LOAD TIMER0, 100                 'load TIMER0 with 100

 

Will generate :

Mov tl0,#h'9C

Mov th0,#h'9C

 

LOAD TIMER2, 1000

Will generate:

Mov RCAP2L,#24

Mov RCAP2H,#252