25.02.2013 Views

1993_Motorola_Linear_Interface_ICs_Vol_2.pdf

1993_Motorola_Linear_Interface_ICs_Vol_2.pdf

1993_Motorola_Linear_Interface_ICs_Vol_2.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SPI TRANSFER LOOP<br />

MC33298<br />

;Set the number of Read/Shift cycles.<br />

LOOP ASL DATAIN ;Shift a Zero into LSB of DATAIN and ASL other bits.<br />

ASL DTOUT ;Test value currently in MSB of DTOUT.<br />

BCS DOONE ;<br />

BCLR 7,PORTA ;MSB was Zero, so clear DATA OUT bit.<br />

JMP GOON<br />

DOONE BSET 7,PORTA ;MSB was One, so set the DATA OUT bit.<br />

GOON BSET 6,PORTA ;Set the SCLK. Serial Output pin of the MC33298 changes state on the rising edge of the SCLK.<br />

Read the next bit coming from the MC33298.<br />

BRCLR O,PORTA, ;Read the bit and branch if Zero. LSB of DATAIN is already cleared due to the ASL above.<br />

WZZERO<br />

BSET O,DATAIN ;Bit was One. Set the next bit in DATAIN.<br />

WZZERO BCLR 6,PORTA ;Clear SCLK. Falling edge causes the MC33298 to read the next bit from the MCU.<br />

DECX<br />

ESTABLISH A BRIEF DELAY<br />

BPL LOOP ;Continue to loop eight times until the SPI transfer is complete.<br />

LOA #16<br />

PAUSE DECA ;3 Clock cycles<br />

BNE PAUSE ;3 Clock cycles<br />

;Transfer control signal to output transistors.<br />

BCLR 5,PORTA ;Transfer output status to Serial Register.<br />

JSR FLTCHK ;Jump to Fault Check subroutine.<br />

JSR DLY ;Delay 11T msec<br />

SUBROUTINE TO CHECK FOR FAULTS<br />

FLTCHK BCLR<br />

LDA<br />

CMP<br />

BEQ<br />

BSET<br />

NOFLT RTS<br />

;Deselect the MC33298.<br />

;Return to top of loop.<br />

1 ,PORTA ;CLR the Fault pin.<br />

DATAIN<br />

VALUE ;Check for Faults.<br />

NOFLT ;If there is no Fault, continue.<br />

1,PORTA ;Activate Fault LED.<br />

MOTOROLA LINEAR/INTERFACE <strong>ICs</strong> DEVICE DATA<br />

10-97<br />

IDI I

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!