Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] Help with AT32 part

2011-06-20 by Tim Mitchell

----Original Message----
From: AVR-Chat@yahoogroups.com
[mailto:AVR-Chat@yahoogroups.com] On Behalf Of David Kelly
Sent: 18 June 2011 04:41 To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Help with AT32 part

> On Jun 16, 2011, at 10:31 AM, Tim Mitchell wrote:
> 
> > Haven't done this on AVR32 but on ARM you just use
> > bitwise anding and oring to change the port bits you
> > are interested in, leaving the others unaffected.  
> 
> 
> Others are not exactly unaffected. Its still a
> read-modify-write and if the others are inputs then
> writing a 1 back to their port may have unintended
> consequences such as enabling pullups, or a 0 will
> disable pullups.    

I don't think that's true, the port output setting register is separate to the input reading register. 

So if you OR a value to the port, it will read-modify-write with the current output state, not the current input state. If a pullup was enabled using the output register then it still will be after the read-modify-write.

Both AVR32 and ARM also have port-set and port-clear registers which do the read-modify-write for you. AVR32 has a port-toggle register too which ARM does not have.

-- 
Tim Mitchell

Attachments

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.