After finally switching my laptop and computer over to ubuntu permanently, i found no software that would support my PIC microcontroller programmer and after a few vauge and useless attempts to reverse engineer it (i'm really not that good at electronics, i wake up in the night wondering why i'm not doing a degree to become a tree surgeon), i finally thought "sod it" and splashed out a bit of my student loan on an AVR Dragon after seeing there was an open source c compiler for AVR microcontrollers and supporting programming software, also there's some absolutely wicked projects people have done with them.
It then promptly got discarded in my box of bits for a couple of months (i like to think it was laying dormant in its lair......its a dragon, get the pun?)
so anyways, here's how i got it working, this will probably work with most flavours of ubuntu that use synaptic (you can probably do it on any version of linux if you compile it from source and whatnot, i like synaptic because its easy) and its more a collection of information from various sources, but should hopefully get you up and running!
I realise there are other instructables for getting started with avr microcontrollers, but i couldn't find anything that applied to my situation, so i hope this is at least a bit of help to somebody.
Remove these ads by
Signing UpStep 1: Getting the software
there are 2 main pieces of software i'll be using
gcc-avr
this is the gnu c cross compiler for avr microcntrollers. A cross compiler is needed because we're compiling code for a microcontroller on an architecture (personal computer) that cannot run the compiled code.
This will take the code you write in c and convert it into a "machine readable" format (loads of 1's and 0's) which can then be put onto a microcontroller.
avrdude
This is what puts the code onto the microcontroller, it connects with the avr dragon and transfers the Hex file (the compiled code) onto the microcontroller.
to install these pieces of software go:
system -> administration -> Synaptic Package Manager
search for gcc-avr and then avrdude and mark them both for installation, then install! simple.
if you want to use the command line you could try
sudo apt-get install gcc-avr
sudo apt-get install avrdude











































Visit Our Store »
Go Pro Today »




anyway JTAG is like an emulator for PIC but it is in the chip. you connect the corresponding ports on the chip and then enable the JTAG in the programming and then using AVR studio you can view the states of the file, working and EEPROM registers as it advances through the program. this would help with debugging.
and also, dont you find Assembly code easier to write in, maybe its because i learnt it in assembly code.
if you want to learn more about AVR or PIC programming buy these books, they are fantastic, if you are interested you can learn it in a week! here are the links to amazon AVR and for PIC
Note: Written by same author. PIC book written when he was 16 and AVR book was written while at University at the age of 19
Is that a troll?
You do realize this community seems strongly open source, and you just don't get that in a Windows community. Windows doesn't even do anything until you spend a whole lot more buying shareware.
Besides, not all of us are so rich that we like buying new scanners and printers every time a new version of the OS comes out (can't tell you how many times I had to do that before I said enough was enough, no more Windows,).
http://img407.imageshack.us/img407/1168/stepbench.jpg
The gray sub D cable is plugged into one in the picture. Then signals from my home brewed buffer are running one of the worst loads out there, an inductive stepper motor controller running at a couple of amps.
So as they say, it works here!
http://www.youtube.com/watch?v=cgbeyNNBZ68
This was the error message -- though the device signature would come back differently each time:
avrdude: Device signature = 0x3f00ff
avrdude: Expected signature for ATMEGA168 is 1E 94 06
Double check chip, or use -F to override this check.
NB: the wrong signature would always be runs of 1s and 0s, never completely random.
-B 10 fixed it straightaway.
Thanks again.
}{itch, if you still have PICs lying around like me, check out http://home.pacbell.net/theposts/picmicro/. There's programmer software there for the PICKit2, which is the cheapest "official" USB PIC programmer available from Microchip. Unfortunately, development has stalled, and the latest firmware for the programmer is only supported by the latest alpha of the software. It might be worth a try,though.