Dick Cappels' project pages

HOME

(YOU CAN USE YOUR "BACK" BUTTON TO RETURN TO THE PREVIOUS PAGE)

If I understand your request, you want to know how program and operate the ATtiny12 run on the STK-500 using a 4 MHz crystal. It took me over an hour of reading and trying things to figure out how to do this. There are some aspects of the STK-500 instructions that are not very clear.

 

What are probably the two most important thing I learned and are not spelled out clearly in the STK-500 instructions is that you have to use two different jumper settings for the OSCSEL jumper pins for programming and running from the crystal, and that to use a crystal in the socket on the STK-500, you have to select the fuse option: CKSEL-0000 EXTERNAL CLOCK.

 

1. Switch the power on the STK-500 OFF.

 

1A. make sure there are no micro controllers in any of the sockets on the STK-500.

 

2. Put the ATtiny12 into socket STK3400D1.

 

3. Install jumpers exactly as shown in the STK-500 documentation:

 

3A. Jumper OSCSEL 1 to OSCSEL 2 with a jumper plug.

 

3B. Jumper XTAL1 with a jumper plug.

 

3C. Jumper RESET with a jumper plug.

 

3D. Jumper VTARGET with a jumper plug.

 

3E. With a jumper cable, connect PORTE/AUX "RST" pin to PORTB "PB5" pin.

 

3F. With a jumper cable, connect PORTE/AUX "XT1" pin to PORTB "PB3" pin.

 

3G. With a jumper cable, connect SPROG 1 pin 1 to PROGRAM DATA pin 2.

(This step corrected after feedback)

 

3H. With a jumper cable, make two connections at one time between SPROG and PROGRAM DATA so that

SPROG pin 3 connects to PROGRAM DATA pin 3, and SPROG pin 4 connects to PRGORAM DATA pin 1.

On my board I have a cable with yellow and green wires. it is connected like this:

SPROG PROGDATA

3 GREEN 3

4 YELLOW 1

 

The directions in the STK-500 manual are confusion, but they are correct- look very closely at the pictures.

 

4. Make sure that no other jumpers or cables are on the board.

 

5. Put the ATtion12 into the socket marked SCKT3400D1, observing the location of pin 1.

 

6. Plug in the serial cable and turn on the power to the board.

 

7. Start up AVR Studio.

 

8. Open the STK-500 program from the "TOOL" menu (at lest its called "Tools" in my version of AVR Studio).

 

9. It show open to the "PROGRAM" pane. If not, click the PROGRAM tab.

 

9A. Select "ATtiny12" in the device selector.

 

9B. Select "Parallel/High Voltage Serial".

 

9C. Check "Erase device before programming".

 

9D. Check "Verify device after programming".

 

10. Open the "BOARD" pane by clicking on the "BOARD" tab.

 

10A. Use the slider to set Vtarget = 5.0 volts.

 

10B. Click "Write Voltage" to set voltage.

 

10C. Click "Read Voltage". The voltage should read close to 5.0 volts.

If it does not read back as close to 5.0 volts, there is a problem with the STK-500 or the software.

 

11. Open the "LOCK BITS" pane by clicking on the "LOCK BITS" tab.

 

11A. Select "Mode 1: No memory lock features enabled", so that there is a check in the check box next to "Mode 1..."

 

11B. Click on "PROGRAM" button.

 

11C. Click on "READ" button.

after clicking on "READ" button, the check box next to "Mode 1..." should remain checked. If not, there is a problem with the software, the STK-500, the jumper setup, the device selection in the "PROGRAM" pane, or the ATtiny12 itself.

 

12. Open the "ADVANCED" pane by clicking on the "ADVANCED" tab.

 

12A. Click on "Read Signature" button.

The signature should read 0x1D 0x9E 0x05 or something similar. More importantly, you should see the message "Signature matches selected device". If the signature does not match the selected device or reading the signature fails, check all the connections and the setup (same troubleshooting list as step 11).

 

13. Open "FUSES" pane by clicking on the "FUSES" tab.

 

13A. Select 'CLKSEL=0000 EXTERNAL CLOCK".

 

13B. Click on "PROGRAM" button.

 

13C. Click on "READ" button.

If the clock selection changes when you click on read, then this fuse option was not effectively programmed. Troubleshoot everything up to here.

 

14. Select the hex file you want and program the device.

 

IF YOU WANT TO RUN WITH A 4 MHZ CRYSTAL: Put the crystal in the socket marked "CRYSTAL" and change the OSCSEL jumper to jumper pins 2 to 3. REMEMBER THAT YOU WILL HAVE TO CHANGE THE OSCSEL JUMPER BACK TO PINS 1 AND 2 TO PROGRAM THE CHIP AGAIN OR CHANGE ANY FUSE SETTINGS. ALSO REMEMMBER THAT YOU WILL HAVE TO CHANGE THE FUSE SELECTION FOR THE CLOCK TO ONE OF THE EXTERNAL CRYSTAL OPTIONS BEFORE YOU CAN USE THE CHIP WITH A CRYSTAL CONNECTED DIRECTLY TO THE ATtiny12.

 

 

 

 

 HOME

Use of information presented on this page is for personal, nonprofit educational
and noncommercial use only. This material (including object files) is copyrighted
by Richard Cappels and may not be republished or used directly for commercial
purposes without explicit permission For commercial license,
click HERE.

Please see the liability disclaimer on the HOME page.

 Contents ©2002 Richard Cappels All Rights Reserved. http://projects.cappels.org/