Download III - Renesas Electronics

Transcript
CHAPTER 8
APPLICATIONS OF SERIAL INTERFACE
(3) SPD chart
T2_6252
IF: SCK0 = LOW
THEN
Sets busy status
Sets BUSYFG
ELSE
STABIT
Issues start bit
Transmits slave address
WHILE: waits for end of transfer (CSIIF0 = 0)
IF: ACK signal not detected
THEN
Sets error status
ELSE
Sets ERRFG
IF: transmit mode
THEN
Transmits word address of µ PD6252
WHILE: waits for end of transfer
IF: ACK signal not detected
THEN
Sets error status
ELSE
Sets ERRFG
IF: changes to read mode
THEN
WHILE: SCK0 = HIGH
Outputs high level in order of data and clock
Changes slave address to read mode
GOTO STABIT
ELSE
Transmits data
WHILE: waits for end of transfer
IF: ACK signal not detected
THEN
Sets error status
ELSE
Sets ERRFG
Receives data
WHILE: waits for end of transfer
Stores receive data to memory
Outputs low level in order of clock and data
Issues stop bit
255