xmega without pulling resistors

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

hi, I searched all forums, no answers, so writing this question:

how do you set PINxCTRL I/O register for no pullup or pulldown?  table pg 152 does not has "none" as a choice.

for xmega128a4u, AU manual shows I/O configuration for pullup or pulldown, but there is no "none".  there is a N/A (not applicable) for totem putput, but I want my adc as analog input.

I have setup ADC4 as digital input disabled.  fine.

I read the appnote for xmega I/O, but it skips the choice of "none".

both pdfs ignore the choice for "none".

please explain.

 

<p>Vern</p>

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

IRC when you select a pin as input for the ADC, all digital circuitry is disconnected automatically, including the pulling resistors.

AFAIK this is true for all peripherals: as soon as they're enabled, they take control of their pins and configure them automatically.
 

As a side note: Be aware that the xmega's ADC has a few issues with offset. Consult the respective app notes, it's not all in the manual and datasheet.

 

EDIT: I remembered it wrong. The I2C interface seems to be only one that configures the pins automatically.

"Some people die at 25 and aren't buried until 75." -Benjamin Franklin

 

What is life's greatest illusion?"  "Innocence, my brother." -Skyrim

 

Last Edited: Tue. May 9, 2017 - 02:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In any case, the "no pull-up" option is "totem". For ADC use there is also a digital input disable bit on some parts.

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

thanks, will do  "no pull-up" option is "totem".

 to atmel-- suggest that au manual be fixed.

xmega a4u are awesome.angel

<p>Vern</p>

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

that is not true.  setting an adc pin in the adc muxctrl does not change any pin resistors or digital circuitry.

this

            sts  PORTA_PIN0CTRL,temp2 ;temp2=0b00_011_010 for pullup & sense falling level

works.

 

for usart, you must have this:

            sbi  VPORT2_DIR,7        ;mapped PORTD_DIR, UART PORTD1 PD7 =TxD1

 

or nothing is sent.

 

<p>Vern</p>

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

You're right, it doesn't work automatically. I just never realized that because the pin's default configuration (which is totem pole) already is correct for the ADC.

 

vbunch wrote:
sts PORTA_PIN0CTRL,temp2 ;temp2=0b00_011_010 for pullup & sense falling level

 

It seems weird that you enable the pull ups when using the ADC, and changing the interrupt sense configuration also seems pointless on an analogue input. Are you sure this is what you meant to write here?

 

And you're also right about the USART, it is necessary to make the TX pin an output. I must have been confused by the TWI, which does seem to configure its pins automatically. At least i never had to change anything by hand and it all works perfectly fine.

-Patrick

"Some people die at 25 and aren't buried until 75." -Benjamin Franklin

 

What is life's greatest illusion?"  "Innocence, my brother." -Skyrim

 

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

On Gabriel's suggestion, I set the pincontrol registers for analog input pins to (3<<3).

274,207,281-1 The largest known Mersenne Prime

Measure twice, cry, go back to the hardware store