Jtag/ISP programming on input pins

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

Hi Guys,

 

Struggling with an appropriate title, but my question is this.  I've designed a board with 2 x Atmega324PB's on it.  The purpose of the board is to provide 64 inputs (32 pins on each chip) using PCINT, with connectivity on the TWI ports.

 

The issue I have is how to program them, as the pins for JTAG are assigned as inputs and there are only 4 free pins, none of which are assigned for JTAG or ISP.

My thoughts were to have a jumper on the board that if closed would programmatically disable the inputs/PCINT's on the pins I need for JTAG.

 

Is that a reasonable option?  I would then be able to debug the system with the exception of the disabled pins.

 

regards

 

 

 

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

Life is always easier with a single chip i.e. with sufficient legs.

 

I know that you don't need the SRAM or Flash.   But an ATmega2560 would take less pcb space and probably cheaper.

And you can prototype with an Arduino MEGA2560 board.   Just enable the JTAGEN fuse.

 

David.

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

Yes that would have been the logical option.  Sadly unless I'm not reading the datasheets properly, there are only 24 PCINT enabled pins.

 

regards

 

 

 

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

Oops.   I had assumed there was Pin Change on every port.

 

I suggest that you look at ARM chips.   A single chip makes life easier.   (And they work at a sensible 3.3V)

Or look at an external Port Expander chip.

 

From an electrical point of view it is easy for chip designers to put PinChange on every Port.

 

David.

 

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

nikm wrote:
Is that a reasonable option?
program yes, debug maybe

An alternative is an AVR GDB server inside the mega324PB (4 JTAG pins replaced by 2 UART pins)

 

P.S.

nikm wrote:
I've designed a board with 2 x Atmega324PB's on it.
The follow-on to mega324PB is mega3209 (4 JTAG pins replaced by 1 UPDI pin)

mega4809 in PDIP-40 almost fits by TWI (shy one pin); should fit by UART in one wire mode.

Better bench test by a mega4809 Curiosity Nano.

 


ATmega324PB - 8-bit PIC Microcontrollers

GitHub - jdolinay/avr_debug: Source level debugger for Arduino - GDB stub for Atmega328 microcontroller used in Arduino Uno.

via How to debug an AVR with an Arduino project and GDB? (Visual Micro)

ATMEGA3209 - 8-bit Microcontrollers

ATMEGA4809 - 8-bit AVR Microcontrollers - Microcontrollers and Processors

ATmega4809 Curiosity Nano

 

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

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

Oooh, thank you for that, might just do the trick!  Just ordered an eval kit to have a play with.  There's no mention of PCINT so I'm guessing I need to look ate the CCL.  I need 32 I/O pins with the equivalent of PCINT on them (up to 16 Encoders ) so 41 pins will do nicely.

Thanks for the tip

 

regards

 

P.S.  Anyone know if UPDI can be daisy chained like JTAG?