from mega to Xmega

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!
How to configure port (ex. PORTA.0) in xMega for corresponding to
1. tri-state
2. input with pull-up
in mega/tiny?
thank )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doesn't the code in AVR1313 provide the solution? IN fact for Xmega you want to download all the PDFs and ZIPs for AVR1300 to AVR1318

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't find any tri-state in AVR1313...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

code-by wrote:
How to configure port (ex. PORTA.0) in xMega
When an input, the pin is tri-state by default. If you want to enable the pullup or pulldown resistor you need to manipulate the corresponding PINnCTRL register, e.g. PORTA.PIN0CTRL. There are other fancy things you can do by way of the PINnCTRL register.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net