Electronics Lab Philippines

Help po mga master programmer for MSP430F133, Thanks

Help po mga master programmer for MSP430F133, Thanks
« on: September 27, 2012, 07:42:02 PM »
hello po, meron po kasi kaming project na gagamitan ng MSP430F133
tatanung ko lang po kung paano namin ilalagay yung program, bibili po kami ng
Msp-fet430UIF na pang program,

and 1 question po. may nabibili po bang substitute for Msp-fet430UIF na ng pang program


eto po yung program



CONTROL SYSTEM C CODE

//*********************************************************************
//When powered on, the duty ratio of the first buck increases from 0 //to 27%. Then the input from the light sensor is compared to the //reference value.  Depending on if the light sensor data (stored in //ADC12MEM0) is higher or lower than the reference the duty ratio is //adjusted up or down.  Limits and delays have been set so that the //duty ratio does not quickly jump to zero or 100. The DCO has been set //to it's maximum (MHz range). This allows the duty ratio to be //incremented in smaller chunks. 
//*********************************************************************

#include  <msp430x15x.h>

void main(void)
{
  volatile unsigned int i,j,k;
  int reference, dutyC = 8, dutyW = 8, newdutyW, newdutyC, rampduty = 0;
  WDTCTL = WDTPW+WDTHOLD;             // Stop watchdog timer
  DCOCTL = 0xE0;              // Sets DCO range to max
  BCSCTL1 = 0x07;              // Basic CLK system control reg
  P6SEL |= 0x01;                      // Enable A/D channel A0
  P1DIR |= 0x0C;              // Set P1.2 and P1.3 to outputs
  P1SEL |= 0x0C;                      // P1.2 and P1.3 TA1/2 otions
  P4DIR |= 0x06;              // P4.1 and P4.2 output
  P4SEL |= 0x06;              // P4.1 and P4.2 TB1/2 options
  ADC12CTL0 = ADC12ON+SHT0_2+REFON+REF2_5V; // Turn on and set up ADC12
  ADC12CTL1 = SHP;                          // Use sampling timer
  ADC12MCTL0 = SREF_1;                      // Vr+=Vref+
  reference = 0x0700;           // refernce light value
 
  TACCR0 = 82;                        // Timer A  59kHz
  TBCCR0 = 82;              // Timer B  59kHz
  TACTL = TASSEL_2 + MC_1;            // SMCLK, up mode
  TBCTL = TBSSEL_2 + MC_1;            // SMCLK, up mode
 
  TBCCTL1 = OUTMOD_6;           // TBCCR1 toggle/set
 
 
  while (rampduty < 22) // Upper limit 27%
  {
            
      rampduty++;
            
      TBCCTL1 = OUTMOD_6;             // TBCCR1 toggle/set
      TBCCR1 = rampduty;        // duty assigned
                        
      for ( k=0; k<0x4600; k++)
      {
      }   
  }                          // Delay ramping
     
     
  ADC12CTL0 |= ENC;                   // Enable conversions

  while (1)
  {
    ADC12CTL0 |= ADC12SC;              // Start conversion
    while ((ADC12IFG & BIT0)==0);
    _NOP(); 
   
   if (ADC12MEM0 > (reference + 0x90))// Compares light sensor and ref
   {
      if (dutyC > 8)           // Lower limit 10%
      {
         dutyC--;          // Lowers the duty ratio when Light is greater
      }
      if (dutyW > 8)          // Lower limit for lumileds 10%
       {               
         dutyW--;
       }               
      }
      
      TACCTL1 = OUTMOD_6;            // TBCCR1 toggle/set
      TACCR1 = dutyC;          // Cool duty assigned
      TACCTL2 = OUTMOD_6;            // TBCCR2 toggle/set
      TACCR2 = dutyW;          // Warm duty assigned
      for ( j=0; j<0xA600; j++)
      {
      }                         // Delay
            
   if (ADC12MEM0 < (reference - 0xB0))
   {
      if (dutyC < 34)          // Upper Limit cool 41.5% 
      {
         newdutyC = dutyC + 1;
         dutyC = newdutyC;
      }
      if (dutyW < 44)         // Upper limit warm 53.5%
    {     newdutyW = dutyW +    1;
         dutyW = newdutyW;
    }
   
    TACCTL1 = OUTMOD_6;             // TBCCR1 toggle/set
    TACCR1 = dutyC;         // Warm duty assigned   
    TACCTL2 = OUTMOD_6;             // TBCCR2 toggle/set
    TACCR2 = dutyW;         // Cool duty assigned
    for ( j=0; j<0xA600; j++)       // Delay
  {
  }
 
   }                     
  } 
}



Offline 0b00000111

  • *****
  • 6201
  • 405
  • There is no delight in owning anything unshared.
Re: Help po mga master programmer for MSP430F133, Thanks
« Reply #1 on: September 28, 2012, 04:48:43 PM »
and 1 question po. may nabibili po bang substitute for Msp-fet430UIF na ng pang program

it looks like may BSL support ang chip na gagamitin nyo. ang hardware ng BSL just involves a few component (max232 and resistors)... may app note nito sa TI at yung software meron na din doon.

although I haven't tested this sa chip nyo  kasi di ko pa nagagamit yang chip nyo pero I think the BSL is worth a try. BSL ng CC430 pa lang natatry ko...
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Re: Help po mga master programmer for MSP430F133, Thanks
« Reply #2 on: September 30, 2012, 01:49:36 PM »
it looks like may BSL support ang chip na gagamitin nyo. ang hardware ng BSL just involves a few component (max232 and resistors)... may app note nito sa TI at yung software meron na din doon.

although I haven't tested this sa chip nyo  kasi di ko pa nagagamit yang chip nyo pero I think the BSL is worth a try. BSL ng CC430 pa lang natatry ko...

di ko magets?
in laymans term lang pooo

Offline rdpzycho

  • *****
  • 11684
  • 711
  • Gender: Male
  • Respect Begets Respect
    • rdpzycho
Re: Help po mga master programmer for MSP430F133, Thanks
« Reply #3 on: September 30, 2012, 04:57:36 PM »
ibig sabihin ni manay 7, merong built-in na bootloader 'yung chip niyo, kailangan niyo lang ng MAX232 (or USB to TTL-RS232) tapos rekta sa UART port nung chip.

meron ngang datasheet 'yan. tapos pwede ring gumawa nung programmer through parallel port, biggest mistake ko 'yan nun college, bumili ako nung FET programmer nila, ayun 3000 ang nalagas sa allowance ko. ;D marami kayong makikita niyan sa net.
‎"Divide each difficulty into as many parts as is feasible and necessary to resolve it."
- Rene Descartes

"For every difficult problem there is always a simple answer and most of them are wrong."
- Clayton Paul

Offline 0b00000111

  • *****
  • 6201
  • 405
  • There is no delight in owning anything unshared.
Re: Help po mga master programmer for MSP430F133, Thanks
« Reply #4 on: October 03, 2012, 01:56:35 PM »
di ko magets?
in laymans term lang pooo

oops sorry..

ayun naexplain na ni sis rdp sa itaas hehehehe.
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D