AVR ICSP / SPI isolation using 74HC4053

Thread Starter

ilium007

Joined Aug 24, 2013
139
I am putting together an ATMega2560 module that will plug into various boards I am designing. I want the 2560 board to be universal and then design the other boards for specific uses ie. inputs, outputs and ADC etc. The project I am working on has a large amount of I/O and each board will communicate via my own CanBUS design.

Whilst laying out the ATMega2560 board I started thinking about the SPI lines being shared with the ICSP. The. Amtel data sheets and design docs state that series resistors should be used between the AVR programmer and any SPI devices. The downside is that this would affect the SPI bus speed. I have found a single reference after a day of research pointing to using the 74HC4053 multiplexer to isolate the SPI bus when the programmer is using the RESET line to put the ATMega2560 into programming mode.

This approach seems the most robust method of ensuring thta only the AVR programmer is driving the SPI bus. I want to make these ATMega2560 universal so I can't know at this point if any SPI devices I use in the future will 3-state their MISO lines and the 74HC4053 would guarantee that only the ICSP was connected to the SPI bus during programming.

Thoughts?

85F7E2D7-9B2A-4372-A30A-BB117161C573.jpeg
 

Thread Starter

ilium007

Joined Aug 24, 2013
139
At the moment I’m just trying to future proof my design so that I don’t lock myself out of using SPI devices so I don’t have a requirement.
 

DickCappels

Joined Aug 21, 2008
10,170
I believe but don't know for sure that the resistors between the programmer and the CPU are there to damp ringing on the SPI lines. Consider, for example, what would happen if there was sufficient ringing on the clock line to cause it to look like a double pulse?

If you find that the programmed data does not match the data you gave to the programmer you might want to put the resistors back.
 

ericgibbs

Joined Jan 29, 2010
18,848
hi,
For reference I have used 16MHz and 20MHz SPI Clocks with AVR and PIC's using resistor level shifters, with no problems.
Why do you think the resistors will give a problem.?
E
 

Thread Starter

ilium007

Joined Aug 24, 2013
139
hi,
For reference I have used 16MHz and 20MHz SPI Clocks with AVR and PIC's using resistor level shifters, with no problems.
Why do you think the resistors will give a problem.?
E
Because everything I read suggested they would reduce the bus speed
 

Thread Starter

ilium007

Joined Aug 24, 2013
139
I believe but don't know for sure that the resistors between the programmer and the CPU are there to damp ringing on the SPI lines.
I don’t believe the datasheets show resistors between the programmer and AVR, they are between the AVR and connected SPI devices to prevent the SPI devices driving the SPI lines during programming.

7A2EE591-D2CA-4A24-80A2-895B8882C420.jpeg
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,848
hi,
I am sure you appreciate when designing a new product, you must have factual technical data in order to ensure the product will work as expected.
Why don't you run some in house tests in order to confirm the limitations that maybe caused by the resistors.?
E
 

Thread Starter

ilium007

Joined Aug 24, 2013
139
hi,
I am sure you appreciate when designing a new product, you must have factual technical data in order to ensure the product will work as expected.
Why don't you run some in house tests in order to confirm the limitations that maybe caused by the resistors.?
E
The problem is that I haven’t yet decided on all of the SPI sensors I’ll be using on the boards these ATMega2560 boards will be plugged in to but I want to build the 2560 boards now :(
 

MrChips

Joined Oct 2, 2009
30,801
It may be true that resistors will reduce the bus speed.
What is the max speed that will be adversely affected?
What is the SPI speed that you are operating?

I believe that you are nowhere close to the point that the resistor would have an effect.
 
Top