Remote-processing RPC-330 Manuel d'utilisateur Page 43

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 48
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 42
MULTI-MODE COUNTER SECTION 13
Page 13-1 RPC-330
DESCRIPTION
Both 24 bit multimode counters are capable of up/down,
binary, divide-by-n, and quadrature inputs. Count
frequency is DC to 20 Mhz. The R PC-330 uses an LSI
Computer Systems LS7166. Its data sheet is found in
Appendix C.
The COUNT function and statements are used to read
from and write to the counters. COU NT(0) and
COUNT 0 are used to read and write from P2.
COU NT(1) and COUN T 1 ar e used to re ad and wr ite
from P3. LINEB is used to program the chips for
various operating modes.
Interrupts, using ON ITR, may be detected on a carry,
borrow, or either event. The event is jumper selectable
through H2 or H3. When the counter is used, external
interrupts (see SECTION 12 ) may not be used.
H2 and H3 Description
Pins
1-2 Carry pulse from counter
3-4 Borrow pulse from counter
5-6 Exter nal interr upt
7-8 Carry or borr ow pulse from counter
9-10 Pulse latch using quadrature input
Jumper header H 2 is used for counter 0 and INT 0.
Header H3 is used for counter 1 and INT 1. The LINE
function may be used to read the status of a jumper on
H2 or H3. LIN E(8) reads INT 0 and LINE(9) r eads
INT 1.
The pulse latch (pins [9-10]) must be cleared before
another interrupt is generated and should be cleared
before the first interrupt is generated. See
PROGRAMMING below for further information.
Signals connect to the counter via P2 or P3. The
following table defines signal inputs to the LS7166.
Name Function
An IN Counter input A
Bn IN Counter input B
GND Ground
LD n Load counter/latch (LCTR/LLTC)
GT n Gate/reset counter (ABGT/RCTR)
INT n External TTL interrupt input
Input lines (An IN), (Bn IN), LOAD n, and GATE n are
pulled to + 5V through a 10K resistor.
PROGRAMMING
The LS7166 is capable of several operating modes, all of
which are not discussed here. See Appendix C for this
chips operating modes. What are shown are examples of
how to program this chip.
NOTE: Be sure to initialize the counter chip before
using COU NT com mands. Failure to do so
returns meaningless results.
The COUNT function returns the current counter value.
Specifically, RPBASIC writes a 2 to the MCR (M aster
Control Register), reads the 3 counter bytes from the OL
(Output latch), and converts it to the proper internal
BASIC format.
100 A = COUNT(0)
COUNT statement writes a 24 bit number to the PR
(Preset register) only. Its syntax is:
150 D = 95000
200 COUNT 0,D
A number could be used in place of variable 'D' .
LINEB is used to program and access specific registers
in the LSI7166 chip. In all cases, the bank number is 6.
The address depends upon the specific chip. Use an
address of 1 for counter 0 and 3 for counter 1.
To transfer this number to the counter, execute the
following in the program:
LINEB 6,1,8
Line 100 reads the output status register.
100 A = LINEB(6,1)
200 LINEB6,1,X
Line 200 writes to OCCR, ICR, QR, MCR, and ICR
registers in counter 0. The value ' X' selects a register
determined by bits 6 and 7 in the byte written to the
chip.
When H2[9-10] or H 3[9-10] is jumpered, the output
from a latch is connected to the interrupt line. When the
7166 chip is configured for quadrature encoder and
interrupt when the count reaches a preset number, a very
Vue de la page 42
1 2 ... 38 39 40 41 42 43 44 45 46 47 48

Commentaires sur ces manuels

Pas de commentaire