Hi all,

I observed different results if i define the xdata space compared to if i leave it to start at address 0. I wrote a test program just to test the result of 7 segment display on the FX2 board.

This is how the data are defined:

BYTE xdata Digit[]={ 0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x98, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e};

snippet:

void main(void)
{
  for( i=0; i<=14; i++)
 {
  EZUSB_WriteI2C(LED_ADD, 0x01, &(Digit[i]));
 EZUSB_Delay(300); 
 }
}

If this file is compiled without using the option --xram-loc then after downloading the hex file onto the board, the 7 segment display will display from 0 to E accordingly. If the file is compiled with --xram-loc 0x1000 (for example), then weird figure will be displayed on the 7 segment display.

The reason why the --xram-loc option is used because i need to set the xdata space for the project file to avoid conflict with the code space since both by default map to address 0.

Does anyone know why this is happening and how i could remedy it?

Any suggestions and comments is much appreciated.

I am using the following version of SDCC:

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.4.0 (Feb 23 2004) (MINGW32)

Thanks in advance!

 

Best regards,

Leynie


Do you Yahoo!?
vote.yahoo.com - Register online to vote today!