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.

MSP430FR2355: TIDA 010056

Part Number: MSP430FR2355

Hello  I want to know why there is two bit right shift of ADC RESULT for SPPED REF value in given TIDA Trapezoidal code? This is what written in code.


ADC_RESULT = ADCMEM0;
SPEED_REF = (ADC_RESULT>>2);

  • Hi Raj,

    Good question.  Let me track down someone that can answer this for you.

  • Hi Raj,

    According to the author of TIDA010056:

    " The code is only a scaling. The speed command (max 3.3V) signal is read by the 12-bit ADC giving maximum result of 4095. The SPEED_REF value is compared with the PWM_PERIOD (max value defined as 600 in the code) to generate PWM signal. Using two bit right shift to ADC result, the maximum value of SPEED_REF will be 1023 (=4095/4). Now SPEED_REF = 600, will give 100% duty cycle and this means, as the analog input voltage changes from 0 to 2V (approx.), the duty cycle vary from minimum to maximum. User can adjust these scaling as per the requirement."

    Does this answer your question?

  • Hi Raj,

    It's been a few days since I have heard from you so I’m assuming your question has been answered.
    If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

**Attention** This is a public forum