Jump to content


  • Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    mpigsley reacted to greeeg in While(1) not Executing with Timer Interrupt   
    You mentioned that uncommenting the LED toggle in your interrupt routine worked. From your code, the frequency of this will be 1000 times quicker than when you are running it through your ISR.
    CCR0 is set at 1000, ISR is called every 1000 clocks.
    s_cnt is incremented once per ISR. So s_cnt will reach 1000 after 1000*1000 clocks.
    It may have been working, but just slower than you expected, now that you switched to a quicker clock 1000 clocks happen around every second.
    Compared to about 30 seconds for the 32khz, or if you don't have a crystal attached then ACLK runs from the VLO which runs at 12khz and would take about a minute to toggle the LED.
  2. Like
    mpigsley reacted to oPossum in While(1) not Executing with Timer Interrupt   
    TA0CCR0 = 22; // Count limit Bump that to 100 or higher 
    You are very close to ISR overhead at 23 cycles.
  3. Like
    mpigsley got a reaction from pabigot in While(1) not Executing with Timer Interrupt   
    @@pabigot The capture compare flag needs to be manually reset after each ISR execution?
    From the user guide page 11-20:
    @@greeeg Even after removing Low Power Mode I'm still getting that starvation. 
  4. Like
    mpigsley reacted to greeeg in While(1) not Executing with Timer Interrupt   
    __enable_interrupt(); could be achieved by this
    _BIS_SR(GIE); // Enable interrupts GIE is your Global Interrupt Enable bit. and now you aren't entering sleep mode, so your code will continue running.
    FWIW, you probably should go to sleep in the while loop instead of spinning continually checking for a count change.
    while(1) { LPM0; //enter Low Power mode if (s_cnt == MS_TIME) { P1OUT ^= BIT6; // Toggle green LED s_cnt = 0; } } And then you would need to add a line to your interrupt to tell the processor to stay awake when the interrupt is processed. Place this inside your interrupt.
  5. Like
    mpigsley reacted to spirilis in Hardware UART & Two Servos   
    Yes  Also if I'm not mistaken, at least using the MSP430G2 LaunchPad, software UART should (in theory) work but you have to switch the UART jumpers up top to "SW" mode... in any case just make sure they're set to "HW" mode (jumpers facing left-right) and use the USCI_A peripheral instead.
  • Create New...