MSP430 >> MSP430

Pages: 1
Phu



Reged: Feb 21 2007
Posts: 1
msp430f1611 clocking problem, please, help!!
      #26254 - Wed Feb 21 2007 05:20 AM

Hi everyone. I'm trying to program a very simple application that adds one unit to the outputs of one port (P4), but it has to be as faster as possible. My problem is the speed. The maximum time rating with external clocking is 8 MHz, but such a simple program only arrives to some kHz. I leave you the program. If you have any answer to my question, please, tell to me. The program:

Please use Code tags to maintain formatting and improve code readability. I added them here (mod)
Code:
#include  <msp430x16x.h>

unsigned int i = 0; // Variable global

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog
BCSCTL1 = XTS + DIVA_0; // XT2 ON, modo alta frecuencia, sin división.
BCSCTL2 = SELM1 + DIVM_0 + SELS + DIVS_0; // Fuente del MCLK: XT2.

P4DIR |= 0xFF;
P4OUT = 0x00;
//P1SEL &= ~BIT2;
P1IE = BIT2;
P1IES = 0xFF; // Flanco de subida de reloj.

//ADC12CTL0 = REF2_5V + REFON; // Internal 2.5V ref on

_BIS_SR(GIE+SCG0);



//DAC12_0CTL = DAC12IR + DAC12AMP_7 + DAC12ENC + DAC12LSEL0 + DAC12SREF_2;
// Internal ref gain 1
do
{
P4OUT++;
//P4OUT &= 0xFF;
//DAC12_0DAT = DAC12_0DAT++; // Generamos rampa.
//DAC12_0DAT &= 0xFFFF; // Para evitar desbordamiento.
} while (i == 0);
}


#pragma vector=PORT1_VECTOR
__interrupt void ajustado (void)
{
//P1IFG = BIT1;
i = 1;
P1IFG &= ~BIT2;
}



Edited by Dan Henry (Wed Feb 21 2007 08:37 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Dan HenryModerator
Guru
****

Reged: Oct 16 2003
Posts: 3387
Loc: Boulder, Colorado U.S.A.
Re: msp430f1611 clocking problem, please, help!! [Re: Phu]
      #26255 - Wed Feb 21 2007 08:57 AM

I'd check the clock configuration code against the '430 User's Guide.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 0 anonymous users are browsing this forum.

Moderator:  ndouglas, jtemples, Dan Henry, Andrew L, mikerj, dave g, meisty, josh stevo 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 3315

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5