Powerdown and reset – Spectrum Brands MC.31XX User Manual

Page 40

Advertising
background image

40

MC.31xx Manual

Powerdown and reset

Programming the Board

Example program for the board initialization

The following example is only an exerpt to give you an idea on how easy it is to initialize a Spectrum board.

Powerdown and reset

Every Spectrum board can be set to powerdown mode by software. In this mode the board is therefore consuming less power than in normal
operation mode. The amount of saved power is board dependant. Please refer to the technical data section for details. The board can be set
to normal mode again either by performing a reset as mentioned below or by starting the board as described in the according chapters later
in this manual.

If the board is set to powerdown mode or a reset is performed the data in the on-board will be no longer
valid and cannot be read out or replayed again.

Performing a board reset or powering down the board can be easily done by the related board commands mentioned in the following table.

// ----- Initialization of PCI Bus Boards -----------------------------------
if (SpcInitPCIBoards (&nCount, &nPCIBusVersion) != ERR_OK)
return;

if (nCount == 0)
{
printf ("No Spectrum board found\n");
return;
}

// ----- request and print Board type and some information ------------------
SpcGetParam (hDrv, SPC_PCITYP, &lBrdType);
SpcGetParam (hDrv, SPC_PCIMEMSIZE, &lInstMemsize);
SpcGetParam (hDrv, SPC_PCISERIALNO, &lSerialNumber);

// ----- print the board type depending on bus. Board number is always the lower 16 bit of type -----
switch (lBrdType & TYP_SERIESMASK)
{
case TYP_MISERIES:
printf ("Board found: MI.%x sn: %05d\n", lBrdType & 0xffff, lSerialNumber);
break;

case TYP_MCSERIES:
printf ("Board found: MC.%x sn: %05d\n", lBrdType & 0xffff, lSerialNumber);
break;

case TYP_MXSERIES:
printf ("Board found: MX.%x sn: %05d\n", lBrdType & 0xffff, lSerialNumber);
break;
}

printf ("Memory on board: %ld MBytes (%ld MSamples)\n", lInstMemsize /1024/1024, lInstMemsize /1024/1024 /2);
printf ("Serial Number: %05ld\n", lSerialNumber);

Register

Value

Direction

Description

SPC_COMMAND

0

r/w

Command register of the board.

SPC_POWERDOWN

30

Sets the board to powerdown mode. The data in the on-board memory is no longer valid and cannot be read out or
replayed again. The board can be set to normal mode again by the reset command or by starting the boards.

SPC_RESET

0

A software and hardware reset is done for the board. All settings are set to the default values. The data in the board’s
on-board memory will be no longer valid.

Advertising