0
\$\begingroup\$

I bought this USB programmer: USBasp USBISP 3.3V / 5V AVR Programmer USB ATMEGA8 .

Programmer Image

Programmer Pinout

But I can't understand how to connect it. This picture has got 9 circle inputs and 1 square input but all the inputs are square in my item. Can anyone help me step by step because I am a beginner.

\$\endgroup\$
4
\$\begingroup\$

The programmer you have programs the ATmega8 through the ISP interface on the device. Here is the pinout of your programmer:

enter image description here

You can see the circles and the one square? The square denotes the 1st pin, or MOSI.

I think I found the right datasheet to your ATmega8 MCU, please double check the datasheet for the MCU that you have.

Extracted from the ATmega8/ATmega8L datasheet found here: ATmega8 datasheet

enter image description here

You can see that pin 19 (PB5) is the SCK pin. Pin 18 is MISO, 17 is MOSI, 1 is RESET. These are the pins that connect to the appropriate ISP pins that you can see in the first picture above.

So your overall system will be like this:

  • Have the ATmega8 powered from a reliable DC 5V power source
  • Ensure the ATmega8 is grounded
  • Connect the pins of the ISP programmer to the appropriate pins on the ATmega8
  • Pull up resistor (~10k) on the RESET pin.

This is all you should need to get the programmer to talk to your MCU using your computer.

Best of Luck.

\$\endgroup\$
8
  • \$\begingroup\$ All the pinouts are squares.That's why I cant understand hot to connect them. \$\endgroup\$ – konsalex Aug 6 '14 at 17:41
  • \$\begingroup\$ I see there is a red wire on the programmer on one side of the ribbon cable. That side of the connector has pin 1. \$\endgroup\$ – Nick Williams Aug 6 '14 at 17:44
  • \$\begingroup\$ If this is pin 1 how can I know if it is the left or the right pin? \$\endgroup\$ – konsalex Aug 6 '14 at 17:47
  • \$\begingroup\$ It should be on the same side as the ribbon that connects to the ISP connector. \$\endgroup\$ – Nick Williams Aug 6 '14 at 17:52
  • \$\begingroup\$ @Nick I'd be careful suggesting that the red wire is, in fact, pin 1. The silkscreen shows a triangle on the opposite side, that appears to be a pin 1 designation. I would expect the silkscreen to be correct while a cable assembly could be backward. \$\endgroup\$ – JYelton Aug 6 '14 at 20:05
3
\$\begingroup\$

The "circles" and "squares" are just conventions; in this case the square indicates pin 1.

I'm not sure what you mean by "all inputs are square in my item."

If you look at the ribbon cable connector (at right in the image I added to your question), there is a triangle on the silkscreen that also denotes pin 1. (The red stripe on the ribbon cable is also usually for pin 1, but in the image it is shown backwards. I would trust the silkscreen.)

The pinout (also added) shows you the purpose of each pin. MOSI, for example, is "Master Out, Slave In." You can find additional information about this if you research In-System (ISP) Programming.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The physical pins in the box header are indeed all square, that is how they are fabricated. This physical appearance is entirely independent from the circles and squares in the connector symbol, where the square pin is usually just to distinguish pin 1 from the others. In the physical world there is usually some arrow or a colored lead to indicate pin 1. \$\endgroup\$ – jippie Aug 7 '14 at 6:29
2
\$\begingroup\$

If you have a digital multi-meter with "Diode Test" feature, you can use it as a connection tester (Here we it call a "Beep-Check" :D), you will simply find out what pin of the A-side connector is connected to the B-side connector. Learn the order of connections because it is a convention to connect pins of these flat-cables in that way.

Next you will have to simply connect MOSI to MOSI, MISO to MISO, SCK to SCK and absolutely the NRST to NRST (as other friends said, it is better to pull-up NRST using a 10K~47K resistor - however the AVR already has this resistor. It is just for precaution).

AND DON'T FORGET THE "GND" PIN! Every two device with electric link must have common GROUND.

I must add and remark something to addition to what my friends, JYelton and Nick said:

Please make sure that your ATmega8 (or whatever IC you are using) is powered from the external adapter (+5V) OR from the programmer. Not BOTH OF THEM!!!

Otherwise, you may damage your computer's USB port, or the adapter (or in some cases even the programmer and the microcontroller)!!

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This should really be stated in a comment, not in an answer. It literally is not an answer but it does contain relevant supplementary information. \$\endgroup\$ – user98663 Sep 2 '16 at 7:58
  • \$\begingroup\$ You're right. Lemme make an edit... (But I thought as the post is from two years ago, and I'm adding something seriously important, it is better as an answer...) \$\endgroup\$ – Ali Nakisaee Sep 2 '16 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.