This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
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;
}
}
Yes, why not? As long as all parts know of the current DCO speed.Muhammad Razali said:terminal the output that i want. Am i able to do both of these using just the DCOCLK?
However, you call BSP_Init(), which most likely inits the DCO and the clock system and programs the UART to use a baudrate based on the configured DCO. Now you go and recofigure the DCO to something else. What do you think will happen to the baudrate of the serial connection? I think, the PC will believe your MSP is suddenly speaking like a chinese mouse. Or a caucasian hill giant. But not like an understandable serial counterpart.
**Attention** This is a public forum