[En-Nut-Discussion] PIO ports invested

Thiago A. Corrêa thiago.correa at gmail.com
Sat Aug 1 02:43:39 CEST 2009


Hi,

   Yeah, that's right. I think if you set them as outputs before
setting their state it should work.

Kind Regards,
   Thiago A. Correa

On Fri, Jul 31, 2009 at 3:54 AM, Allister Mannion<allister at nowatt.com> wrote:
> I'm assuming NutOS does not initialize/enable the alternate functions of
> many of the IO pins on an AVR (ethernut13h) system unless you register
> the device. Is this correct?
>
> I seem to be getting the opposite out on most/all the IO pins (i.e. if I
> set something high, it's actually low?). E.g.
>
>    GpioPinSetHigh(SBBI0_CS0_PORT, SBBI0_CS0_BIT);
>    GpioPinConfigSet(SBBI0_CS0_PORT, SBBI0_CS0_BIT, GPIO_CFG_OUTPUT);
>    GpioPinSetHigh(SBBI0_CS1_PORT, SBBI0_CS1_BIT);
>    GpioPinConfigSet(SBBI0_CS1_PORT, SBBI0_CS1_BIT, GPIO_CFG_OUTPUT);
>    GpioPinSetHigh(SBBI0_CS2_PORT, SBBI0_CS2_BIT);
>    GpioPinConfigSet(SBBI0_CS2_PORT, SBBI0_CS2_BIT, GPIO_CFG_OUTPUT);
>    NutSleep(10000);
>
> with avrpio.h (in *bld/include/cfg/arch) as:
>
>
>        #ifndef SBBI0_CS0_PORT
>        #define SBBI0_CS0_PORT AVRPORTD
>        #endif
>
>        #ifndef SBBI0_CS0_BIT
>        #define SBBI0_CS0_BIT 7
>        #endif
>
>        #ifndef SBBI0_CS1_PORT
>        #define SBBI0_CS1_PORT AVRPORTD
>        #endif
>
>        #ifndef SBBI0_CS1_BIT
>        #define SBBI0_CS1_BIT 6
>        #endif
>
>        #ifndef SBBI0_CS2_PORT
>        #define SBBI0_CS2_PORT AVRPORTD
>        #endif
>
>        #ifndef SBBI0_CS2_BIT
>        #define SBBI0_CS2_BIT 5
>        #endif
>
>
> You'd expect the above to set the defined pins high, but they're low?
>
> Any ideas?
>
> Allister Mannion
>
> ΠΟωaττ - saving more than you think
> +41 (0) 79 - 7591554
> www.nowatt.com
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



More information about the En-Nut-Discussion mailing list