Digital I/O issue

Hi to all,

this is the first time I use a Rabbit Microprocessor (4100) but I have some knowledge of C programming on PIC and Atmel Microcontrollers.

I made a simple board with a RCM4100 and a LED on PE1 (the LED will be active if the output is at high level).

Here my test program:


void main() {
   WrPortI(PEDDR, &PEDDRShadow, 0x01);
   WrPortI(PEDCR, &PEDCRShadow, 0x00);
   BitWrPortI(PEDR, &PEDRShadow, 1, 1);
   
   for (;;) {}
}

First, I set the bit 1 of Port E to output, then I set the output drive mode to push-pull (as power-up-reset, indeed).
With the last instruction I set the bit 1 to high level but the led doesn’t turn on.

Do I miss anything? :confused:

I thank you for any answer and I am sorry for my poor school English.

Marco / iw2nzm

WrPortI(PEDDR, &PEDDRShadow, 0x01);

This sets bit 0 of Port E to output, not bit 1

That function call should be :

WrPortI(PEDDR,&PEDDRShadow,0x02); 

I hope this helps you to solve your problem :slight_smile:

Fixed. It was a fault hardware connection… Sorry for unuseful post.

Marco / iw2nzm

[QUOTE=AndresGM;490]

WrPortI(PEDDR, &PEDDRShadow, 0x01);

This sets bit 0 of Port E to output, not bit 1

That function call should be :

WrPortI(PEDDR,&PEDDRShadow,0x02); 

I hope this helps you to solve your problem :)[/quote]

Eh eh, you’re right! I miss that :eek:

But there was also a wrong connection!
Two errors in the first project… actually, I can only do better :stuck_out_tongue:

Marco / iw2nzm