Hi Philipp, On what SFRPAGE are P3MDOUT and XBR2 located? Is that also the default?
Further, if you don't use our c8051f120.h> you will have to define _XPAGE yourself to let the xdata initialization succeed in the future. Maarten > To look into SDCC mcs51 performance, I wanted to run Whetstone, > Dhrystone, Coremark on an C8051. The C8051F120 is one of the few that > has enough RAM. > For getting started with the C8051F120 I tried to switch on / off an LED > on a C8051F120 board with this program (and the same with P3 = 0x00;). > > #include <stdbool.h> > > __sfr __at(0xb0) P3; > __sfr __at(0xa7) P3MDOUT; > __sfr __at(0xe3) XBR2; > __sfr __at(0xff) WDTCN; > > unsigned char _sdcc_external_startup(void) > { > // Disable watchdog timer > WDTCN = 0xde; > WDTCN = 0xad; > > return 0; // perform normal initialization > } > > void main(void) > { > // Enable port output > XBR2 = 0x40; > P3MDOUT = 0x08; > > P3 = 0xff; > > for(;;); > } > > But I always get a dimly lit LED; it is never fully on or off. When I > first plugged in the board, it had the LED blinking (with whatever demo > was on the board then), so the hardware seems to be ok. > > The board is the same as this one: > http://www.colecovision.eu/mcs51/C8051F%20V2.1%20LED.shtml > except that is has an C8051F120 instead of the C8051F020. > > The same cables and U-EC6 debug adapter clone work fine with the > C8051F020 board. > > Philipp ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user