cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Implementation

moshikome
Associate II
Posted on September 22, 2003 at 20:01

I2C Implementation

4 REPLIES 4
alec
Associate
Posted on May 17, 2011 at 11:54

1. After setting bits 6&7 of P3SFS (to enable I2C fn on these pins) and setting the CLK freq bits in S2CON, Write slave address data to S2DAT, and set STA.

2. Yes, this is legal.

3. No, just write a dummy byte, and go to step 1

4. You can clear ENI after all I2C transactions are complete

5. The slave will send its last ACK after the final data byte is received, but before the STOP condition.

moshikome
Associate II
Posted on May 17, 2011 at 11:54

Hi,

I m implementing the I2C protocol Master transmitter mode based on the I2C hardware in the uPSD3200 .

I have few questions regarding the programmer's Guide appears in the uPSD3200 datasheet (page 71) .

1.How do i configure the MCU to operate in Master Transmitter Mode?

2. I m not using an interrupt routine for the I2C interrupt(it is

disabled) but instead i m polling the S2STA register .

Is this kind of implementation legal ?

3.According to the programmer's guide ,in the first spep after wrting

the slave address ,we check BLOST and /ACK_REP bits .

If One or both are set we write dummy data .

Is this dummy data is one byte only?

What about the STOP bit shouldn't it be set after the dummy write ?

Should we after the dummy write clear the STA and ENI bits ?

4.According to step 6,after sending the last byte and setting the STO

bit ,we write dummy data to S2DAT .

What about clearing the ENI bit?Should it be cleared at step 6 after

the dummy write or before?

5.After setting STO bit, do we still wait for an ACK from the slave?

moshikome
Associate II
Posted on May 17, 2011 at 11:54

Thanks for the help.

I have another question regarding the I2C implementation of master transmitter.

After sending the start command and slave address , if i want to send the next data byte after several mili seconds interval and NOT micro seconds, can i leave the connection opened? Is it possible in I2C or it compels to send all bytes within microseconds?
the_vice1304
Associate II
Posted on May 17, 2011 at 11:54

Yes... it seems there are no timing limitation into I2C protocol between one byte and the next .

[ This message was edited by: TheVice on 22-09-2003 23:40 ]