Part Number: MSP430FR6989
Dear,
For a project, I am working with writing and reading from a memory chunk on the MSP430FR6989. For this reason I write an address to a "slave" (which will store data on that address), this address does not fall into the address chunk of the MSP430FR6989 where I could write to (1880h untill 19FFh), rather it is something like 0x0060. So I would like to do some arithmetics on this pointer. However, when using the debugging tool I see some weird things happening.
The important piece of code is:
/*
* 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();
if(address >= (uint16_t *) 0x0 && address < (uint16_t *) 0x100){ // compare "pointers"
address = address + 900;
if(address >= (uint16_t *) 0x1800){
__no_operation();
}
}
The problem is on the line: "address = address + 900;" (the 900 was just an example number I used to see what was going on).
What happens is that it adds the number x708 (with a hex) to the address (I tried with multiple addresses). This baffles me, because the hex of 900 is x384 which does not double to 708 (but to 768 which I expected it to do). If I use x900 (in stead of just the decimal 900), it would add the address with x1200 (a hex).
I am probably missing something really easy.
With kind regards.