Hi,
I have a project using MSP430F1222.
CPU oscillator is 6.4MHz. this is the frequency of timer A tick too.
In the ISR of timer A CC0 I measure how many ticks it takes to execute the following code:
setSCL();
CAPTURE_REGISTER += getMaxTime(MIN_CLOCK_HIGH, MIN_DATA_OUT_HOLD_TIME); // set next compare value
where:
static inline void setSCL(void){
SCL_PORT_OUT |= 1 << SCL_PIN_NUMBER;
};
static inline u_int_16 getMaxTime(TIMING_PARAMETERS Time1, TIMING_PARAMETERS Time2)
{
if (TimingParameterInTicks[Time1] > TimingParameterInTicks[Time2]){
return TimingParameterInTicks[Time1];
}else{
return TimingParameterInTicks[Time2];
}
}
It takes 4300 timer A ticks and I see this period using logic analyzer also.
Too many ticks.
timer A is fed from SMCLK.
what may be the reason?