Remote-processing CAMBASIC Manual de usuario Pagina 194

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 208
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 193
Event Multitasking - 5
The second is the interrupt mode. When the preset count is reached, a software interrupt is generated and the program
branches to a subroutine which acts on the preset count. This mode requires that CONF IG COU NT, ON COUNT and
START COUNT be executed in that order. Below is a short example of a prescaler:
10 CONFIG COUNT 5,0,1,2000,AUTO
20 ON COUNT 5 GOSUB 200
30 START COUNT 5
.
.
200 INC A
210 RETURN
Line 10 configures counter 5 to read bit 1 of address 0 as an input. When the count reaches 2000,
the counter will automatically rese t.
Line 20 directs CAM BASIC to branch to a subroutine when the preset count is reached.
Line 30 starts counter operation. These three lines do not need to be adjacent in the program.
However, they must be executed in this order.
Line 200 increments variable A. Thus, the value of A is the number of times the counter has
counted to 2000.
Line 210 returns program execution to the place that it was interrupted.
It is imperative that the counter numbers in CONF IG COU NT and STA RT count match. Otherwise, operation will be
unpredictable.
Vista de pagina 193
1 2 ... 189 190 191 192 193 194 195 196 197 198 199 ... 207 208

Comentarios a estos manuales

Sin comentarios