Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by kenemon

  1. Hi All,


    Thought that I would share a TI motor driver PCB breakout, inspired by GW. It is made for the DRV8833 dual H-bridge stepper/dual brushed PWM controlled IC. Using the PowerPad heatsink technology, this baby should handle the larger gearhead motors (it worked for my solar tracker). It is rated at 2A. I used the msp430g2231 for PWM control. I also made the bottom a huge heatsink if you can see through the purple haze. Subliminally, I cant decide if I am a bigger NW or U of I fan (being a CU alum??).






  2. I was kind of stuck in a thinking rut regarding TI's power pad technology. It was my intent to provide ventilation, or in the case of power pads, freedom to solder the bottom without using a toaster oven. I think it will help cool it down, but not as much as a copper heatsink would...


    Update: The hole works nice for tape during reflow action

  3. Has anyone had any luck getting the modules to communicate with anything?


    Hey Rob- I was wondering if you could share that hello code you got working with yours? Did you use the LP to program it or as a UART interface?


    I am getting geared up to get into it, as solar projects lose their charm this time of the year in Chicago...... :mrgreen:

  4. Thanks to all of your recommendations, I have a basic pulse/timer code set up, but i am having trouble with the timing and sequence. Both steppers I have have four wires. I am a little confused at this point. I have a motor driver which can handle a two coil stepper using 4 input pulses, and i have permuted the wiring several times.


    Edit: I fiddled about some more and was able to get them to rotate, using 10mS delays between toggling each pin on and off, i can speed it up by lowering the delay time as well.


    // parts copied from gwdeveloper's motor control code-  Thanks
    #define blue BIT0      // P1.0
    #define red  BIT1      // P1.1
    #define yell BIT2      // P1.2
    #define white	BIT4    //P1.4
    #define STANDBY BIT6   // P1.6
    void DelayMs (unsigned int ms) {
    while(ms--) {
    // button status
    unsigned char buttonOn;
    void main(void)
       WDTCTL = WDTPW + WDTTMSEL + WDTSSEL + WDTIS1;   // WDT as interval timer for debouncing of P1.3 button
                                           // interval mode, low speed clock, /512
      // enable button on P1.3 with interrupt
       P1OUT = BIT3;
       P1REN = BIT3;
       P1IES = BIT3;
       P1IE = BIT3;
       P1IFG = 0;      // clear P1 interrupt flags
       // rest of gpio for motor output
       P1DIR = BIT0 + BIT1 + BIT2 + BIT4 + BIT6;      // set P1 output bits for AIN1, AIN2 and STANDBY
    //P1REN |= BIT2 + BIT4;
       P2SEL &= ~(BIT6 + BIT7);            // turn off xtal
       BCSCTL2 = SELM_0 + DIVM_0 + DIVS_0;    
       DCOCTL = 0x00;               // clear DCO bits
       BCSCTL1 = CALBC1_1MHZ;         // Set DCO to calibrated 1MHz
       BCSCTL1 |= XT2OFF + DIVA_0;
       BCSCTL3 = XT2S_0 + LFXT1S_2 + XCAP_1;                                        
       IFG1 &= ~(WDTIFG);            // clear WDT flags
       IE1 |= WDTIE;               // enable WDT interrupt
       buttonOn = 0;
       __enable_interrupt();           // Set global interrupt enable
       //P1OUT = BIT0+BIT1+BIT2+BIT4;
       while (1)
                P1OUT ^= blue; 
                DelayMs (5);            
                 P1OUT ^= red;
                 DelayMs (5);
               P1OUT ^= blue;
               DelayMs (5);
                 P1OUT ^= yell;
                 DelayMs (5);
                P1OUT ^= red;
                DelayMs (5);
               P1OUT ^= white;
               DelayMs (5);
               P1OUT ^= yell;
               DelayMs (5);
                P1OUT ^= white;
    #pragma vector=PORT1_VECTOR
    __interrupt void button_push_isr(void)
       P1IFG &= ~BIT3;         // clear P1.3 button flag
       P1IE &= ~BIT3;         // clear P1.3 interrupt
       IFG1 &= ~WDTIFG;
       IE1 |= WDTIE;
      // use button to toggle motors on/off for testing
       if (buttonOn == 1) {
           buttonOn = 0;
           P1OUT &= ~STANDBY; // motor driver disable
       else {
           buttonOn = 1;
           P1OUT |= STANDBY; // motor driver enable
    #pragma vector=WDT_VECTOR
    __interrupt void watchdog_isr(void)
       IE1 &= ~WDTIE;
       P1IFG &= ~BIT3;         // clear P1.3 button flag
       P1IE |= BIT3;         // re-enable P1.3 interrupt

  5. there is a "mechanic's" solder on dealextreme for less than $5 delivered, it works great for SMT and other tiny apps, but also for larger stuff. I have tried it in the toaster oven and with the iron with great results. Just ordered a second bottle, as the first dried up after about 6 months ( in the fridge, triple wrapped..)

  6. Hi GW,


    I started messing around and got my motor driver to work using an adaptation of your code. I am trying to get 4 channels to deliver PWM output. Using your code, i have 2 channels working fine, but i needed to hook them up to P1.2 and P2.2 to get the desired signals. I have 2 questions please: 1) do i understand correctly that to use the PwM function of the MSP it will occupy three pins each, for example P1&2 BITS 0,1, and 2) PWM can not be controlled via "P1OUT BIT2"? Can you assign timer to multiple pins to deliver the same timer pulse to each. I have been trying to understand this for almost a year now.


    Thanks. KB

  7. Thanks GW, What do you think of the TI DRV8833? I realize it needs a couple of components to work, but it is really cheap...

    By the way, thanks for sharing that code. I was stumbling around trying to figure out a way to make it work for me, and this will handle the PWM part as well as the "mode" switches. I have some success with your suggestions for the ADC component as well. They should work perfectly together for me.



  8. Hi Zeke,

    thats the idea with that last PCB you helped me with. Use wireless 802.11 anywhere you can get it to communicate with a server for data logging, or control application. I dont think it is going to be easy! Incredibly cool concept.



  9. Thanks Blue,


    Using a DirectTV antennae azimuth mount as a base, i was able to dissect it and add some bearings. The horizontal mount uses some aluminum disks which i had to cut in 1/2" milling stock with a 6" hole saw (scary!) on a drill press. Using lazy susan bearing there. The gears and belt were commercially available. Cost so far (less solar panel) about $75. Struggling now with the code for the sensor using MSP w/ PWM output to control TI motor drivers.



  10. Hi GW,


    i had a moment to get back to this ADC issue. I tried putting those items you mentioned in my code but it hasnt seemed to help. I am still getting erratic readings from the ADC without any basis. Can you find any issues with this code?




    /* LED as Photo-Sensor2
    / KB, interpreted from others who know what the hell they are doing
    / Sept 15, 2011
    #include "msp430g2452.h"	// Change the header to "msp430x20x2.h" if you're using the default MCU bundled with the LaunchPad.
    #define LED_SENSEL INCH_0 	// Left sensor	
    #define LED_SENSER INCH_1 	// Right sensor
    #define LED_INDL  BIT6		//Left indicator
    #define LED_INDR  BIT7		//Right indicator
    unsigned int adcvalL = 0;   // Left value register
    unsigned int adcvalR = 0;   //Right value register
    volatile int ADCdata[32];
    unsigned int analogRead(unsigned char pin)
     ADC10CTL0 &= ~ENC;	            // Disable ADC10
     if (pin == LED_SENSER) {			// IF Right scan then 
     	ADC10CTL1 &= ~INCH_0;  	        // Deselect ADC Channel 5 (Left) 
       ADC10CTL1 |= INCH_1;            // Select ADC Channel 2   , Right LDR
     } else {							// Scanning Left
     	ADC10CTL1 &= ~INCH_1;           // Deselect ADC Channel 2
       ADC10CTL1 |= INCH_0;             // Select ADC Channel 5, Left LDR
     ADC10CTL0 |= ENC + ADC10SC;       // Enable ADC10 and Conversion start
     while (ADC10CTL1 & ADC10BUSY);    // Wait for ADC Conversion
     return(ADC10MEM); 	            // Return ADC Value
    void DelayMs(unsigned int ms)
     while(ms--) {
       __delay_cycles(1000);     // 1 ms delay for 1 MHz Internal Clock
    void main(void)
     unsigned int i;
     WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
     // P1.6 and P1.7 output, Other as Input
     // Enable the pull-down resistor on the unused input ports
     //P1REN = BIT4 + BIT5;
     P1REN = BIT2 + BIT4 + BIT3;
     // Start the ADC10 Peripheral
     // Vref = Vcc, 16 ADC Clock, Enable ADC10
     ADC10CTL0 = SREF_0 + ADC10SHT_1 + ADC10ON;  
     // Sample-and-hold ADC10SC bit, ADC10 Clock /1, ADC10 Source Clock, Single Channel Conversion
     ADC10SA = (unsigned int)ADCdata;
     ADC10DTC1 = 32;
     ADC10CTL1 = SHS_0 + ADC10DIV_0 + ADC10SSEL_0 + CONSEQ_0;
     ADC10AE0 = LED_SENSEL + LED_SENSER;          // Enable A4 and A5 as ADC Input
     DelayMs(100);                               // Wait for ADC Ref to settle
     for(; {
    		for ( i=0; i < 64; i++ ) {
    		adcvalR += analogRead( LED_SENSER );	// Read the analog input.
    		adcvalL += analogRead( LED_SENSEL );	// Read the analog input.
    	adcvalL >>= 4; // division by 8 to get avg
           adcvalR >>= 4; // division by 8 to get avg
    	// Interpret the result
    	P1OUT = 0x00;
    	if ( (adcvalL > (adcvalR))) {
    		P1OUT |= LED_INDL;	// Turn on the left Green LED.
    		P1OUT &= ~LED_INDR;
    	else if ( (adcvalR > (adcvalL)))  {
    		P1OUT |= LED_INDR;	// Turn on the right LED.
    		P1OUT &= ~LED_INDL;
    	else {P1OUT = 0x00;

  • Create New...