AVR128DA32 Odd Problems (?)

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

Greetings All,

 

I have made a custom PCB for the AVR128DA32, and have gotten a number of things working just fine - including drive for WS2812B LEDs and USART communication through Tera Term.

 

Sadly, there are some things that are not working . . .

 

1. Unable to read PORTD.0 as an input.  I have three switches on PORTD2-0, and the port direction bits are correct.  Bits 2 & 1 work fine, but bit 0 doesn't read.  I have measured proper switch voltages right up to the MCU pin. If I configure bit 0 as an output, it produces the proper voltages.  I am at a loss to figure out why bit 0 isn't reading

 

2. Unable to get external 32.768kHz oscillator working.  I see correct values in the CLKCTRL_XOSC32KCTRLA register.  The TOSC1 & TOSC2 pins have proper continuity to the crystal and load caps.  I calculated 20pF load capacitance for a 12.5pF crystal.  I have tried different crystals and load capacitor values, including swapping in parts from a functioning board.

 

3. After having made no changes to anything, my JTAGICE3 is refusing to connect to the target, giving a message 'Atmel Studio was unable to start your debug session. Please verify device selection, interface settings, target power and connections to the target device. Look in the details section for more information.' I looked under the details section, and saw nothing useful.  I have power cycled the target and the JTAGICE3, and restarted Studio.  No joy.

 

I would like to hear if anyone has suggestions, or was having similar problems.  Thanks!

 

Altazi

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

Altazi wrote:
I have made a custom PCB for the AVR128DA32

Altazi wrote:
1. Unable to read PORTD.0 as an input

Ok, so show us your pcb layout

Altazi wrote:
2. Unable to get external 32.768kHz oscillator working

Watch xtal's seldom need external caps

 

Jim

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

Altazi wrote:
1. Unable to read PORTD.0 as an input.
errata?

Digital Input on Pin Automatically Disabled When Pin Selected for Analog Input | AVR128DA Silicon Errata and Data Sheet Clarification

Altazi wrote:
I have tried different crystals and load capacitor values, including swapping in parts from a functioning board.

  • test oscillator's amplifier and multiplexer by applying a 32KHz signal to XTAL32K1 (no crystal)
  • measure oscillator's amplifier gain and phase margins (crystal)

Altazi wrote:
I looked under the details section, and saw nothing useful.
UPDI has to tri-state.

 


Testing Crystal Oscillation Robustness | Selecting and Testing 32 KHz Crystal Oscillators for AVR® Microcontrollers

 

TinyX-OCD (UPDI) Special Considerations | Atmel-ICE

 

"Dare to be naïve." - Buckminster Fuller

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

Hello, Jim.

 

The issue with PORTD.0 not reading is not a PCB issue.  As I said, I traced the signal right up to the MCU pin.  The voltages at the pin look good - just the same as they are on PORTD.1 & PORTD.2.

 

Regarding the 32.768kHz external oscillator, I am following the design guidelines and also the design of the Curiosity Nano.

 

My biggest (new) problem is with the JTAGICE3 tool.  It seems to have stopped working altogether, despite my having changed nothing.  It was working fine right up to the point it wasn't.

 

Altazi

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

Altazi wrote:
It seems to have stopped working altogether,

Can you read the device ID in the "device programming" window?

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

mraardvark wrote:

Altazi wrote:
It seems to have stopped working altogether,

Can you read the device ID in the "device programming" window?

Sadly, no.  I was able to read the target voltage (3.2V), but received this message when attempting to read the device ID:

 

"Unable to boot device. Debugger command Prog Mode Enter failed.

Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device."

 

Altazi

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


This is a view showing the external 32.768kHz crystal and load caps.  It's difficult to imagine a cleaner layout.

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

"Dare to be naïve." - Buckminster Fuller

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

Altazi wrote:
"Unable to boot device. Debugger command Prog Mode Enter failed.

Probably worth looking at a backend log from Studio (or pymcuprog -v debug) to get more info on where/how its failing...