HDQ and 1-Wire Protocols
7-189
MPU Public Peripherals
An interrupt condition indicates either a TX complete, RX complete, or time-out
condition. The read of the interrupt status register clears all the interrupt condi-
tions. Only one interrupt signal is sent to the microcontroller and only an overall
mask bit exists for the enabling and disabling of the interrupt. Each of the inter-
rupt conditions cannot be individually masked.
The following sequence must be performed by the programmer for the reads
and writes to the slave:
Write operation:
1) Write the ID, command, or data value to the TX write register.
2) Write 0 to the R/W bit of the control and status register to indicate a write.
3) Write 1 to the go bit of the control and status register to start the actual
transmit. This step and the above step can be done at the same time.
a) The hardware sends the one byte of the TX write data register.
b) The time-out bit is always cleared in a write.
c)
The completion of the operation sets the TX complete flag in the inter-
rupt status register. If interrupts are masked, no interrupt is generated.
The interrupt status register is always cleared at the beginning of any
read or write operation.
d) At the end of the write the go bit is cleared.
4) If interrupt is enabled, software must read the interrupt status register to
clear the interrupt.
5) Repeat for each successive byte.
Read operation:
1) Write the ID value to the TX write register.
2) Write 0 to R/W bit and 1 to the go bit and wait for TX complete interrupt.
3) Write the command value to the TX write register.
4) Write 0 to R/W bit and 1 to the GO bit and wait for TX complete interrupt.
5) Write 1 to the R/W bit of the control and status register to indicate a read.
6) Write 1 to the go bit of the control and status register to start the actual
read. This step and the above step can be done at the same time.
a) The hardware creates a low-going edge of the line (created by the
slave), and clocks 8 bits of data into the RX receive buffer register. The
first bit that is received from the slave is the LSB and the last bit is the
MSB of the byte.