EmbeddedRelated.com
Forums

Is it possible to config GPIO pins in LPC21XX ARM to be in/out?

Started by jetq88 March 8, 2007
jetq88 wrote:
> > sorry for the figure. > > --------------------- | ---------------------- > | | | | | > | |----------| | | > | MCU | | | Other | > | | |-------------| | > | | | | | > | | | | | > --------------------- | ---------------------- > | > line(or bus)
Still fouled up, but not quite as badly. Ensure you always use a fixed width font for Usenet, especially if you want to use any Ascii art. Some of the following links may help. -- Some informative links: <http://www.catb.org/~esr/faqs/smart-questions.html> <http://www.caliburn.nl/topposting.html> <http://www.netmeister.org/news/learn2quote.html> <http://cfaj.freeshell.org/google/> (taming google) <http://members.fortunecity.com/nnqweb/> (newusers) -- Posted via a free Usenet account from http://www.teranews.com
Stephen Pelc wrote:
> "jetq88" <jetq5188@gmail.com> wrote: > >> thanks for your reply, I think my question is kind of confusing, >> I meant to ask what will happen if two output pins connected to >> one line, one is put the line to high, the other is put the line >> to low since LPC21xx GPIO pins have no tri-state. > > The trick for open drain is to set the ouput permanently to a '0', > using IOCLR, and then use the IODIR direction register to set the > output state. When it's an input, the pull-up resistor will pull > the pin high. When it's an output, the preset 0 value takes it low.
I assume that device has normal pull up/down capabilities in the output mode, otherwise if it is a normal open drain output it will be much simpler, and the code clearer, to simply control it via the normal output port. BTW, to us old fogies, all that is known as 'wired or' configuration, for negative logic. It's the thing the original IBM PC designers didn't know when they designed the interrupt line configuration. -- Some informative links: <http://www.catb.org/~esr/faqs/smart-questions.html> <http://www.caliburn.nl/topposting.html> <http://www.netmeister.org/news/learn2quote.html> <http://cfaj.freeshell.org/google/> (taming google) <http://members.fortunecity.com/nnqweb/> (newusers) -- Posted via a free Usenet account from http://www.teranews.com
On Mar 9, 11:58 am, stephen...@mpeforth.com (Stephen Pelc) wrote:
> On 9 Mar 2007 09:34:27 -0800, "jetq88" <jetq5...@gmail.com> wrote: > > >thanks for your reply, I think my question is kind of confusing, I > >meant to ask what will happen if two output pins connected to one > >line, one is put the line to high, the other is put the line to low > >since LPC21xx GPIO pins have no tri-state. > > The trick for open drain is to set the ouput permanently to a '0', > using IOCLR, and then use the IODIR direction register to set the > output state. When it's an input, the pull-up resistor will pull > the pin high. When it's an output, the preset 0 value takes it > low. > > Stephen > > -- > Stephen Pelc, stephen...@mpeforth.com > MicroProcessor Engineering Ltd - More Real, Less Time > 133 Hill Lane, Southampton SO15 5AF, England > tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 > web:http://www.mpeforth.com- free VFX Forth downloads
very valuable information, great discussion on this subject , guys, thanks a lot =========== regards jet