English
Language : 

UPSD33XX Datasheet, PDF (110/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic
uPSD33xx
Else If mode is Master-Receiver:
Bus Arbitration
tus.BLOST=1?)
lost?
(sta-
If Yes, Arbitration was lost:
– S1DAT = dummy, write to release bus
– Exit ISR, SIOE will switch to Slave
Recv mode
If No, Aribitration was not
lost, continue:
Is this Interrupt from sending an ad-
dress to Slave, or is it from receiv-
ing a data byte from Slave?
If its from sending Slave ad-
dress, goto A:
If its from receiving Slave da-
ta, goto B:
A: (Interrupt is from Master sending
addr to Slave)
ACK recvd from Slave? (sta-
tus.ACK_RESP=0?)
If No, an ACK was not received:
– S1CON.STO = 1, set STOP condition
<STOP occurs after ISR exit>
– dummy = S1DAT, read to release bus
– Exit ISR
If Yes, ACK was received, then
continue:
– dummy = S1DAT, read to release bus
Does Master want to receive just one
data byte?
If Yes, do not allow Master to
ACK on next interrupt:
<S1CON.AA is already 0>
– Exit ISR, now ready to recv one
byte from Slv
If No, Master can ACK next byte
from Slv
– S1CON.AA = 1, allow Master to send
ACK
– Exit ISR, now ready to recv data
from Slave
B: (Interrupt is from Master recving
data from Slv)
– recv_buf[buffer_index] = S1DAT,
read byte
Is this the last data byte to receive
from Slave?
If Yes, tell Slave to stop
transmitting:
– S1CON.STO = 1, set STOP bus condi-
tion
<STOP occurs after ISR exit>
– Exit ISR, finished receiving data
from Slave
If No, continue:
Is this the next to last byte to re-
ceive from Slave?
If this is the next to last
byte, do not allow Master to ACK
on next interrupt.
– S1CON.AA = 0, don’t let Master re-
turn ACK
– Exit ISR, now ready to recv last
byte from Slv
If this is not next to last
byte, let Master send ACK to
Slave
<S1CON.AA is already 1>
– Exit ISR, ready to recv more bytes
from Slave
Else If mode is Slave-Transmitter:
Is this Intr from SIOE detecting a
STOP on bus?
If Yes, a STOP was detected:
– S1DAT = dummy, write to release bus
– Exit ISR, Master needs no more data
bytes
If No, a STOP was not detected,
continue:
ACK recvd from Master? (sta-
tus.ACK_RESP=0?)
If No, an ACK was not received:
– S1DAT = dummy, write to release bus
– Exit ISR, Master needs no more data
bytes
If Yes, ACK was received, then
continue:
– S1DAT = xmit_buf[buffer_index],
transmit byte
– Exit ISR, transmit next byte on
next interrupt
110/231