[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I2C and Peneral Purpose Port

Could someone enlighten me on the I2C interface and the general I/O. The I2C as far as I can see is just bit wiggling of portB and yet there seem to be a lot of configuration options apart from the direction control of port B, i.e setting I2C bits in R_PORT_PB_SET and R_PORT_PB_I2C. Is there more to it than just bit wiggling. I want 4 full com ports with handshakes using all bits on PORTA and PORTB (DTR/RTS/RI/CD) and  a SPI on part of the general purpose port g.
With regards to the general purpose port g0 to g31 which corresponds to a mixture of I/O, output only and input only how do you set a individual bit in output only without corrupting other output only bits. I assume if you write to g25 out  (A20) and then read you will read g25 in (C20) so have to keep a shadow copy for bit set and clears rather than doing a AND modify (Read modify write). Is this the case