硬件反复检查过,没问题,作为主机可以发出来.
0. set pin function is I2C
1. Write: Control Register 2
• to enable or disable general call
• to select 10-bit or 7-bit addressing mode
2. Write: Address Register 1 to set the slave address
3. Write: Control Register 1 to enable the I2C module and interrupts
4. Initialize RAM variables (IICEN = 1 and IICIE = 1) for transmit data
5. Initialize RAM variables used to achieve the routine shown in the following figure
//------------------------代码----------------------------------
_i2c_init_pin_mux(CHANNEL_1);
I2C_C2(CHANNEL_1) = 0x0; //general call disabled, 7-bit address
I2C_A1(CHANNEL_1) = addr << 1;
I2C_C1(CHANNEL_1) = I2C_C1_IICEN_MASK | I2C_C1_IICIE_MASK | 0;
//---------------------------------------------------------------
就是进不了中断
|