This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

clock cycles reading data from RAM

Other Parts Discussed in Thread: MSP430G2553

hi

i'm trying to make an PWM of an sine wave, 

i'm going to save my look_up table in the RAM of the MSP430G2553 .

i'm going to use one timer in up/down mode, the register TA0CCR0, will be fixed, to set the period of my carrier signal

but registers TA0CCR1 and TA0CCR2 need to be updated each time an CCIFG occurred. that mean i need to 

write something like this 

switch(TA0IV)

{

case  0x02 : TA0CCR1 = look_up_sine[pointer_position] ; break ;

case 0x04 : TA0CCR2 = look_up_sine[pointer_position] ; break ;

....

}

what i need to know is :

1) clock cycle of the switch statement

2) clock cycle of this operation : TA0CCR1 = look_up_sine[pointer_position] ;

thank you

  • The chip does not know nor care about c-code. It can only run machine code. The c-compiler translates c-code into machine code. But there is no deterministic way of doing so. As a result there is no deterministic number of clocks how a line of c-code takes.

    The best one can do is, list the object machine code and find out how many clocks that take.

**Attention** This is a public forum