[En-Nut-Discussion] Problem with Port E Pin 5 and Ethernet

Alexander Baranov Baranov at intech21.com
Tue Apr 15 15:38:44 CEST 2003


Hi,
PORT E, pin 5 is interrupt input from Ethernet controller. If you configure
it as output, the board would not work.
Alex.
----- Original Message -----
From: "Tom NystrЖm" <m99tomny at embassaden.liu.se>
To: <en-nut-discussion at egnite.de>
Sent: Tuesday, April 15, 2003 8:44 AM
Subject: [En-Nut-Discussion] Problem with Port E Pin 5 and Ethernet


> Hello!
>
> Earlier we used Timer 3 to generate PWM signals on outputs A (Port E Pin
3)
> and C (Port E Pin 5). When we decided the PWM was no longer needed and
> turned Timer 3 off to use Port E Pins 3 & 5 as digital outs we encountered
a
> problem - the Nut locked up when executing the program.
>
> After some work it was discovered that the combination of
> + setting Port E Pin 5 as Out
> + registering/configuring an Ethernet device
> + NOT using Timer 3
> caused the problem. All other pins of Port E can be set freely as In or
Out.
>
> Below is an example with UART and Ethernet illustrating the problem and
its
> makefile. Has anyone else found this and what might be the cause?
>
> Regards
> Tom NystrЖm
>
>
> #include <stdio.h>
> #include <io.h>
> #include <dev/nicrtl.h>
> #include <dev/uartavr.h>
> #include <sys/timer.h>
>
> // Is needed if an Ethernet device is NOT registered/configured.
> void bugfix(void *arg)
> {
>    NutEventPostAsync(arg);
> }
>
> int main(void)
> {
>   //DDRE=(1<<DDE5); // This line makes the Nut crash.
>   DDRE=0xDF; // All other pins work as Out.
>   u_long baud = 115200;
>
>   NutRegisterDevice(&devUart0, 0, 0);
>   freopen("uart0", "w", stdout);
>   _ioctl(_fileno(stdout), UART_SETSPEED, &baud);
>   NutSleep(200);
>
>   if(NutRegisterDevice(&devEth0, 0x8300, 5))
>     puts("Registering device failed");
>
>   if(NutNetAutoConfig("eth0"))
>     puts("Configuring device failed");
>
>   puts("Ready\r\n");
>
>   for(;;)
>     {
>       NutSleep(1000);
>       puts("Hello world\r\n");
>     }
> }
>
>
> Makefile:
>
> PROJ = simple
> top_srcdir = ../..
> include $(top_srcdir)/app/Makedefs
> SRCS =  $(PROJ).c
> OBJS =  $(SRCS:.c=.o)
> LIBS =  $(LIBDIR)/nutinit.o -lnutnet -lnutpro -lnutos -lnutdev -lnutcrt
> TARG =  $(PROJ).bin
> all: $(OBJS) $(TARG)
> include $(top_srcdir)/app/Makerules
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list