Part Number: MSP430FR6989
Dear,
This thread follows on a first one (https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/931471) however with a different problem.
I am unable to write to memory (but I can read from it).
The code is:
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=PORT3_VECTOR
__interrupt void Port_3(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(PORT3_VECTOR))) Port_3 (void)
#else
#error Compiler not supported!
#endif
{
/*
* 4 usable RAM sections:
* 1. D --> 1800h 'till 187Fh
* 2. C --> 1880h 'till 18FFh
* 3. B --> 1900h 'till 187Fh
* 4. A --> 1980h 'till 19FFh
*/
uint16_t volatile * address = (uint16_t *) getAddress();
//READ
if(!(P3IN & BIT0)){ // READ
P2DIR &= 0x00; // put in read mode
*address = P2IN; // --> FAULT HERE NOT ABLE TO WRITE TO MEMORY
P3OUT |= BIT2;
}
//WRITE
else{
P2DIR |= 0xFF; // put in write mode
P2OUT &= 0x00;
P2OUT |= *address;
P3OUT |= BIT2; // set ACK to 1
P4DIR |= BIT0;
P4OUT |= BIT0;
}
while(!(P3IN & BIT1)){ // do nothing while Trigger (3.1) is still high
__no_operation();
}
P2DIR &= 0x00;
P3OUT = ~BIT2;
P3IFG=0; // set all flags to 0
}
Where I wanted to write to the above mentioned (in the code) sections. The address is correct (as I am able to read those, and is also checked via debugger). However I am unable to write to it (If you want to know how I tested it, I refer to the above mentioned thread where it is explained, but rest assured it is tested multiple ways).
In the settings I have enabled (in properties --> CCS General --> MPU) the "manually specify memory.." and put the info memory on R and W.
