[En-Nut-Discussion] I/O pins control

MarPac marpac at centrum.cz
Sun Nov 21 11:02:48 CET 2004


Well, I've found the way, how to do the stuff. First, you have to set the
input and output pins of the each port. It's a little bit confusing, because
the port is made in a little bit different style comparing to the x51 ports.
As I understood well, it's like in the Microchip devices, so you have to
stricly specify, which bit is input and which is an output one. You have to
store the value to DDR register, for instance DDRE=DDRE&0x7F; means, that
PE.6 is an input (0 is input, 1 is output).

Setting up the bit is done by the cbi and sbi functions.
----- Original Message ----- 
From: "Michael De Backer" <micdb at skynet.be>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Tuesday, November 09, 2004 8:34 PM
Subject: Re: [En-Nut-Discussion] I/O pins control


> Hello,
>
> I'm beginning with the Charon II Dev Kit too. Looking for the same
> answers :D
>
> How can I use one pin to generate pulses (25,50,70 and 100ms) ? Is it
> possible to use NutTimerStart and make the pulse in the callback routine
> ? Is it a better way to do that ?
>
> Michael
>
> > Hi guys,
> >
> > I'm just starting with the Ethernut project. I already bought the Charon
II DB packet and have done some stuff. But I can't find any document
containing the stuff about I/O pins control. I tried to check the examples
and the .h files and there is so many things to understand.
> > Could you help me to learn the I/O pins control?
> >
> > I found the outp() and inp() functions, cbi() and sbi() as well.
> >
> > 1) cbi() and sbi() works fine, outp() too, I don't know how to handle
inp().
> > 2) How to check, if there is an input bit set to 1 or 0?
> > 3) What are the differences between the port deffinitions DDRD, DDD3 for
instance, PORTD, PORTD3 and so on?
> >
> >
> > Thanks a lot for your help for the newbee :-)))
> > _______________________________________________
> > En-Nut-Discussion mailing list
> > En-Nut-Discussion at egnite.de
> > http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> >
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
>




More information about the En-Nut-Discussion mailing list