Jump to content


  • Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    C_Coffie reacted to rockets4kids in MSP430 LaunchPad Book?   
    A definite second (or third or fourth) For the Davies book, but you are not sure about dropping the $40, be sure to watch the Launchpad Videos and then read through this tutorial:
    That, combined with resources on the net, might just be enough to get you going.
  2. Like
    C_Coffie reacted to gordon in MSP430 LaunchPad Book?   
    To a considerable extent, you will be able to use other tutorials.
    Certain things will vary, of course, but - for example - I was able to follow John Davies' book (which is written using the Olimex starter kit with an MSP430F1121A) using the LaunchPad quite well. The basics - like I/O, lighting a LED, reading a button, using timers, getting familiar with the clocks, using the ADC, using interrupts, the power modes - will be pretty much the same. You may have to use different pins on the LaunchPad chips, sometimes you have only one Feature X on the LaunchPad chips while the F1121A may have more than one Feature X, but accounting for these is fairly straightforward.
    I (as apparently quite several other people here) have found the Davies book to be an excellent introduction and resource. At the price tag of a dozen LaunchPads, it is a bit pricey, but to me it was every penny well spent.
    This really goes for many (probably any) other MSP430 tutorials you may find. A little bit of common sense is enough to use them with the LaunchPad.
  3. Like
    C_Coffie reacted to Astrom27 in DC PWM motor control   
    I wanted to share the project i am working on, it is for a small dc motor pwm controller.
    I have got it working and it works pretty good. It does not use the pwm of the timer control,
    but a separate ratio type control in the main function. It Uses the grace gui so i dont know if i have to
    attach at the files or not if that is needed ,but here is the main part of the code that should contain enough
    to work off of. Idont have the schematic right now ill work on one soon, it just uses a 3904 transistor for the
    motor to have enough current, and some resistors for the bias. It uses p1.1 , p1.3 with external buttons for the
    input speed change. They are tied to ground at the button and use the pull down resistors on the msp, they connect
    to vcc on the button pushes to pull them high and cause the interrupt to change the speed.The TA timer is used for
    button de-bounce.
    I can include the other grace files if they are wanted..

    /* Chris Mansfield *** Pwm Dc motor control for msp430 */ /* * ======== Standard MSP430 includes ======== */ #include #include /* * ======== Grace related includes ======== */ #include /* * ======== main ======== */ int pwm=200; int max; #define MaxPwm 250 #define PWMStep 5 void main(void) { CSL_init(); // Activate Grace-generated configuration __enable_interrupt(); // Set global interrupt enable WDTCTL = WDTPW + WDTHOLD; int i=0; // Jump start for motor requires more current to get for(i=0;i<10000;i++) // started. P1OUT= BIT0; // ** was 0 a mistake **** P1IFG=0; // clear the interrupt flag while(1) { if(pwm != MaxPwm) { for(max=0;max<=MaxPwm;max+=PWMStep) { if(max < pwm) P1OUT = BIT0;//output on else P1OUT = 0;// output 0 off } } else P1OUT = BIT6 | BIT0; // max output } } volatile int pin; volatile char depin; void port1(void) { P1OUT=0; pin=P1IN; if(pin & BIT3) { P1IFG&= ~BIT3; // clear p1.3 flag pwm+=PWMStep; //increase pwm if(pwm >= MaxPwm) pwm=MaxPwm; // limit max pwm 100% P1IE &= ~BIT3; // debouce depin=1; TACTL = TASSEL_1 + ID_0 + MC_1 + TACLR; TACCR0 = 3500; } if(pin& BIT1) { P1IFG&= ~BIT1 ; // clear p1.1 flag pwm-=PWMStep; // decrease pwm if(pwm <= 0) pwm=0; // limit min pwm 0% P1IE &= ~BIT1; // debouce depin=1; TACTL = TASSEL_1 + ID_0 + MC_1 + TACLR; TACCR0 = 3500; } if(P1IFG) //clears any other flags P1IFG=0; } void WTD_ISR() { } void TA_ISR() { if(depin == 1) // re-enable pin interuppt { P1IE |= BIT1; P1IE |= BIT3; depin=0; } TACTL = MC_0;// disable clock TACCR0 = 0; // zero counter }
  • Create New...