Technical information
CSI to SPI Peripheral Communication in V850ES Microcontrollers
Figure 16. CSI00_SetType4(): Set CSI00 Peripheral for Type 4 Interface
CSI0E0 = 0 (CSIM00.7) to disableCSI0E0 = 0 (CSIM00.7) to disable
CKP0 = 1 (CSIC0.4)
DAP0 = 1 (CSIC0.3) for Type-4
CKP0 = 1 (CSIC0.4)
DAP0 = 1 (CSIC0.3) for Type-4
Return
EE
CSI0E0 = 1 (CSIM00.7) to enableCSI0E0 = 1 (CSIM00.7) to enable
2.6.7 CSI00_SendData(*txbuf, txnum): Start CSI Data Transmission
The CSI00_SendData() routine sets up and starts a transmission operation using CSI00. The txbuf
parameter is a pointer to an array of bytes to transmit, and the txnum parameter is the number of
bytes to transmit.
First the routine stores the parameters passed in local copies used in the MD_INTCSI00 interrupt
service routine. The CSI00_TX_LEN variable is the number of bytes to transmit, and is set to
txnum; CSI00_TX_CNT is the number of bytes sent so far, and is initialized to zero;
CSI00_TX_ADDRESS is the address of the next byte to send, and is initially set to the txbuf
pointer passed.
Figure 17. CSI00_SendData(*txbuf, txnum): Start CSI Data Transmission
Return
FF
CSI00_TX_LEN = txnum
CSI00_TX_CNT = 0
CSI00_TX_ADDRESS = txbuf
CSI00_TX_LEN = txnum
CSI00_TX_CNT = 0
CSI00_TX_ADDRESS = txbuf
SOTB0L = *CSI00_TX_ADDRESS
CSI00_TX_ADDRESS ++
CSI00_TX_CNT ++
SOTB0L = *CSI00_TX_ADDRESS
CSI00_TX_ADDRESS ++
CSI00_TX_CNT ++
Then to start the transmit operation, the first byte pointed to is written to the SOTB0L register. The
write to this register starts the CSI00 peripheral clocking the SCK00 output, shifting data out on the
SO00 output, and clocking data in on the SI00 input. The timing and phase of the data transmission
depends on the transfer type set.
22