[Sdcc-user] Getting started with C8051F120 problem

2016-12-26 Thread Philipp Klaus Krause
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 

__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

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
___
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user


Re: [Sdcc-user] Getting started with C8051F120 problem

2016-12-26 Thread Philipp Klaus Krause
On 26.12.2016 14:54, Philipp Klaus Krause wrote:
> The same cables and U-EC6 debug adapter clone work fine with the
> C8051F020 board.
> 
> Philipp

To flash the C8051F120 I use ec2writeflash --port USB, just like with
the C8051F020 board.
ec2writeflash recognizes the C8051F120 as C8051F120.

Philipp


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
___
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user


Re: [Sdcc-user] Getting started with C8051F120 problem

2016-12-26 Thread Maarten Brock
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 
>
> __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