Other Parts Discussed in Thread: MOTORWARE, LAUNCHXL-F28069M, DRV8301
Tool/software:
I have a LaunchXL-F28069M Launchpad and a DRV8301 motor driver and I have successfully made the motor spin using proj10d in motorware. I also have a CC2640R2 Bluetooth board receiving joystick data and I want to relay this data to the Launchpad F28069M through I2C. I have tested the I2C pins from the CC2640R2 and verified that the data is coming out as expected from that board. I have looked at the I2C_eeprom example in the SimpleLink C2000 sdk and tried to implement the same logic in the project 10d, but have had no success. I set all the appropriate registers similar the eeprom example, but when I look at the registers they do not have the values I set. I am not sure what I am doing wrong. Maybe there is something that is getting reset. I'm not sure. I am trying to use pins 32 and 33 of the f28069m board. Any help on remedying my issue would be greatly appreciated.
In the main function of proj10d, the Hal_setparams() is called and in turn calls Hal_setupGpios(). In this function I added code to imitate the same registers that were set in the i2c_eeprom example
I can see there was an i2c.h in the proj10d project. So I created an i2c.c file and initialized the i2c registers once again imitating the i2c_eeprom example and I call this just before the infinite loop that runs the motors
void I2C_init() { // // Initialize I2C // I2caRegs.I2CSAR= 0x0050; // 7-bit Slave address I2caRegs.I2CPSC.all = 6; // I2C clock between 7Mhz-12Mhz I2caRegs.I2CCLKL = 38; // Prescalers set for 100kHz bit rate I2caRegs.I2CCLKH = 38; // At a 10Mhz I2C clock I2caRegs.I2CIER.all = 0x0; //Disable Interrupts I2caRegs.I2CEMDR.all = 0X0020; // Take I2C out of reset return; }
However, when I run the program the registers are not set.