Yahoo Groups archive

Lpc2000

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

Thread

Writing to IOPIN on LPC21xx possible?

Writing to IOPIN on LPC21xx possible?

2005-01-04 by Aalt Lokhorst

Hello All,

In the Philips document 'UM_LPC21XX_LPC22XX_2.pdf' on page 137 I read:

   Applications that require instanatneous appearance of zeros and ones
   on the respected parallel port can use direct access to port’s
   corresponding GPIO Pin Value Register (IOPIN).
   Assuming that pins P0.8 to P0.15 are configured as output, write to 
   IO0PIN:

     IO0PIN = 0x0000 C700

   will produce the same output as following sequence of writes:

     IO0SET = 0x0000 C700
     IO0CLR = 0x0000 3800

   Solution utilizing access to IO0SET and IO0CLR will take more steps
   compared to a single IO0PIN write access.

The same document shows on page 135 that IO#PIN is a ReadOnly register.

Am I missing something, how can you write to a ReadOnly register?

Best Regards,

-- ==============================
Aalt Lokhorst
Schut Geometrische Meettechniek bv
Duinkerkenstraat 21
9723 BN Groningen
P.O. Box 5225
9700 GE Groningen
The Netherlands
Tel: +31-50-5877877
Fax: +31-50-5877899
E-mail: Lokhorst@...
==============================

Re: Writing to IOPIN on LPC21xx possible?

2005-01-04 by Rodrigo Cesar da Silva Martins

Yes, it's possible...but some people could not agree about 
the "instantaneous"...;-))
--- In lpc2000@yahoogroups.com, "Aalt Lokhorst" <lokhorst@s...> 
wrote:
> Hello All,
> 
> In the Philips document 'UM_LPC21XX_LPC22XX_2.pdf' on page 137 I 
read:
> 
>    Applications that require instanatneous appearance of zeros and 
ones
>    on the respected parallel port can use direct access to port's
>    corresponding GPIO Pin Value Register (IOPIN).
>    Assuming that pins P0.8 to P0.15 are configured as output, 
write to 
>    IO0PIN:
> 
>      IO0PIN = 0x0000 C700
> 
>    will produce the same output as following sequence of writes:
> 
>      IO0SET = 0x0000 C700
>      IO0CLR = 0x0000 3800
> 
>    Solution utilizing access to IO0SET and IO0CLR will take more 
steps
>    compared to a single IO0PIN write access.
> 
> The same document shows on page 135 that IO#PIN is a ReadOnly 
register.
Show quoted textHide quoted text
> 
> Am I missing something, how can you write to a ReadOnly register?
> 
> Best Regards,
> 
> -- ==============================
> Aalt Lokhorst
> Schut Geometrische Meettechniek bv
> Duinkerkenstraat 21
> 9723 BN Groningen
> P.O. Box 5225
> 9700 GE Groningen
> The Netherlands
> Tel: +31-50-5877877
> Fax: +31-50-5877899
> E-mail: Lokhorst@S...
> ==============================

Re: Writing to IOPIN on LPC21xx possible?

2005-01-04 by Gus

I never used IOPIN to set pins. I only use it to read status. This 
doesn't mean that it is not possible. But it is a good practice to 
ise IOCLR and IOSET because you are accessing the latches of the 
pins directly. Consider this, IOPIN=IOPIN|1; this will happen as 
read-medefy-write now, when you read IOPIN, you are reading the 
actual state of the pin and if for some reason a load on that pin 
that caused it to be in the wrong state (it is 1 but was read as 0)
that means after read-medify-write, the pin that you didn't want to 
change got changed.

So, only use IOPIN to write not to read-modefy-write, safer.

Gus

--- In lpc2000@yahoogroups.com, "Aalt Lokhorst" <lokhorst@s...> 
wrote:
> Hello All,
> 
> In the Philips document 'UM_LPC21XX_LPC22XX_2.pdf' on page 137 I 
read:
> 
>    Applications that require instanatneous appearance of zeros and 
ones
>    on the respected parallel port can use direct access to port's
>    corresponding GPIO Pin Value Register (IOPIN).
>    Assuming that pins P0.8 to P0.15 are configured as output, 
write to 
>    IO0PIN:
> 
>      IO0PIN = 0x0000 C700
> 
>    will produce the same output as following sequence of writes:
> 
>      IO0SET = 0x0000 C700
>      IO0CLR = 0x0000 3800
> 
>    Solution utilizing access to IO0SET and IO0CLR will take more 
steps
>    compared to a single IO0PIN write access.
> 
> The same document shows on page 135 that IO#PIN is a ReadOnly 
register.
Show quoted textHide quoted text
> 
> Am I missing something, how can you write to a ReadOnly register?
> 
> Best Regards,
> 
> -- ==============================
> Aalt Lokhorst
> Schut Geometrische Meettechniek bv
> Duinkerkenstraat 21
> 9723 BN Groningen
> P.O. Box 5225
> 9700 GE Groningen
> The Netherlands
> Tel: +31-50-5877877
> Fax: +31-50-5877899
> E-mail: Lokhorst@S...
> ==============================

Re: Writing to IOPIN on LPC21xx possible?

2005-01-05 by Aalt Lokhorst

Hello Gus and Rodrigo,

Thanks for the answer, I was confused by the fact that the IO#PIN 
register is stated as a ReadOnly register on page 135 of the 
'UM_LPC21XX_LPC22XX_2.pdf'.

The conclusion is that IO#PIN isn't a ReadOnly register so the 
information on page 135 is wrong.

I am familiar with the Read Modify Write problem. In a 8051 circuit I 
had some jumpers on a port. Extreme caution was needed to prevent the 
use of ReadModifyWrite instructions.

I noticed the 'instanatneous', it is a copy and paste from the 
usermanual page 137.

Thanks again,


-- 
==============================
Aalt Lokhorst
Schut Geometrische Meettechniek bv
Duinkerkenstraat 21
9723 BN Groningen
P.O. Box 5225
9700 GE Groningen
The Netherlands
Tel: +31-50-5877877
Fax: +31-50-5877899
E-mail: Lokhorst@...
==============================

Re: [lpc2000] Writing to IOPIN on LPC21xx possible?

2005-01-06 by Anton Erasmus

On 4 Jan 2005 at 14:06, Aalt Lokhorst wrote:

> 
> Hello All,
> 
> In the Philips document 'UM_LPC21XX_LPC22XX_2.pdf' on page 137 I read:
> 
>    Applications that require instanatneous appearance of zeros and
>    ones on the respected parallel port can use direct access to port’s
>    corresponding GPIO Pin Value Register (IOPIN). Assuming that pins
>    P0.8 to P0.15 are configured as output, write to IO0PIN:
> 
>      IO0PIN = 0x0000 C700
> 
>    will produce the same output as following sequence of writes:
> 
>      IO0SET = 0x0000 C700
>      IO0CLR = 0x0000 3800
> 
>    Solution utilizing access to IO0SET and IO0CLR will take more steps
>    compared to a single IO0PIN write access.
> 
> The same document shows on page 135 that IO#PIN is a ReadOnly
> register.
> 
> Am I missing something, how can you write to a ReadOnly register?
> 

Have you received any feedback on this from Philips ? I also notice that 
IOSET is defined as Read/Write. Why would one want to read the IOSET
register. As far as I understand it, If one writes 1 to IOSET, then 1 to IOCLR,
the output pin would be 0, but the IOSET register will still indicate a 1, hence
making a read from this register meaningless.

Regards
   Anton Erasmus



-- 
A J Erasmus

Re: [lpc2000] Writing to IOPIN on LPC21xx possible?

2005-01-07 by Aalt Lokhorst

Hello Anton Erasmus,

No response directly from Philips. But I have to admit that I didn't ask 
  it directly to Philips. I asked it on the forum and I am assuming that 
Philips is reading it also.

Regards
   Aalt Lokhorst

Anton Erasmus wrote:
Show quoted textHide quoted text
> Have you received any feedback on this from Philips ? I also notice that
> IOSET is defined as Read/Write. Why would one want to read the IOSET
> register. As far as I understand it, If one writes 1 to IOSET, then 1 to 
> IOCLR,
> the output pin would be 0, but the IOSET register will still indicate a 
> 1, hence
> making a read from this register meaningless.
> 
> Regards
>    Anton Erasmus
> 
> 
> 
> -- 
> A J Erasmus

Re: [lpc2000] Writing to IOPIN on LPC21xx possible?

2005-01-07 by Kerem Or

You can write to IOPIN register, if you need ones and zeros appear at the 
same time. It works. Apearently just marked as RO in the UM. pin levels 
change accordingly as stated in the UM when you write to it.

Regards,

Kerem

----- Original Message ----- 
Show quoted textHide quoted text
From: "Anton Erasmus" <antone@...>
To: <lpc2000@yahoogroups.com>
Sent: Thursday, January 06, 2005 10:23 PM
Subject: Re: [lpc2000] Writing to IOPIN on LPC21xx possible?


>
> On 4 Jan 2005 at 14:06, Aalt Lokhorst wrote:
>
>>
>> Hello All,
>>
>> In the Philips document 'UM_LPC21XX_LPC22XX_2.pdf' on page 137 I read:
>>
>>    Applications that require instanatneous appearance of zeros and
>>    ones on the respected parallel port can use direct access to port's
>>    corresponding GPIO Pin Value Register (IOPIN). Assuming that pins
>>    P0.8 to P0.15 are configured as output, write to IO0PIN:
>>
>>      IO0PIN = 0x0000 C700
>>
>>    will produce the same output as following sequence of writes:
>>
>>      IO0SET = 0x0000 C700
>>      IO0CLR = 0x0000 3800
>>
>>    Solution utilizing access to IO0SET and IO0CLR will take more steps
>>    compared to a single IO0PIN write access.
>>
>> The same document shows on page 135 that IO#PIN is a ReadOnly
>> register.
>>
>> Am I missing something, how can you write to a ReadOnly register?
>>
>
> Have you received any feedback on this from Philips ? I also notice that
> IOSET is defined as Read/Write. Why would one want to read the IOSET
> register. As far as I understand it, If one writes 1 to IOSET, then 1 to 
> IOCLR,
> the output pin would be 0, but the IOSET register will still indicate a 1, 
> hence
> making a read from this register meaningless.
>
> Regards
>   Anton Erasmus
>
>
>
> -- 
> A J Erasmus
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>

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.