Implement JTAG Daisy-Chain access in Firmware

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

What am I doing

 

I am developing large grids (up to 16 x 16) of controller (usually ATmega1284P) for automated test systems. All channel controller can be accessed via I²C interface by a central controller. Initially I am flashing a bootloader to each controller in the grid and firmware can then be uploaded via I²C interface. This is handled by the central controller.

The firmware for each Channel is identical but a specific I²C slave address has to be written to EEPROM. Otherwise they can not be addressed.

 

What I did so far

 

This is working very well. Let me explain the steps that I have taken so far:

 

In the first generation I flashed the bootloader for each grid controller using SPI manually. Programmed flash, fuse bits and EEPROM (I²C address) using a customized tool that using atprogram.exe in background. This is annoying, time-consuming and a cause of failure of course (skip channel, program two channels with same address etc.).

 

In the second generation I arranged columns of the grids as JTAG daisy chains and flashed them using atprogram.exe. It reduced the "reconnection-effort" by sqrt(row number). Much better, working fine but not yet what I would call elegant.

 

What I want to do

 

For more convenience and an easy-to-explain setup of a virgin system, I want the intial firmware handling still improved. What I am currently aiming at is that the master controller can access the JTAG daisy-chains using multiplexer and replace the programmer (currently: ATMEL-ICE). I have arranged the channels in columns of 8 or 16 - depending on controller type. Electronically the system is working already. Columns can still be flashed manually to stay compatible with existing systems.

 

Where I need your help

 

 

I have understood and can create firmware for a microcontroller which accesses another microcontroller's memories via JTAG. But can you help or explain me how I can implement JTAG access to a specific controller in a daisy-chain? The TAP control etc. meaning: accessing a single controller is described well in ATMEL datasheet. What I cannot properly wrap my mind around is the handling of a daisy chain. I know that TDI/TDO are shift-registers.

Basically I need simple example(s) of how to address specific controllers in a daisy-chain.

 

If JTAG daisy-chain access works, I do not need bootloader for the channels anymore and can flash the memories directly. Much faster than uploading firmware via I²C. Additionally I can use the other benefit of JTAG and run boundary-scan on-line to do electrical tests (in case of failure). Much more elegant in my opinion!

 

Thank you in advance

Last Edited: Wed. Mar 22, 2017 - 07:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, either my question is not well enough written or this this is indeed a pioneer task.

 

I already had a correspondence with ATMEL support for several weeks resulting only in well-known links to datasheets, AtmelStudio documentation etc. which can be found by entering "JTAG" and "ATMEL" in any Internet Search Engine.

Either they really did not understand at all what I was trying to do -which is hard to imagine since I took the time to explain it (in many different ways)- or they really do not want to give out any detailed information on that topic. Although that does not make sense either since JTAG itself is well-documented and daisy-chaining cannot be anything else like a simple extension to it.

 

Anyway, I am going to reverse engineer JTAG daisy-chain signal handling myself now. Think I have waited enough. Will compare JTAG operations with and without daisy-chain. It is probably a very easy concept. But without any example I have problems in understanding it.

 

If I have results I will post them here so it may help others in the future.