mc33991dwr2 Freescale Semiconductor, Inc, mc33991dwr2 Datasheet - Page 33

no-image

mc33991dwr2

Manufacturer Part Number
mc33991dwr2
Description
Gauge Driver Integrated Circuit
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Analog Integrated Circuit Device Data
Freescale Semiconductor
/* Step 15 */
}void Command_Gauge(char MSB, char LSB)
{
}
/* Motorola Semiconductor Products Sector */
/* October 4, 2002 */
Command_Gauge(0x10,0x00);
/* Step 16 */
Command_Gauge(0x80,0x02);
/* Step 17 */
Command_Gauge(0x10,0x00);
/* Step 18 */
Command_Gauge(0x80,0x03);
/* Step 19 */
Command_Gauge(0x10,0x00);
/* Step 20 */
Command_Gauge(0x00,0x00);
/*This subroutine sends the GDIC commands on the SPI port */
PORTS = 0x00;
SP0DR = MSB;
While ((SP0SR & 0x80) == 0);
RTZdata = SP0DR;
SP0DR = LSB;
While ((SP0SR & 0x80) == 0);
status = SP0DR;
PORTS = 0x04;
/* Check SO bit ST4 to see if Gauge 0 has moved */
If((status & 0x10) != 0)
/* If it has moved, then keep track of position */
/* Wait until 24 steps are finished then send a RTZ command (Step 17) */
/* Read Status until RTZ is done */
While ((status & 0x04) != 0)
/* Read Status until RTZ is done */
While ((status & 0x08) != 0)
/* Put device to sleep by setting RSTB to logic 0 */
{Command_Gauge(0x10,0x00);}
{Command_Gauge(0x01,0x00);}
/* Null Read to get status */
/* Send RTZ to Gauge 0 */
/* Null Read to get status */
/* Send RTZ to Gauge 1 */
/* Null Read to get status */
/* Disable Gauges and go into Standby */
/* Chip select low (active) */
/* send first byte of gauge command */
/* wait for Rxflag (first byte) */
/* Read status MSB */
/* send second byte of command */
/* wait for Rxflag (second byte) */
/* read status LSB */
/* Chip select high (deactivated) */
TIMING DESCRIPTIONS AND DIAGRAMS
SAMPLE CODE
33991
33

Related parts for mc33991dwr2