|
UPSD33XX Datasheet, PDF (111/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic | |||
|
◁ |
uPSD33xx
Else If mode is Slave-Receiver:
Is this Intr from SIOE detecting a
STOP on bus?
If Yes, a STOP was detected:
â recv_buf[buffer_index] = S1DAT,
get last byte
â Exit ISR, Master has sent last byte
If No, a STOP was not detected,
continue:
Determine if this Interrupt is from
receiving an address or a data byte
from a Master.
Is (S1CON.ADDR = 1 and S1CON.AA =1)?
If No, intr is from receiving
data, goto C:
If Yes, intr is from an address,
continue:
â slave_is_adressed = 1, local vari-
able set true
<indicates Master selected this
slave>
â S1CON.ADDR = 0, clear address
match flag
Determine if R/W bit indicates trans-
mit or receive.
Does status.TX_MODE = 1?
If Yes, Master wants transmit
mode
â Exit ISR, indicate Master wants
Slv-Xmit mode
If No, Master wants Slave-Recv
mode
â dummy = S1DAT, read to release bus
â Exit ISR, ready to recv data on
next interrupt
C: (Interrupt is from Slv receiving
data from Mastr)
â recv_buf[buffer_index] = S1DAT,
read byte
â Exit ISR, recv next byte on next
interrupt
111/231
|
▷ |