Part Number: MSP430F2274
Tool/software: Code Composer Studio
For testing purposes I wanted to write a single character to location in RAM, and move the value to a different spot in RAM during an interrupt. I tried to use the intrinsic function `__data20_write_char()`, but are getting error #10234-D: unresolved symbols remain. Is there a reason as to why this is occurring? My code is provided below:
#include <msp430.h>
//#include <string.h>
void configWDT(void);
void configClocks(void);
void configGPIO(void);
void configTimers(void);
void configADC(void);
unsigned volatile int blink_cnt;
int main(void)
{
blink_cnt = 0;
configWDT();
configClocks();
configGPIO();
configTimers();
configADC();
const char ch = 'V';
__data20_write_char(0x028E, ch);
__no_operation();
while(1)
{
__bis_SR_register(LPM3_bits + GIE); // Enter LPM3
if(blink_cnt == 0 || blink_cnt > 0)
{
P1OUT ^= BIT0;
}
}
}
void configWDT(void)
{
WDTCTL = WDTPW + WDTHOLD;
}
void configClocks()
{
DCOCTL |= DCO1 + DCO0;
BCSCTL1 |= XT2OFF + DIVA_3 + RSEL2 + RSEL1 + RSEL0;
BCSCTL2 |= SELM_3 + SELS;
BCSCTL3 |= XT2S_3 + XCAP_3;
}
void configGPIO(void)
{
P1DIR |= 0x03; // P1.1 output
P1SEL |= 0x02; // P1.1 option select
}
void configTimers(void)
{
TACCTL0 = OUTMOD_4; // TACCR0 toggle mode
TACCR0 = 0xFFFF;
TACTL = TASSEL_1 + ID_3 + MC_3 + TAIE; // ACLK, up-downmode
}
void configADC(void)
{
ADC10CTL0 = 0x00;
}
// Timer_A3 Interrupt Vector (TAIV) handler
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMERA1_VECTOR
__interrupt void Timer_A(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMERA1_VECTOR))) Timer_A (void)
#else
#error Compiler not supported!
#endif
{
switch(TAIV) // Efficient switch-implementation
{
case 2:
break; // TACCR1 not used
case 4:
break; // TACCR2 not used
case 10:
blink_cnt++;
break;
}
__bic_SR_register_on_exit(LPM3_bits);
}
I have yet to get to the part where the character is moved to a different location in RAM, but I cannot get the character to written initially. Is there an alternative method to writing a value to RAM? In the future this data value is going to be 128 bytes, so it might be necessary to know how to write the entire data value to RAM instead of a single character. Thank you.