Daniel Rogers

Problem with setting a external memory location.

Discussion created by Daniel Rogers on May 5, 2008
Latest reply on May 6, 2008 by Daniel Rogers
I have a structure in my external ram. I can set a byte in one line and the next line does not work.

typedef struct
{
  volatile unsigned bOutFired:1;
  volatile uchar    cOutExit;
  volatile uchar    cBatchExit;
  volatile uchar    cLabelPoint;
  volatile uchar    cFruitSize;
  volatile uint     iFruitWeight;
}BED;


BEDFruitBed[16][512];

uint iLoadcellPoint;            //   Gloabal variable  located at 0x225C42'G
uint cTstOut;                     //   Global variable    located at 0x301A


cLane is uchar passed into the routine.
cOutPointer is uchar decleared in the routine.

FruitBed[cLane][iLoadcellPoint].cOutExit = cTstOut;               // Store outlet to exit in bed
          // This line loads the cTstExit into the memory location correctly every time.
          // This line is put in to test the next line. As this line works in another piece of code.

FruitBed[cLane][iLoadcellPoint].cOutExit = cOutPointer;         // Store outlet to exit in bed
          // This line does nothing this is the line that needs to work.

I have tried to declear cOutPointer as a volatile uchar. With no change.

Does anyone have any clues or have a rule for declearing data as I have found Codeworrier to be quite finiky about home data is decleared.



Outcomes