Technical information

SCI to SPI Peripheral Communication in V850ES Microcontrollers
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.
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.
After the first byte is written to the transmit register, the pointer is incremented to point to the next
byte, and the count is incremented (to one). The routine returns at this point. When the first byte
has finished transmission, the INTCSI00 interrupt will occur, and the MD_INTCSI00() interrupt
service routine will handle further transmission and reception.
2.6.8 CSI00_ReceiveData(*rxbuf, rxnum): Prepare To Receive Data on CSI00
The CSI00_ReceiveData() routine sets up for data to be received using CSI00. The rxbuf
parameter is a pointer to an array of bytes to receive the data, and the rxnum parameter is the
number of bytes to receive.
The routine stores the parameters passed in local copies used in the MD_INTCSI00 interrupt
service routine. The CSI00_RX_LEN variable is the number of bytes to receive, and is set to
rxnum; CSI00_RX_CNT is the number of bytes received so far, and is initialized to zero;
CSI00_RX_ADDRESS is the address of the next byte to store received data, and is initially set to
the txbuf pointer passed.
The routine then returns without any access to the CSI00 peripheral. The values set will be used in
the MD_INTCSI00() interrupt service routine when INTCSI00 occurs. To have the interrupt occur,
CSI00_SendData() must be called to start a transmission operation.
23