Other Parts Discussed in Thread: MSP430F2274, CC2500
I am using MSP430F2274 with CC2500.
Hi i need my DCOCLK to be calibrated to 1 mhz to do something during the Timer A interrupt. At the same time i want to be able to print to my "Putty" terminal the output that i want. Am i able to do both of these using just the DCOCLK? I do not have a external crystal and i cant rely on the VLOCLK for timer A as there seems to be a large clock drift. i tried to print to the putty terminal a message, "Hello", but its not working. However it works if i remove the calibrations and Timer A. Pls check my code below.
#include "mrfi.h"
#include "radios/family1/mrfi_spi.h"
void start_slow_timeout()
{
TACTL|=TACLR; TACCTL0=CCIE; TACTL=TASSEL_2+MC_1;
}
int main(void)
{
BSP_Init();
P3SEL |= 0x30;
UCA0CTL1 = UCSSEL_2;
UCA0BR0 = 0x41;
UCA0BR1 = 0x3;
UCA0MCTL = UCBRS_2;
UCA0CTL1 &= ~UCSWRST;
if(CALBC1_1MHZ == 0xFF || CALDCO_1MHZ == 0xFF)
{
P1OUT |=0x02;
while(1);
}
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
BCSCTL2 &= ~ BIT3;
TACCTL0 = 0; // TACCR0 interrupt enabled
TACCR0 = 50000;
TACTL = MC_0; // SMCLK, count up mode
start_slow_timeout();
__bis_SR_register(GIE);
while(1);
}
void MRFI_RxCompleteISR()
{
}
int count=0; // counter to count to 1 sec and print
#pragma vector=TIMERA0_VECTOR
__interrupt void interrupt_slow_timeout (void)
{
count++;
if(count==20)
{
char xyz[] = {"Hello \n\r"};
TXString(xyz, (sizeof xyz));
P1OUT^=0x01;
count=0;
}
}