Analog Outputs

Channel Selection

 

 

Analog Outputs

Channel Selection

One key setting that influences all other possible settings is the channel enable register. An unique feature of the Spectrum boards is the possibility to program the number of channels you want to use. All on-board memory can then be used by these activated channels.

This description shows you the channel enable register for the complete board family. However your specific board may have less channels depending on the board type you purchased and did not allow you to set the maximum number of channels shown here.

Register

Value

Direction

Description

SPC_CHENABLE

11000

r/w

Sets the channel enable information for the next board run.

 

CHANNEL0

1

Activates channel 0

 

 

 

 

 

CHANNEL1

2

Activates channel 1

 

CHANNEL2

4

Activates channel 2

 

 

 

 

 

CHANNEL3

8

Activates channel 3

The channel enable register is set as a bitmap. That means one bit of the value corresponds to one channel to be activated. To activate more than one channel the values have to be combined by a bitwise OR.

Example showing how to activate 4 channels:

SpcSetParam (hDrv, SPC_CHENABLE, CHANNEL0 CHANNEL1 CHANNEL2 CHANNEL3);

The following table shows all allowed settings for the channel enable register.

 

Channels to activate

 

 

 

 

Ch0

Ch1

Ch2

Ch3

Values to program

Value as hex

Value as decimal

X

 

 

 

CHANNEL0

1h

1

X

X

 

 

CHANNEL0 CHANNEL1

3h

3

X

 

X

 

CHANNEL0 CHANNEL2

5h

5

X

X

X

X

CHANNEL0 CHANNEL1 CHANNEL2 CHANNEL3

Fh

15

Any channel activation mask that is not shown here is not valid. If programming another channel activation the driver automatically remaps this to the best matching activation mask. You can read out the channel en- able register to see what channel activation mask the driver has set.

Reading out the channel enable register can be done directely after setting it or later like this:

SpcGetParam (hDrv, SPC_CHENABLE, &lActivatedChannels);

printf ("Activated channels are: %ld \n", lActivatedChannels);

Important note on channels selection

As some of the manuals passages are used in more than one hardware manual most of the registers and channel settings throughout this handbook are described for the maximum number of possible channels that are available on one board of the actual series. There can be less channels on your actual type of board or bus-system. Please refer to the table above to get the actual number of available channels.

Disabling the outputs

In contrast to simply not using one or more channels by setting the channel enable registers accordingsly, the outputs can also be set to a high impedance state(tristate). Because of the internal structure the outputs can only be disabled per module by the registers shown in the table below.

Register

Value

Direction

Description

SPC_DISABLEMOD0

203000

r/w

Disables the outputs of module 0 (channel 0 and channel 1). Outputs will go to high impedance.

SPC_DISABLEMOD1

203010

r/w

Disables the outputs of module 1 (channel 2 and channel 3). Outputs will go to high impedance.

(c) Spectrum GmbH

41

Page 41
Image 41
Spectrum Brands MI.61XX Analog Outputs, Channel Selection, Important note on channels selection, Disabling the outputs