Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

GPIO pin as both input and output?

GPIO pin as both input and output?

2005-03-08 by Michael Sprague

I am interested in using this new ultrasonic ranger with a LPC2129:

Parallax PING)))
http://www.parallax.com/detail.asp?product_id=28015
(link to datasheet toward bottom)

It has a single control pin that the LPC would have to send out a 
trigger pulse and then watch for the echo pulse coming back on the 
same line.

Can the LPC be used to do this with a pin used as an output then 
immediately switched to an input? Can I just modify the IODIR 
settings inline in the middle of my program and expect immediate 
change in operation of the pin? The sensor is not in production yet, 
but since Parallax is clearing out SRF04's I want to know if the 
PING))) is an option or if I should get the SRF04 on sale instead. 
The advantage of the PING))) being that it just needs one pin 
instead of 2 for the SRF04.

I am just getting started and have the eval Keil tools and MCB2100 
board. Any insight would be appreciated.

Thanks,

Michael

http://michael.sprague.name/

Re: [lpc2000] GPIO pin as both input and output?

2005-03-08 by Charles Manning

> It has a single control pin that the LPC would have to send out a
> trigger pulse and then watch for the echo pulse coming back on the
> same line.
>
> Can the LPC be used to do this with a pin used as an output then
> immediately switched to an input? 

yes

>Can I just modify the IODIR
> settings inline in the middle of my program and expect immediate
> change in operation of the pin? 

yes


"Immediate" is limited to the speed of the GPIO operation taking effect... 
probably around 100ns.

This approach is quite often used to drive the Dallas (and equivalent )1-wire 
devices where clock, power and 2-way data are all done over a single wire,

This approach can also be used to achieve open-collector-like operation.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.