Technical information

CSI to SPI Peripheral Communication in V850ES Microcontrollers
After processing the switches, main() returns to the top of the program loop to check switch states
again.
2.6.3 Temp_Init(): Initialize Temperature Sensor Interface
The Temp_Init() routine initializes the temperature sensors to prepare them for reading.
Temp_Init() first sets the chip selects for the two temperature sensors to the inactive state, and then
calls CSI00_Init() to initialize the clocked serial interface 00 for operation.
For the MAX6627 temperature sensor (TEMP1), temperature conversions are done once per
second, and the most recent conversion is available for reading at any time. No further initialization
is necessary.
For the DS1722 temperature sensor (TEMP2), the default power-up state is for 8-bit resolution (to
the nearest 1ÂșC), and to enter power-down mode. To program the device for 10-bit resolution and
for continuous conversion, the Configuration register must be set.
Figure 13. Temp_Init(): Initialize Temperature Sensor Interface
Yes
No
SendDone
== FALSE?
Yes
No
SendDone
== FALSE?
CALL CSI00_Init( )CALL CSI00_Init( )
CC
Return
BB
CALL CSI00_SetType3( )
TEMP2_CS_ON (P9H.6 = 1)
CALL CSI00_SetType3( )
TEMP2_CS_ON (P9H.6 = 1)
txbuf[0] = 0x80
txbuf[1] = 0xE4
txbuf[0] = 0x80
txbuf[1] = 0xE4
CSI00_SendDone = FALSE
CALL CSI00_SendData(txbuf, 2)
CSI00_SendDone = FALSE
CALL CSI00_SendData(txbuf, 2)
Delay 400ns from CS onDelay 400ns from CS on
TEMP1_CS_OFF (P9H.7 = 1)
TEMP2_CS_OFF (P9H.6 = 0)
TEMP1_CS_OFF (P9H.7 = 1)
TEMP2_CS_OFF (P9H.6 = 0)
DD
FF
TEMP2_CS_OFF (P9H.6 = 0)TEMP2_CS_OFF (P9H.6 = 0)
18