avr confusion - Page 1
Forum section: electronics / general

author: blackjames
author_rank: Regular Contributor
timestamp: September 17, 2012, 07:12:09 am
content: hi, i just received this:https://www.sparkfun.com/products/9825programmer from sparkfun electronics. i want to program a attiny chip with it. (on arduino) i dont have much expirience installing drivers and stuff. it turns out its quite complicated on windows 7, which happens to be what i use. i'm just getting too confused. can anybody help me?

author: blackjames
author_rank: Regular Contributor
timestamp: September 17, 2012, 08:20:19 am
content: dont worry about attiny chips, just my arduino uno

author: shebu18
author_rank: Frequent Contributor
timestamp: September 17, 2012, 08:42:09 am
content: You wnat to write code to your arduino uno with the programer? why would you want that?

author: blackjames
author_rank: Regular Contributor
timestamp: September 17, 2012, 08:49:07 am
content: just so i know that im ready to program other boards

author: shebu18
author_rank: Frequent Contributor
timestamp: September 17, 2012, 09:07:40 am
content: If you write something on the avr of the uno you will erase the bootloader so you can not use it as an arduino any more. There should be some tutorials about the programmer on sparkfun. You could use the command line and avrdude to write the hex file to the chip.

author: flano
author_rank: Contributor
timestamp: September 17, 2012, 09:46:08 am
content: Assume you have Win7 64 bit.Try these drivers, they use a signed copy of the libusb driver.http://www.adafruit.com/blog/2010/09/10/usbtinyisp-drivers-for-64-bit-windows-7-vista-x64/

author: blackjames
author_rank: Regular Contributor
timestamp: September 17, 2012, 10:36:39 am
content: got it working, almost. on arduino software, what programmer should i select

author: blackjames
author_rank: Regular Contributor
timestamp: September 17, 2012, 10:40:58 am
content: arduino software dosen't know what com port.

author: Tepe
author_rank: Frequent Contributor
timestamp: September 17, 2012, 11:26:31 am
content: Quote from: blackjames on September 17, 2012, 10:40:58 amIt is your job to tell it that

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 17, 2012, 11:35:05 am
content: with arduino uno and arduino software, you dont need any external programmer hardware. just connect the uno to PC using plain usb cable, select appropriate com port (try and error) in ide and done. if using the above hardware, as shebu said you are risking the uno bootloader bye bye. not anything wrong if that is your intention.

author: Trigger
author_rank: Regular Contributor
timestamp: September 19, 2012, 06:55:03 pm
content: There are two main ways an Arduino can be programmed.When you use the Arduino IDE to program a board over USB you're using the capabilities of the Arduino bootloader. The bootloader is a small piece of software that will check if it's getting a signal to be programmed when it boots and if not then it will send the execution pointer to the beginning of the code section. If it gets the signal that it's going to be programmed it will listen and write the incoming program to the code section and when it's finished it will reboot. This is using the chip's self programming ability to make it easier for people without the hardware usually required to program the chip. This is why you only need a serial converter like an FTDI chip to be able to program a chip with the Arduino bootloader on it through the serial interface.The other method is using a hardware programmer to directly write to the memory on the chip. The programmer you bought from Sparkfun is an example of this. The Arduino IDE isn't really set up to use this type of hardware. You'll want to use something likehttp://www.atmel.com/Microsite/atmel_studio6/As others have mentioned if you use the programmer you're going to overwrite the Arduino bootloader. It's not really that much of a problem since you can download it off the chip and save it, or get the image online and reload it later. The advantage is you get the full resources of the chip as the bootloader isn't taking up any space.When you step outside of the Arduino environment you're going to find things become a lot more complicated. The Arduino libraries hide a lot of the underlying complexity of working with the chip. You'll need to have the datasheethttp://www.atmel.com/Images/doc8271.pdfon hand to know how to set up the chip's registers yourself. It's a much steeper learning curve, but it's rewarding as you get the full capabilities of the chip. The Arduino libraries restrict some of the chips to maintain backwards compatibility. You'll need to keep in mind that the way you interact with registers can change depending on the compiler so you'll need to have that documentation on hand too.Oh and if you do program the Uno use the header on the far edge of the board not the one by the USB port. If you flash the one controlling USB by mistake you won't be able to use it until you reflash it with the correct firmware.Edit: I noticed the PocketAVR is for avrdude. You own't be able to use it directly from the Atmel IDE but you can compile from the IDE and then use avrdude separately to push the firmware.

author: blackjames
author_rank: Regular Contributor
timestamp: September 20, 2012, 09:08:58 am
content: whyat is avrdude?

author: Trigger
author_rank: Regular Contributor
timestamp: September 20, 2012, 01:43:46 pm
content: Quote from: blackjames on September 20, 2012, 09:08:58 amYou purchased a PocketAVR programmer without reading the description? It's mentioned a few times and there are links to it. The PocketAVR is built to be used with it.

author: blackjames
author_rank: Regular Contributor
timestamp: September 20, 2012, 09:36:55 pm
content: I know about avrdude, but i wast sure how it works, but i read a tutorial. All good