> I'm just trying to write my first C8051 program:
>
> __sfr __at(0xa0) P2;
> __sfr __at(0xa6) P2MDOUT;
> __sfr __at(0xe2) XBR1;
>
> unsigned long int u = 0;
> #define u 0ul
>
> void main(void)
> {
>       // Enable port output
>       XBR1 = 0x40;
>       P2MDOUT = 0x0c;
>
>       for(;;)
>               P2 = ((u / 10) & 0x03) << 2;
> }
>
> My board has LED on the P2.2 and P2.3. This program turns them off. But
> when I remove the "#define u 0ul" line the LEDs are on.
> I compile using
> sdcc test.c
> and put the program onto the µC using
> ec2writeflash --port USB --hex /tmp/test.ihx
>
> Philipp

Hi, I created some small examples for the C8051F***

https://github.com/merbanan/C8051F300_examples

I tried these examples on a F340 but something doesnt work correctly when
I send data over the serial port and sdcc. If I use Keil it works fine.
And the same code works fine on the F300.

I'd be happy to supply you with hardware if you are interested to
investigate the issue. Currently I use Keil which works with what I want
to do, but doing open stuff and needing a non free compiler causes an itch
I want to scratch.

MvH
Benjamin Larsson



------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to