Jump to content


  • Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    athornsb reacted to spirilis in Rotary encoder issue, help needed!   
    Definitely recommend debouncing.  Also I've seen a confusing one before, a rotary encoder I bought off mouser used gray code but it had "detents" which resulted in strange behavior--the two pulses were far apart initially (as the dial moved between detents), but both fired almost simultaneously (or well within the scope of interrupt service routine latency) when it reached the next detent ("click" in the rotation).  Required significant rework of the code and I only caught it with my Logic Analyzer running at high speed.
  2. Like
    athornsb reacted to RobG in Timer0_A0 and Port 2 interrupt priority issue.   
    How fast is the encoder spinning? How many contacts does it have, two?
    You can get the code from the example app that is loaded on every LaunchPad.
    Here are your WDT options (from the header file,) and remember that you can always change your clock to get different intervals. 
    /* WDT-interval times [1ms] coded with Bits 0-2 */ /* WDT is clocked by fSMCLK (assumed 1MHz) */ #define WDT_MDLY_32 /* 32ms interval (default) */ #define WDT_MDLY_8 /* 8ms " */ #define WDT_MDLY_0_5 /* 0.5ms " */ #define WDT_MDLY_0_064 /* 0.064ms " */ /* WDT is clocked by fACLK (assumed 32KHz) */ #define WDT_ADLY_1000 /* 1000ms " */ #define WDT_ADLY_250 /* 250ms " */ #define WDT_ADLY_16 /* 16ms " */ #define WDT_ADLY_1_9 /* 1.9ms " */
  3. Like
    athornsb reacted to ike in Timer0_A0 and Port 2 interrupt priority issue.   
    Of course that code will not work for your application, as I told you: You will have to modify it.
    With WDT_MDLY_8 you have 8ms and with WDT_MDLY_0_5 you have 0.5ms intervals, if you use fSMCLK @ 1MHz.
  4. Like
    athornsb reacted to spirilis in Unusual Power Draw - Launchpad   
    Ah, was asking about the Renesas chips
    For the ADC, the main bit I'm talking about is this excerpt from page 551 of the x2xx User's Guide (slau144i)-
  5. Like
    athornsb reacted to spirilis in Unusual Power Draw - Launchpad   
    If you're using a timer-based debounce and putting the chip into LPM3 in between, that is pretty low power--and one distinct quality of these MSP430's (particularly Value Line chips) is that they wake up *fast*, like within the span of 1 or 2 clock cycles of the DCO they're awake.  It's cheap to wake up, check something real quick and return from the ISR (without doing the __bic_SR_register_on_exit()).
    The ADC shouldn't be running if it's not doing a conversion.  Its ADC10OSC turns on/off as needed (assuming that is what you've selected for it).  I was just reading the MSP430 x2xx User's Guide on this last week, it's meant to facilitate very-low-power applications.
    Also very minor/non-consequential nitpick: You don't need to set the XCAP_* settings with VLOCLK, those only apply when using an external 32.768KHz watch crystal on P2.6/P2.7 as your ACLK.
    Lastly: Your pushbutton config should have a "P1OUT |= 0x08;" to make sure it's the pullUP resistor that gets turned on, not the pullDOWN resistor.  P1REN |= 0x08; enables the resistor; P1OUT determines whether it's pullUP (bit set to 1) or pullDOWN (bit set to 0).
  6. Like
    athornsb reacted to roadrunner84 in Unusual Power Draw - Launchpad   
    Have you taken LED power usage in account?
    Have you connected a resistor from RST to Vcc and a capacitor from RST to ground?
    Set P2SEL to 0 to set P1.6 and P1.7 to IO mode instead of crystal mode.
  7. Like
    athornsb reacted to cubeberg in Unusual Power Draw - Launchpad   
    There is some information in the "getting started" labs about testing the device for low-current - might be helpful for reference.
    I was going to mention a potential issue with your DMM as well - the TI lab workbook mentions that some can't measure the tiny amounts of current used by the MSP.  
  8. Like
    athornsb reacted to spirilis in Unusual Power Draw - Launchpad   
    Hmm, not that I know of... I assume your multimeter is designed to handle uA measurements?  If not, something like the "uCurrent" might be needed for accurate measuring-- http://www.eevblog.com/projects/ucurrent/
  9. Like
    athornsb reacted to spirilis in Unusual Power Draw - Launchpad   
    Not to mention configure P2DIR, similar to what you're doing with P1DIR...
    G2553 is also capable of a P3 (in 28-pin TSSOP models), this means all models of G2553 will have a P3 onboard (but for the 20-pin DIP and TSSOP versions, none of the P3.x ports are broken out to physical pins; however the hardware is still there, using up power from the schmitt triggers responding to noise on-die.)
    So set P3DIR = 0xFF; too.
    Actually another variation of this is to keep the P3 in input mode (P3DIR = 0x00;) but enable the Pull-down resistor (the datasheet explicitly says this for the 20-pin variants anyhow):
    P3DIR = 0x00;
    P3OUT = 0x00;
    P3REN = 0xFF;
    P3SEL = 0x00;
    P3SEL2 = 0x00;  // for completeness
    If you're not using P2 at all, for completeness here's the total solution for quieting P2 & P3:
    P2SEL = 0x00;
    P2SEL2 = 0x00;
    P2OUT = 0x00;
    P2DIR = 0x00;
    P2REN = 0xFF;
    P3SEL = 0x00;
    P3SEL2 = 0x00;
    P3OUT = 0x00;
    P3DIR = 0x00;
    P3REN = 0xFF;
  • Create New...