Home › Evil Mad Scientist Forums › Other kit and product support › Program ATTiny 4313 w/ISP Shield?
- This topic has 13 replies, 4 voices, and was last updated 11 years, 4 months ago by Windell Oskay.
-
AuthorPosts
-
November 7, 2012 at 9:14 pm #20128Tempest2k8Participant
Is it possible to program the 4313 & 2313 with the ISP Shield?
November 7, 2012 at 10:50 pm #20983Windell OskayKeymasterYes, of course. The ISP Shield can be used to program any AVR microcontroller that has an ISP interface.
November 8, 2012 at 9:57 am #20984Tempest2k8ParticipantWhat would the process be?
1. Load the Arduino ISP sketch.
2. Place ATTiny 4313 in shield.
3. Choose the ATTiny 4313 as the target board.
4. UploadWhat about loading a .hex file to the Tiny? I’m guessing AVRDude command line is the way to go.
Thanks.
November 8, 2012 at 1:47 pm #20985Windell OskayKeymasterStep 1 is correct.
The ZIF socket is for ATmega48/88/168/328 and ATtiny25/48/85 (with one wire added). For other AVRs, you need an external target board.The correct process to use for programming depends on what environment you’re using. We use AVR-GCC/Avrdude straight from the command line. If you’re using a hacked version of Arduino instead (as I’m guessing you’re referring to), then you need to follow the appropriate directions for that environment. Standard versions of Arduino do not support the ‘2313/’4313.November 8, 2012 at 10:18 pm #20986maztf5c1ParticipantYes, of course……
April 3, 2013 at 1:06 pm #20987craiglindleyParticipantOK so I’m completely clear. I cannot use the Zif socket on the ISP Shield to program an AtTiny4313?
April 3, 2013 at 1:08 pm #20988Windell OskayKeymasterNo, not without extensive rewiring.
April 3, 2013 at 1:18 pm #20989craiglindleyParticipantI wish I had known this before I purchased the programmer as the AtTiny4313 is what I bought the programmer for. So can someone tell me exactly how to connect up this programmer to the AtTiny4313 externally on a breadboard for example.
April 3, 2013 at 1:36 pm #20990Windell OskayKeymasterThis article shows you how to connect up an ATtiny2313; the ‘4313 works identically:http://www.evilmadscientist.com/2007/using-avr-microcontrollers-minimalist-target-boards/
April 3, 2013 at 10:08 pm #20991craiglindleyParticipantThanks
April 13, 2013 at 10:09 pm #20992craiglindleyParticipantOK. I bought and built the ispShield and the 2313 target board. On the target board I installed a 6 pin ISP header with the leads facing upward and a 20 pin ZIF socket. I put positioned the jumpers to disable autoreset and to provide target power.
I then connected the boards with your 6 pin cable. On the ispShield I oriented the ribbon cable connector with the red stripe connected to the triangle on the board. However on the target board the red stripe is opposite the triangle on the board. Is that correct or should the ISP header be installed on the bottom of the target board?
I put the attiny4313 into the ZIF socket on the target board.
I brought up the Arduino IDE and selected an Arduino Uno as the board then loaded and uploaded the ArduinoISP sketch. The pulse LED then cycles.
I then ran avrdude with the following command line on my Mac:
avrdude -c arduino -p t4313 -P /dev/tty.usbmodem1411 -F -U flash:w:TinyMatrix.hex:iI have to use the -F switch because the device signatures don’t match. The signature returned is for the atmega 328 in the UNO I think.
Here is the result:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATtiny4313 is 1E 92 0D
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file “TinyMatrix.hex”
avrdude: writing flash (2016 bytes):Writing | ################################################## | 100% 0.52s
avrdude: 2016 bytes of flash written
avrdude: verifying flash memory against TinyMatrix.hex:
avrdude: load data flash data from input file TinyMatrix.hex:
avrdude: input file TinyMatrix.hex contains 2016 bytes
avrdude: reading on-chip flash data:Reading | ################################################## | 100% 0.39s
avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0000
0x4c != 0x00
avrdude: verification error; content mismatchavrdude: safemode: Fuses OK
avrdude done. Thank you.
It looks like the code is not being programmed.
Any idea what is going on?
One other thing, when I load the sketch the pulse LED flashes until I try to program the device and then it goes off and stays off. The Prog LED never flashes.
April 14, 2013 at 1:15 am #20993Windell OskayKeymasterThe ‘2313 target board and the ISP shield both have the same orientation for the ISP header. In both cases the headers need to be installed on the tops of the boards, and you need to orient the cable the same way at both ends. This means that the red stripe side of the cable has to go towards the arrow-marked pin (pin 1) on both ends.
So, it sounds like one end of your cable is backwards.You should never use the “-F” option to override signature checking– *unless* you actually intend to program a chip as though it was one of a different type– a very rare but possible circumstance. Since you *are* programming a ‘t4313 as a ‘t4313, you should definitely NOT use the “-F” option. If you use “-F”, it will turn of important error checking that you actually should be using and paying attention to.Also, normally we use ‘avrisp’ not ‘arduino’ as the programmer type when doing this, and the USB port should be declared as “-P usb” not “-P /dev/xxxxx”.April 14, 2013 at 10:35 am #20994craiglindleyParticipantThanks Windell. The problem was not the cable it was using arduino as the programmer. As soon as I changed it to avrisp everything worked.
Excellent!
April 14, 2013 at 2:14 pm #20995Windell OskayKeymasterGreat!
-
AuthorPosts
- You must be logged in to reply to this topic.