Sorry if the question seems silly, but I really need some expert guidance. My question is as follows: What are the necessary pins to program an ATMega16 chip over ISP interface? I've bought a locally made ATMega16L target board. I intend to use a standard USBASP (Fischl design) AVR programmer. Unfortunately, ISP headers on both devices are different. I'm really confused what pins to connect and what not. My AVR programmer has no Vcc output, while the target board ISP header has a pin marked Vcc. Do I need to power my target board with my programmer while writing to the chip, or the DC power of my target board would suffice?
My Target board ISP header has following pins: 1. Vcc (+5V) 2. Gnd 3. MOSI 4. RxD 5. MISO 6. TxD 7. SCK 8. No connection 9. SS 10. RST
AVR Programmer ISP Header: 1. MOSI 2. N/C 3. RST 4. SCK 5. MISO 6. N/C 7. N/C 8. N/C 9. Gnd 10. Gnd
If only MOSI, MISO, RST, SCK and Gnd pins of AVR programmer are used, where do I connect Vcc, TxD, RxD, SS pins of target ISP header. I'm willing to do some cross-over connections between, programmer and target board ISP headers. Please help!
2 Answers 2
For ISP programming you only need MISO, MOSI, SCK, RESET and GND.
The Vcc connection is optional, if the programmer can supply Vcc then you can power the board from the programmer.
Note that the two Vcc should never be connected if they are both active because you will create a short. When you power the board from the programmer make sure to unplug the mains supply of the board.
where do I connect TxD, RxD, SS pins of target ISP header.
There is no need for these in ISP mode and normally they are not part of the ISP plug
enter image description here
Note that some programmers
I'm adding the connection scheme that should be followed for the ISP lines.
The pins involved are:
- MISO : Master In Slave out
- MOSI : Master Out Slave In
- SCK: Clock
- RST: Reset
- GND: Ground
- VCC: Power supply (optional, if used the board mains supply should be disconnected. Also make sure that the voltage levels match, 5v or 3.3v)
enter image description here
MISO/MOSI lines should not be cross connected. MISO is an input for master and output for slave and MOSI is output for master and input for slave so MISO connects to MISO and MOSI to MOSI.
-
\$\begingroup\$ I believe (can someone else confirm) that some ISPs require the VCC connection in order to detect 5V vs 3.3V. Mine is the "Pololu USB AVR Programmer v2.1", and the proper LED didn't start blinking until I connected VCC (avrdude was also failing while trying to write to flash). The AVR itself is powered via two 1.5V batteries at all time (while programming, and while running). \$\endgroup\$Harry Pehkonen– Harry Pehkonen2018年04月03日 13:09:18 +00:00Commented Apr 3, 2018 at 13:09
Required pins for programming an AVR are:
Programmer Target
MOSI-------MISO
MISO-------MOSI
SCK--------SCK
RESET------RESET
GND--------GND
With this wiring you need to power the target device from its own power supply. Do check that programmer and the target device are 5V powered. If the target device is powered from a different voltage you probably need some extra level converters.
For In Circuit Serial Programming, no other connections are required.
- MOSI = Master Out Slave In
- MISO = Master In Slave Out
So MOSI connects to MISO, no need for an extra cross.
-
\$\begingroup\$ Thanx for the answer! But here is a small concern. Do I need to cross connect MISO and MOSI pins of target and programmer?? In many online tutorials, I've seen they are connected straight forward! The schematic provided by my avr programer also shows straight connections. \$\endgroup\$Vinit Shandilya– Vinit Shandilya2014年01月07日 18:53:05 +00:00Commented Jan 7, 2014 at 18:53
-
\$\begingroup\$ Updated my answer. \$\endgroup\$jippie– jippie2014年01月07日 18:55:29 +00:00Commented Jan 7, 2014 at 18:55
-
\$\begingroup\$ That makes sense, but again, please have a look at this- avrfreaks.net/… \$\endgroup\$Vinit Shandilya– Vinit Shandilya2014年01月07日 19:02:03 +00:00Commented Jan 7, 2014 at 19:02
-
2\$\begingroup\$ MISO is Maser In Slave Out and MOSI is Master Out Slave In. There is no reason to cross connect MISO and MOSI because MISO is an input for master and output for slave and MOSI is output for master and input for slave. MISO connects to MISO and MOSI to MOSI. \$\endgroup\$alexan_e– alexan_e2014年01月07日 19:17:46 +00:00Commented Jan 7, 2014 at 19:17
-
1\$\begingroup\$ @VinitShandilya programmer is the master and AVR the slave. Do not cross the connection, connect it as shown in the datasheet. \$\endgroup\$alexan_e– alexan_e2014年01月07日 19:56:53 +00:00Commented Jan 7, 2014 at 19:56