Part Number: MSP430FR58671
Other Parts Discussed in Thread: MSP430FR2355
Eventually I will be reading in from multiplexers an 8x8 image array. For now I am just trying to setup an array that holds ech pixel data and a pointer that will point to which location of the each pixel gets stored in.
The problem I am having is that not all the memory locations get written to. Following is the basic code I have for this function, Matrix.C will change with the mapping of the pixel array to the rows and columns each pixel is in.
float *ROIC[];
float array[16];
unsigned int count,i;
int main(void)
matrix();
for(i = 1; i < 17; i++)
{
count = i * 10;
*ROIC[i] = count;
}
// Matrix.c
void matrix(void)
{
extern float array[4][4];
extern float *ROIC[];
ROIC[1] = &array[0][0];
ROIC[2] = &array[0][1];
ROIC[3] = &array[0][2];
ROIC[4] = &array[0][3];
ROIC[5] = &array[1][0];
ROIC[6] = &array[1][1];
ROIC[7] = &array[1][2];
ROIC[8] = &array[1][3];
ROIC[9] = &array[2][0];
ROIC[10] = &array[2][1];
ROIC[11] = &array[2][2];
ROIC[12] = &array[2][3];
ROIC[13] = &array[3][0];
ROIC[14] = &array[3][1];
ROIC[15] = &array[3][2];
ROIC[16] = &array[3][3];
}
These are the results I get after running, the location 0 should have 10 and location 1 should have 20 the rest are all correct:
array float[16] [0.0,0.0,30.0,40.0,50.0...] 0x001C00
[0] float 0.0 0x001C00
[1] float 0.0 0x001C04
[2] float 30.0 0x001C08
[3] float 40.0 0x001C0C
[4] float 50.0 0x001C10
[5] float 60.0 0x001C14
[6] float 70.0 0x001C18
[7] float 80.0 0x001C1C
[8] float 90.0 0x001C20
[9] float 100.0 0x001C24
[10] float 110.0 0x001C28
[11] float 120.0 0x001C2C
[12] float 130.0 0x001C30
[13] float 140.0 0x001C34
[14] float 150.0 0x001C38
[15] float 160.0 0x001C3C
I had initially started my tests using the MSP430FR2355 development board and had similar issues but the locations that didn't get written to were different but always consistent.