MetkuMods

How to get started with microcontrollers - Part 1

Basics with Atmel microcontrollers
 
Author: Aki Korhonen
Published: 26.01.2009
In English In English
Suomeksi Suomeksi

In the following pages on this article you'll find some example codes that you can use to test your circuit. Let's copy&paste the first example code into the middle window.

 

How to get started with microcontrollers - Part 1
AVR Studio, code pasted

Now navigate into the Project menu (up left) and from there goto "Configuration Options" and you'll see the following screen. Select the right device for the project, attiny45 in this case (or what you are using). Fill in the frequency in Hz, which is 1000000 Hz (1 MHz) for the attiny45 with factory settings. Click OK.

 

How to get started with microcontrollers - Part 1
AVR Studio, project settings

Remember to save your project now. Navigate to Build menu and click Build (or hit F7 on your keyboard) and if all goes well, no errors should be there and you'll see a text like this in the message window.

 

How to get started with microcontrollers - Part 1
AVR Studio, project compiled

As you can see, the led flashing program doesn't take much space from the chip. After this is done you are ready to continue to the programming of the chip.


Getting the code to the chip - Programming

As we are using the parallel port programming cable, we'll need to use an external programming software to get the code to the chip. Now start the PonyProg program.

 

How to get started with microcontrollers - Part 1
PonyProg

Select File -> Open device file (or click the yellow folder icon). Navigate to your project directory and there you'll find a directory named "default". From there choose the "project_name.hex", in this case "test_project.hex". This file contains the compiled program in a form the chip understands.

 

How to get started with microcontrollers - Part 1
PonyProg, hex file loaded

You can see two drop down boxes, find "AVR micro" to the first one and "AVR Auto" or "ATtiny45" to the second one. Now navigate to Setup -> Interface Setup... and choose "Parallel" and "Avr ISP I/O" from the dropdown menu below it. Click OK. Go to Setup -> Calibration and click Yes. After this connect your programming cable to your computer and the chip if you haven't already done this and give some power to the chip too.

 

How to get started with microcontrollers - Part 1
PonyProg, hex file loaded

UPDATE 2009-06-15: Fresh install of PonyProg comes without anything assigned to the yellow arrow -button so head to the "Command" -menu and from there you'll find "Program Options". Select the following options with the checkboxes (as seen on the photo below): Reload files (reloads files automatically when pressed, optional), Erase, Write Program memory (FLASH) and Write Data memory (EEPROM). Click OK.


Click on the yellow arrow on the second line of icons, this will start the programming cycle. Let the program do its work and if you've done everything right you should get the following message that the programming has succeeded and the led should be flashing happily on the board. If there are some errors, check and double check all your connections!

 

How to get started with microcontrollers - Part 1
PonyProg, program succesful




Pages:  1 2 3 4 5 6 


 
  Content in english!
  Sisältö suomeksi!

 Google




Add to Technorati Favorites
add
add
add
add
add

 .:Back to top Bandwidth by Mpoli

Copyright © Metku.net, All Rights Reserved.
All content and graphics in MetkuMods are sole property of Jani Pönkkö and may not be reproduced or copied in any manner without written permission from him.
All brand names, trademarks and copyrights are the property of their respective owners.Privacy Policy