12.07.2015 Views

1.1.1. I2C Registers (Base Address Refers to the Register ... - RoBoard

1.1.1. I2C Registers (Base Address Refers to the Register ... - RoBoard

1.1.1. I2C Registers (Base Address Refers to the Register ... - RoBoard

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NaBitAttributeme3 ARL R/WC2 SlaveSTP R/WC1 BBUSY RO0 MS_ RODescription1: Arbitration loss .Write 1 <strong>to</strong> this bit will clear <strong>to</strong> “0”1: Slave receive STOP conditionWrite 1 <strong>to</strong> this bit will clear <strong>to</strong> “0”The bus is considered <strong>to</strong> be busy after <strong>the</strong> Start condition and free again at a certaintime interval after <strong>the</strong> S<strong>to</strong>p condition.1 : Master mode (Default)0 : Slave mode<strong>Register</strong> Offset:<strong>Register</strong> Name:Reset Value:BA + Ah<strong>I2C</strong>1 My_<strong>Address</strong> <strong>Register</strong>00h7 6 5 4 3 2 1 0My Slave <strong>Address</strong>RsvdNaBitAttributeme7-1 My_Addr R/WDescription7-bits slave address which is checked by internal slave module. If address is match itwill switch <strong>to</strong> slave mode. Processor can write proper value in<strong>to</strong> this register <strong>to</strong> identifyitself0 Rsvd RO Reserved<strong>Register</strong> Offset:<strong>Register</strong> Name:Reset Value:BA + Bh<strong>I2C</strong>1 Transmit <strong>Address</strong> <strong>Register</strong>00h7 6 5 4 3 2 1 0TX Slave <strong>Address</strong>R/WNaBitAttributeme7-0 TX_Addr R/WDescription8-bit address register for Master <strong>to</strong> start a transaction. Processor can write this register<strong>to</strong> generate START + Slave <strong>Address</strong> + R/W on i2c bus. If Processor write a macrocodein<strong>to</strong> this register, it will send out macrocode and switch <strong>to</strong> high-speed mode at propertiming.


<strong>Register</strong> Offset:<strong>Register</strong> Name:Reset Value:BA + Ch<strong>I2C</strong>1 Transmit/Receive Data <strong>Register</strong>00h7 6 5 4 3 2 1 0DataBitNameAttributeDescription7-0 Data R/W8-bit data register for I 2 C-bus Tx/Rx operation. Processor can write this register <strong>to</strong>transmit DATA or read this register <strong>to</strong> receive data<strong>Register</strong> Offset:<strong>Register</strong> Name:Reset Value:BA + Dh<strong>I2C</strong>1 Clock Frequency Control10ah7 6 5 4 3 2 1 0PreScale1BitNameAttributeDescriptionProcessor can write this register value from 0 <strong>to</strong> 255 <strong>to</strong> control <strong>the</strong> frequency of SCLH7-0 PreScale1 R/WAt high speed Mode, SCLH frequency = 33M÷(PreScale1),PS: If PreScale1 < 10, SCLH frequency = 33M÷10 = 3.3Mhz<strong>Register</strong> Offset:<strong>Register</strong> Name:Reset Value:BA + Eh<strong>I2C</strong>1 Clock Frequency Control288h7 6 5 4 3 2 1 0FastPreScale2BitNameAttributeDescription7 Fast R/W 1: Fast mode , 0: Standard Mode6-0 PreScale2 R/WProcessor can write this register value from 0 <strong>to</strong> 255 <strong>to</strong> control <strong>the</strong> frequency of SCLAt F/S Mode, SCL frequency = 33M÷(PreScale1) ÷(PreScale2+1)


<strong>Register</strong> Offset:<strong>Register</strong> Name:Reset Value:BA + Fh<strong>I2C</strong>1 Extra Control <strong>Register</strong>00h7 6 5 4 3 2 1 0I2c_RST TX_hit_RX RsvNaBitAttribute Descriptionme7 I2c_RST R/WWrite “1” will reset i2c controller except pre-scale registers (for keep <strong>the</strong> speedsetting). After reset, Controller will send out 10 dummy clocks <strong>to</strong> ensure no any slavedriving data because of incomplete operation of <strong>the</strong> Master (maybe o<strong>the</strong>r master),au<strong>to</strong> clear after reset complete.6 TX_hit_RX R/OIndicate <strong>the</strong> TX address is written but may not send out because <strong>the</strong> slave is drivingfirst bit of data on bus,After data in rx_buffer is read back by software , hardware will continue <strong>to</strong> read slaveand nak it at <strong>the</strong> end, <strong>the</strong>n send re-start + address.5-0 Rsv RO Reserved

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!