Custom Search

Monthly Archives: August 2010

MSP430 basic coding/programing part 2 WDT+

2
Filed under electronics, Hardware, MSP430, programing

WDT is a very useful tool, as I explained before most of us will turn it off or use it as an interval timer. Timer_A has a similar timer function but more robust and more options.
So today we will be going over WDT and timer_A registers, how to setup them up, how you use them is up the you.

WDT is the watch dog timer, used for checking errors/faults, or software states, interval timer, interval interrupt, or what ever other uses you can think of.

So lets start with the basic register WDTCTL
This is the main register that will configure the WDT, bits 15-8 are the password register and 7-0 are for control. you need to set the password register before you can modify bits 7-0.
to do this WDTCTL = WDTPW; // WDTPW = 0x5A00 or 01011010 00000000
This will allow access to the 7-0 bits to configure the WDT. The rest of the registers are used to turn off, setup, change to interval mode, set interupts, change clock sources, and more.
This next set of registers is taken from the slau144e.pdf from the TI website, this book explains how it all works and what the settings mean.

WDTHOLD Bit 7 Watchdog timer+ hold. This bit stops the watchdog timer+. Setting
WDTHOLD = 1 when the WDT+ is not in use conserves power.

  • 0 Watchdog timer+ is not stopped
  • 1 Watchdog timer+ is stopped
  • WDTNMIES Bit 6 Watchdog timer+ NMI edge select. This bit selects the interrupt edge for the
    NMI interrupt when WDTNMI = 1. Modifying this bit can trigger an NMI. Modify
    this bit when WDTIE = 0 to avoid triggering an accidental NMI.

  • 0 NMI on rising edge
  • 1 NMI on falling edge
  • WDTNMI Bit 5 Watchdog timer+ NMI select. This bit selects the function for the RST/NMI pin.

  • 0 Reset function
  • 1 NMI function
  • WDTTMSEL Bit 4 Watchdog timer+ mode select

  • 0 Watchdog mode
  • 1 Interval timer mode
  • WDTCNTCL Bit 3 Watchdog timer+ counter clear. Setting WDTCNTCL = 1 clears the count
    value to 0000h. WDTCNTCL is automatically reset.

  • 0 No action
  • 1 WDTCNT = 0000h
  • WDTSSEL Bit 2 Watchdog timer+ clock source select

  • 0 SMCLK
  • 1 ACLK
  • WDTISx Bits 1-0
    Watchdog timer+ interval select. These bits select the watchdog timer+
    interval to set the WDTIFG flag and/or generate a PUC.

  • 00 Watchdog clock source /32768
  • 01 Watchdog clock source /8192
  • 10 Watchdog clock source /512
  • 11 Watchdog clock source /64
  • Read More »

    Invintory time!!!

    3
    Filed under Uncategorized
    Tagged as

    While i work and try to finish a few small projects that i have started but haven’t posted about, I will be doing a small inventory of all my parts…….I have boxes and bags, and parts almost everywhere and i dont really know what i have any more. When i am finished, I may be giving away parts as long as shipping is reasonable. This wont cut to much into my programming and writing posts, i do that during work (ssshhhh!).

    I also want to thank everyone who visits my site. It means alot :)

    Justin

    TI samples came in today

    1
    Filed under Uncategorized

    ADS7841-
    12-Bit, 4-Channel Analog-to-Digital Converter
    ADS7813-
    16-Bit Sampling Analog-To-Digital Converter
    …TLC5940-
    16-Channel LED Driver w/EEprom
    TLC556-
    Dual LinCMOS(TM) Timer
    TRS232E-
    Dual RS-232 Driver/Receiver With IEC61000-4-2 Protection
    MSP430F2013-
    16-bit Ultra-Low-Power Microcontroller, 2kB Flash

    MSP430 basic coding/programing part 1

    5
    Filed under electronics, Hardware, MSP430, programing, software

    basic functionality can be achieved with minimal coding. In my attempt to learning how to get the different peripherals working on my msp~2231. All MSP430 value line come with a simple universal package of hardware, Basic Clock, Timer_A, GPIO, USI (SPI,I2C,UART), WDT. then there are chips with chip specific hardware like ADC10, Comparator, Timer_B, Sigma-Delta ADC. to get most of these to work, it takes very little code, but to make them useful that will take a little more skill.

    We will start with everything after the header file #include msp430xxx.h , remember that this header file is chip specific.

    Lets start Here- this is where most of your code will go, including setting up the clocks, pins, interrupts, and anything else that will be run.
    void main(void) {
    //program goes here
    }

    Read More »