Adding to Kris's answer
At 06:05 AM 1/15/05 -0800, you wrote:
<snip>
>GPIO Pin Value Register IOPIN
>
>This register provides the value of the GPIO pins. Register's value
>reflects any outside world influence on the GPIO configured.
>
>example:
<snip>
> value = IOPIN0; /* reads the digital input value on P0.5*/
>
> The above program reads the digital input at port P0.5 and holds
> the value in integer variable value.
<snip>
>if I go by above statements and declare IOPIN0 = 0x00000020 gives IOSET0 =
>0x00000020 and IOCLR0 = 0x000000D0 which clears my P0.4 and P0.6, which I
>declare them as outport ports to generate 1.
>
> This will not serve my purpose .....then how can I access the
> digital input value on P0.5 ???
value = IOPIN0;
Just as it says in the example.
Remember that you must set the appropriate IODIR register correctly as well.
BTW, the above sequence sets pin 0.5 high (and all others low), Then sets
pin 0.5 high again (leaving the others undisturbed) , and finally clears
pins 0.7, 0.6 and 0.4 while leaving the other pins unaffected.
If pin 0.5 is an input then it's value won't be affected by any of this.
Robert
" 'Freedom' has no meaning of itself. There are always restrictions,
be they legal, genetic, or physical. If you don't believe me, try to
chew a radio signal. "
Kelvin Throop, IIIMessage
Re: [lpc2000] congratulations
2005-01-15 by Robert Adsett
Attachments
- No local attachments were found for this message.