English
Language : 

UPSD3354DV-40U6 Datasheet, PDF (135/272 Pages) STMicroelectronics – fast 8032 MCU with programmable logic
UPSD33xx
I2C interface
Set bus START condition sampling
● SFR S1SETUP[7:0] = number of samples
Enable individual I2C interrupt and set priority
● SFR IEA.I2C = 1
● SFR IPA.I2C = 1 if high priority is desired
Set the Device address for Slave mode
● SFR S1ADR = XXh, desired address
Enable SIOE (as Slave) to return an ACK signal
● SFR S1CON.AA = 1
Master-transmitter
Disable all interrupts
● SFR IE.EA = 0
Set pointer to global data xmit buffer, set count
) ● *xmit_buf = *pointer to data
t(s ● buf_length = number of bytes to xmit
c Set global variables to indicate Master-Xmitter
du ● I2C_master = 1, I2C_xmitter = 1
ro Disable Master from returning an ACK
P ● SFR S1CON.AA = 0
te Enable I2C SIOE
le ● SFR S1CON.INI1 = 1
so Transmit Address and R/W bit = 0 to Slave
Ob ● Is bus not busy? (SFR S1STA.BBUSY = 0?)
- <If busy, then test until not busy>
t(s) ● SFR S1DAT[7:0] = Load Slave Address & FEh
● SFR S1CON.STA = 1, send START on bus
uc <bus transmission begins>
rod Enable All Interrupts and go do something else
● SFR IE.EA = 1
te P Master-receiver
leDisable all interrupts
so ● SFR IE.EA = 0
Ob Set pointer to global data recv buffer, set count
● *recv_buf = *pointer to data
● buf_length = number of bytes to recv
Set global variables to indicate Master-Xmitter
● I2C_master = 1, I2C_xmitter = 0
Doc ID 9685 Rev 7
135/272