Other Parts Discussed in Thread: C2000WARE
Hello,
I need help, advice.. with I2C on F28379d.
I would like port code from ATMEGA to the F28379 but MPU6050 breakboard don't send ACK when it receive his address
Electricaly, evrything is OK (of course, the MPU6050 breakboard is working, I check with an ATMEGA64)
I wrote my code from the C2000Ware example (I remove interruption)
Hereafter my code, I reduce it to the minimum!
// // Included Files // #include "driverlib.h" #include "device.h" // // Defines // #define SLAVE_ADDRESS 0x68 // Function Prototypes void initI2C(void); void main(void) { // Initialize device clock and peripherals Device_init(); // Disable pin locks and enable internal pullups. Device_initGPIO(); // Initialize GPIOs 105 SCL A and 104 SDA A GPIO_setPinConfig(GPIO_104_SDAA); GPIO_setPadConfig(104, GPIO_PIN_TYPE_PULLUP); GPIO_setQualificationMode(104, GPIO_QUAL_ASYNC); GPIO_setPinConfig(GPIO_105_SCLA); GPIO_setPadConfig(105, GPIO_PIN_TYPE_PULLUP); GPIO_setQualificationMode(105, GPIO_QUAL_ASYNC); initI2C(); while(1) { HWREGH(I2CA_BASE + I2C_O_SAR) = SLAVE_ADDRESS; HWREGH(I2CA_BASE + I2C_O_CNT) = 2; HWREGH(I2CA_BASE + I2C_O_DXR) = 0xAA; //for test HWREGH(I2CA_BASE + I2C_O_DXR) = 0x55; // HWREGH(I2CA_BASE + I2C_O_MDR) = 0x2E20; while (((HWREGH(I2CA_BASE + I2C_O_STR) & I2C_STR_ARDY) == I2C_STR_ARDY) == 0); } } // // initI2C - Function to configure I2C A in FIFO mode. // void initI2C() { // Must put I2C into reset before configuring it I2C_disableModule(I2CA_BASE); // I2C configuration. Use a 100kHz I2CCLK with a 50% duty cycle. I2C_initMaster(I2CA_BASE, DEVICE_SYSCLK_FREQ, 100000, I2C_DUTYCYCLE_50); I2C_setBitCount(I2CA_BASE, I2C_BITCOUNT_8); I2C_setSlaveAddress(I2CA_BASE, SLAVE_ADDRESS); I2C_setEmulationMode(I2CA_BASE, I2C_EMULATION_FREE_RUN); // FIFO configuration I2C_enableFIFO(I2CA_BASE); // Configuration complete. Enable the module. I2C_enableModule(I2CA_BASE); }
I don't understand where can be the problem!
Thanks for answers