Hello everyone,
I was able to have our custom board running fine thanks to the help from the forum to properly configure the eUSCI in I2C mode with driverlib.
Now, we need to reduce the power consumption as much as possible, so the first thing I wanted to do is to use the ACLK instead of the SMCLK as clock
for the I2C. Well,piece of cake!.....I thought.....
It seems that for some reason my ACLK is not properly starting.....basing my code on the example I found in the Resource Explorer, this is what I do to configure the ACLK
int main(void) { volatile uint32_t j; PMM_unlockLPM5(); WDT_A_hold(WDT_A_BASE); // Configure Pins for XIN and XOUT //Set P2.0 and P2.1 as Module Function Input. GPIO_setAsPeripheralModuleFunctionInputPin( GPIO_PORT_P2, GPIO_PIN0 + GPIO_PIN1, GPIO_PRIMARY_MODULE_FUNCTION ); PMM_unlockLPM5(); //Initializes the XT1 crystal oscillator with no timeout //In case of failure, code hangs here. //For time-out instead of code hang use CS_turnOnXT1LFWithTimeout() CS_turnOnXT1LF( CS_XT1_DRIVE_0 ); CS_initClockSignal( CS_ACLK, CS_XT1CLK_SELECT, CS_CLOCK_DIVIDER_1 ); //clear all OSC fault flag CS_clearAllOscFlagsWithTimeout(1000); //Enable oscillator fault interrupt SFR_enableInterrupt(SFR_OSCILLATOR_FAULT_INTERRUPT); uint32_t clkValue = CS_getACLK(); /* The application continues with I2C readings ... ... ... */
And the problem is that later in the code I got stuck in I2C operations, simply because the clkValue is = 0. So, I assume the ACLK is not starting.
Assuming that the crystal is mounted correctly on the PCB (XT1 is a 32K crystal, between P2.0 and P2.1, as for instructions), do you have any suggestions on what I should check to see what is wrong here?
Thanks in advance,
Lorenzo