Hi experts,
I'm using Port 4 for USCI_A1 Spi configuration, but in datasheet port mapping is there for port 4 so that we can use it by configuration through port mapping.
Here's what I have tried but it doesn't update P4MAP0 and so on registers can anyone please check and let me know where I'm going wrong.
const unsigned char P4mapping[8] = {
PM_UCA1CLK,
PM_NONE, // Please check down why I have used PM_NONE
PM_NONE,
PM_UCA1STE,
PM_UCA1SIMO,
PM_UCA1SOMI,
PM_NONE,
PM_NONE
};
void Port_Mapping(void)
{
unsigned char i;
volatile unsigned char *ptr;
__disable_interrupt(); // Disable Interrupts before altering Port Mapping registers
PMAPPWD = 0x02D52; // Enable Write-access to modify port mapping registers
#ifdef PORT_MAP_RECFG
PMAPCTL = PMAPRECFG; // Allow reconfiguration during runtime
#endif
ptr = &P4MAP0;
for(i=0;i<8;i++)
{
*ptr = P4mapping[i];
ptr++;
}
// P4MAP0 = PM_UCA1CLK;
// P4MAP3 = PM_UCA1STE;
// P4MAP4 = PM_UCA1SIMO;
// P4MAP4 = PM_UCA1SOMI;
PMAPPWD = 0; // Disable Write-Access to modify port mapping registers
#ifdef PORT_MAP_EINT
__enable_interrupt(); // Re-enable all interrupts
#endif
}
int main (void)
{
int i;
WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog
__bis_SR_register(GIE);
//increaseVCoreToLevel2();
Port_Mapping();
initClockTo1MHz();
}
Note: Here in array I have wrote there PM_NONE for some variables just because I don't want to configure that registers.
Please it's a humble reuest that let me know what wrong I'm doing so that I can fix that issue and move further to my work as I'm stuck at this portion.