beautypg.com

Counters, Programming, Pc2000-pc/104 programming sequence – Ocean Optics PC2000-PC_104 User Manual

Page 11

background image

PC2000-PC/104 Data Sheet

Counters

The PC2000-PC104 implemented the core of an 82C54 programmable timer in the FPGA to
implement the required clock signals. Refer to this data sheet for more detailed information. This
implementation requires no control word to be written to the counter. These timers use the equivalent
of control mode 3 (50% duty cycle) and the counters are always enabled. The base frequency for each
of the timers is shown in Table 1.

Programming

Pseudo-code programming for the PC2000-PC104 is provided in

PC2000-PC/104 Programming

Sequence

.

PC2000-PC/104 Programming Sequence

This technical document describes the programming procedures necessary to control and PC2000-
PC104 spectrometer. This setup is functionally identical to the S2000 spectrometer and ADC1000 ISA
card. The pseudo-code examples below use the following definitions:

(Note: all numbers starting with "0x" are in hexidecimal.)

• source code is in this font

comments are in this font

• outport_byte(baseadd+1,0x13) -- outputs one byte of data to the specified port,

represented as an offset from the base address

• outport_word(baseadd+1,0xffff) -- outputs one word of data to the specified port,

represented as an offset from the base address

• inport_byte(baseadd+3) -- inputs one byte of data from the specified port,

represented as an offset from the base address

• inport_word(baseadd+5) -- inputs two bytes (one 16-bit word) of data from the

specified port, represented as an offset from the base address

• Variables:

baseadd

-- the base address in decimal, 16-bit integer

dsf

-- digital sample frequency, or A/D conversion frequency, 16-bit integer

fdc

-- number of flashes per scan, 16-bit integer

cmd

-- command to be sent to A/D card, 8-bit (unsigned) integer

average

-- number of scans to average

oldvect

-- stored interrupt vector

current_channel

-- active spectrometer channel

indata

-- data read from the A/D card

irq

-- the interrupt number (interrupt request) of the ADC500/ADC1000/PC1000

ihandler

-- the interrupt handler function

000-00000-000-05-0704

11