Duty Cycle Problem with Texas Instruments MSP430

Discussion in 'Embedded Systems and Microcontrollers' started by johndeaton, Jan 28, 2017.

  1. johndeaton

    Thread Starter Member

    Sep 23, 2015
    63
    4
    Hi All,

    I'm having a very weird issue when changing the duty cycle on this processor. I have posted the issue on the TI website, so I won't re-post here. If anyone has time to look and see if they have any suggestions, I would appreciate it. Here is the link to the forum post...

    https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/569409

    Regards,
    John
     
  2. MrChips

    Moderator

    Oct 2, 2009
    18,711
    5,943
    I am going to hazard a guess that proper forum etiquette would be to post the information here in its entirety. This avoids having to go back and forth between two forums.
     
    djsfantasi likes this.
  3. MrChips

    Moderator

    Oct 2, 2009
    18,711
    5,943
    Make sure that any new updates to the counter register falls within the range of acceptable register values.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    18,711
    5,943
    I copied your code over to a MSP430G2553.
    I cannot replicate your symptoms. I am not using interrupts. Are you using interrupts in your code?

    Update: I can see it now on the scope. This will require further investigation.
    I am not using interrupts.
     
  5. MrChips

    Moderator

    Oct 2, 2009
    18,711
    5,943
    I suspect that the glitch is caused by trying to write into TACCR1 and TACCR2 on the fly while the TA0R register is on the move.
    Use interrupts and write into TACCR1 and TACCR2 only when TACCR0 interrupts.
     
Loading...