Arduino Forum

Using Arduino => Microcontrollers => Topic started by: lightaiyee on Aug 06, 2015, 08:50 am

Title: Will ICSP programming be affected if there are SPI slave devices on board?
Post by: lightaiyee on Aug 06, 2015, 08:50 am
I would like to use ICSP programming. However, the circuit also uses a SPI slave device. Since ICSP and the SPI slave device both use MISO, MOSI and SCK, will ICSP programming be affected by the SPI slave device? If yes, what are some hardware changes needed to get ICSP programming working?
Title: Re: Will ICSP programming be affected if there are SPI slave devices on board?
Post by: CrossRoads on Aug 06, 2015, 07:43 pm
Yes, if the slaves can drive MISO. Be sure to have a pullup resistor on the slave chip select pins to keep them off the SPI bus while the processor's reset line is low and the IO pins are not driven (they default to INPUT state when Reset is low).
If the slaves use active high chip select, then a pulldown resistor is needed.
Title: Re: Will ICSP programming be affected if there are SPI slave devices on board?
Post by: jboyton on Aug 07, 2015, 01:44 am
There was someone recently with this problem. It turned out that the SPI device he was using doesn't tri-state the MISO line when its chip select is deactivated. The datasheet was clear on the subject.

I have an OLED display that also misbehaves during ICSP programming unless I pull up not only CS but also its RESET pin. Without the pullups it screws up not only MISO but also MOSI and SCK.
Title: Re: Will ICSP programming be affected if there are SPI slave devices on board?
Post by: chucktodd on Aug 08, 2015, 10:57 pm
There was someone recently with this problem. It turned out that the SPI device he was using doesn't tri-state the MISO line when its chip select is deactivated. The datasheet was clear on the subject.

I have an OLED display that also misbehaves during ICSP programming unless I pull up not only CS but also its RESET pin. Without the pullups it screws up not only MISO but also MOSI and SCK.

I had a similar problem with a SD card,  If the SD card was installed ISP programming would fail at different memory locations.  These locations changed depending on the byte stream send.  I about pulled out my hair until I stripped everything off the board.

Chuck.