Jump to content

Search the Community

Showing results for tags 'WDT'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 4 results

  1. While debugging my code this weekend I decided to step back and try to debug certain aspects of it. TI's Resource Explorer is a great tool with plenty of example code to look at and review. I was having issues with my WDT routine so I thought I would double check running one of the examples that was released, to be specific, I was interest in the WDT_02 example which can be seen here. The code was not working which really left me wondering since I assumed that any code published BY TI as an example MUST have been checked to see if it actually worked?! Well as it turns out the code does NOT work and has an error in it (actually more than 1). I posted over on TI's e2e forums and for a little detail you can look at that post here. For those that just want to know what is wrong, this line of code: WDTCTL = WDTIS_4; // WDT 250ms, ACLK, interval timer Needs to be modified to: WDTCTL = WDTIS_5 | WDTTMSEL | WDTSSEL_1 | WDTCNTCL | WDTPW; // WDT 250ms, ACLK, interval timer Hopefully the next person left scratching their head wondering what's wrong will find this post and not have to waste time trying to figure out what is going on.
  2. Colleagues, The circuit that I'm working on is based on an 8-pin MSP430G2210. The RST#/NMI serves as a soft on/off switch. While the device is on, it will use the WDT in the interval mode for cyclic sleep (at least, that's my intent). I was able to make the NMI# interrupt work to wake up from LPM4. Separately, I was able to make the WDT interrupt work to wake up from LPM3. But I wasn't able to make them work together. // PURPOSE: Keep track of button presses #pragma vector=NMI_VECTOR __interrupt void nmi_isr(void) { g_nmiFlag = true; // set a flag, which will be examined in the main() loop for (volatile unsigned int i = 20000; i != 0; --i); // allow some time for contact bouncing to settle IFG1 &= ~NMIIFG; // re-clear NMI flag if there was bouncing IE1 |= NMIIE; // enable NMI __bic_SR_register_on_exit(LPM4_bits); // exit the LPM on return from the ISR } // PURPOSE: Allow cyclic wake up. #pragma vector=WDT_VECTOR __interrupt void wdt_isr(void) { __bic_SR_register_on_exit(LPM3_bits); // exit the LPM on return from the ISR } int main(void) { // Initialize the MSP430 P1DIR |= 0x04; // LED. Set P1.2 to output direction P1OUT |= 0x04; // LED off P1OUT &= ~0x20; // Make sure that sensors are powered down P1DIR |= 0x20; while (1) { // Enter the Dormant state WDTCTL = WDTPW | WDTHOLD // WDT off | WDTNMI // NMI (instead of reset). See section 10.3.1 in [1] and fig. 2-1 in [1]. | WDTNMIES; // NMI on falling edge IFG1 &= ~NMIIFG; // make sure that the interrupt flag is not set IE1 |= NMIIE; // Enable NMI __bis_SR_register(LPM4_bits | GIE); // Enter LPM4 w/interrupt // Button will cause the interrupt, which will end the dormant state. See NMI ISR. g_nmiFlag = false; // WDT is used for cyclic sleep. Set WDT to interval mode. BCSCTL1 |= DIVA_1; // ACLK/2 BCSCTL3 |= LFXT1S_2; // ACLK = VLO WDTCTL = WDTPW | WDTTMSEL // WDT in interval mode | WDTCNTCL // clear counter | WDTSSEL // clock WDT from ACLK | WDTNMI; // NMI (instead of reset). See section 10.3.1 in [1] and fig. 2-1 in [1]. IE1 |= WDTIE; // Enable WDT interrupt volatile bool remainAware = true; while (remainAware) { __bis_SR_register(LPM3_bits | GIE); // nap // awoken by the WDT interrupt // <bring-up> P1OUT &= ~0x04; // Set P1.0 LED on for (volatile int i = 5000; i>0; i--); // Delay P1OUT |= 0x04; // Reset P1.0 LED off // </bring-up> // Did user press the button to deactivate the unit? if (g_nmiFlag == true) { remainAware = false; } } } return 0; } The LED blinks only once after the NMI is created with a button. I expected that the WDT timer would make the LED blink repeatedly. What am I missing? Any suggestion, insight or reference is really appreciated! Cheers, - Nick
  3. I have a problem with Tiva C Series EK-TM4C1294XL LanchPad. .Totally is blocked: ( Only the green LED1 illuminates with low-intensity! I wanted to incorporate a greater value for WDT timer but I made a mistake and enter lower. I wanted to reset every 10 seconds. And I enter WatchdogReloadSet (WATCHDOG0_BASE, SysCtlClockGet () / 10000). Instead of WatchdogReloadSet (WATCHDOG0_BASE, SysCtlClockGet () * 10000). Now microcontroller is continuously in reset and can not be programmed with ICDI. Following message appears: Unable to find any ICDI devices. How to solve this problem? Code is from the link with small changes. #include <stdint.h> #include "inc/hw_types.h" #include "inc/hw_ints.h" #include "driverlib/sysctl.h" #include "driverlib/eeprom.h" #include "driverlib/watchdog.h" #include "driverlib/interrupt.h" #define LED1 PN_1 int interval = 50; void setup() { pinMode(LED1, OUTPUT); //LED 1 } void loop() { //Watchdog Stuff SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0); SysCtlPeripheralReset(SYSCTL_PERIPH_WDOG0); if(WatchdogLockState(WATCHDOG0_BASE) == true) { WatchdogUnlock(WATCHDOG0_BASE); } //WatchdogReloadSet(WATCHDOG0_BASE, ROM_SysCtlClockGet()); WatchdogReloadSet(WATCHDOG0_BASE, SysCtlClockGet()/10000); // This is a mistake WatchdogResetEnable(WATCHDOG0_BASE); WatchdogEnable(WATCHDOG0_BASE); //IntMasterEnable(); //IntEnable(INT_WATCHDOG); while(1) { WatchdogIntClear(WATCHDOG0_BASE); //do stuff digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level) delay(interval); // wait for a second digitalWrite(LED1, LOW); // turn the LED off by making the voltage LOW delay(interval); // wait for a second } }
  4. Could someone throw out some example code of how I could for instance, run some code, go into LPM3 or 4 for 60 seconds, then run the code again? So: Loop: Do something Sleep for 60 sec Couldn't the watch dog timer be used to accomplish this? I have looked at some examples, I am just having a hard time seeing how to make it all work in the Energia IDE. Here is the sample code I have been looking at...I get what is going on here, but what I want is to get rid of the parts setting LED on or off, and turn it into a function so that I can call it, it will sleep, then the ISR will wake it up and clear the sleep mode...re-run the code, go back to sleep, etc. Any help would be greatly appreciated.
  • Create New...