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.

TMS320F28027: What is meaning of (3<<0)?

Part Number: TMS320F28027

hello,

I am currently working with pwm using adc program. when I am going through header files, I am finding the below statements which I am not able to interpret. please help.

what is meaning of (3<<0)??

#define PWM_AQCTL_ZRO_BITS              (3 << 0)

//! \brief Defines the location of the PRD bits in the AQCTL register
//!
#define PWM_AQCTL_PRD_BITS              (3 << 2)

//! \brief Defines the location of the CAU bits in the AQCTL register
//!
#define PWM_AQCTL_CAU_BITS              (3 << 4)

  • Hi Madhuri,

    Madhuri Depuru said:

    I am currently working with pwm using adc program. when I am going through header files, I am finding the below statements which I am not able to interpret. please help.

    what is meaning of (3<<0)??

    To understand the above bit shifting operation you need to be acquainted with the ACQTLx register. Here's the same:

    (3)d = (11)b

    So basically we're left shifting these 2 bits to secure the location of ZRO, PRD, CAU and so on.

    Hence, ZRO would be (3 << 0) means no shifting required (0011)b

    For PRD its (3<<2) means 2bits left shift is required (1100)b and so on for others.... CAU (3<<4) = (110000)b etc.

    Simply map this to the above register.

    Regards,

    Gautam

  • I suspect the shift of 0 is shown (3<<0) just for programming clarity and housekeeping.  The shifting is consistent with all the other definitions in the area.  The shift of 0 just means no shift needed, as Gautam said..

    Regards,

    David

  • thank you gautam an david

  • You're Welcome!
    (Please close the thread by verifying the Answer! Always open a new thread for new queries)

    Goodluck & Regards,
    Gautam