Archive for category programmer

New masks for the USB ASP

These masks are designed by me for the USB ASP Programmer designed by Tomas Fischl (http://www.fischl.de/usbasp/)

I used series resistors with MOSI MISO SCK and RST lines. They are used for protection of the ATmega8 of the programmer. They can be replaced with short circuits like the original design.In my design, the resistors probably causes some rise time issue, so the programmer will not work unless the slow sck jumper is shorted out. And power is not drawn from the USB port, and taken from the external circuit. Reversing polarity of Vcc and GND will certainly cause the programmer to die. I included a Zener Diode in my design to limit the reverse polarity voltage, but don’t know how effective it would be. I’ll try to make another design with 5 wire-output, that draws power from USB port.



1 Comment

USBASP Programmer for AVR is working on Windows Vista

Finally I could get my USB programmer to work with windows vista. Firstly, I stripped of the breadboard from all previous connections, and reconnected the circuit. This ofcourse proved fatal to two of my microcontrollers, as I accidentally connected +12V to Vcc rail, instead of the input to the 7805 IC. I connected the programmer to PC, and it said unknown device. I knew I connected the D+ and D- wires from USB port wrong. The final bread board looks like this:

So I swapped them and replugged the USB. This time the device was recognised as usbasp, and windows vista asked for driver. I supplied the libusb driver given with the fischel’s package (http://www.fischl.de/usbasp/). Windows said something about device compatibiliy. I chose to ignore, and the device installed successfully.
Now I opened command prompt and typed  avrdude -c usbasp -p t2313
 Command prompt returned  error: could not find USB device “USBasp” with vid=0×16c0 pid=0×5dc


I tried to s
earch the forums. They suggested to use 2007 build of winavr, I tried that (replaced avrdude.exe in the C:\winavr\bin directory with the 2007 version). Some of them also suggested to use an older version of libusb. So I did that too. After spending an hour, I did some thing I should have done a long time ago. I clicked on the orb (start), typed ‘cmd’, so Vista start menu searched cmd.exe. I right clicked on it and selected “Run as Administrator”. Now when I typed

C:\Windows\system32>avrdude -c usbasp -p t2313
found 8 busses
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0×1e910a
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

 

Wow, the device actually worked!! I tried several times and it was working. I started the AVR8-Burn-O-Mat and changed some settings.
Burn O Mat seems to work fine too. Just too bad it doesn’t have the buffer of ponyprog, and the hex display. It is just great otherwist, and has a lot better fusebit editor.



No Comments

Beginner’s Microcontroller Programming-IV: Absolute minimalistic approach to the modified SIProg

Ok, before I startered this project, I tried to construct the USBasp and USBtiny, and was not successful with bread board. I am planning to make a better version of the USBasp in PCB, but at the moment I tried to make a really small  SI Prog. It will be so small that the entire veroboard will fit into a standard serial port connector casing. I just bought one from Patuatuli:

To fit the veroboard into the small casing, you can maximum fit a 6×6 hole veroboard piece into it, by properly polishing the sides, the central piece could be two hole longer. As the header is inserted into the box, the backside of the header blocks the first row. With only five holes, I thought, at first it would be impossible to fit my circuit (http://sajiduc.blogspot.com/2008/04/beginners-microcontroller-programming.html) here.

Then it occured to me, if I used the extra holes in the middle row to connect the densedly connected ground line, and use the ends of resistors to get connection from the MOSI, SCK, and RESET lines, it will be possible to accomodate the circuit in the header box. And so, here it is, I present you the smallest possible (with non-SMT components) SI Prog. It supports most popular microcontrollers like ATmega16, ATmega32, ATmega8, ATtiny2313, but you probably already know that from my third blog. Circuit diagram is available there:

1 Comment

USBasp: The USB based AVR programmer

Update: My Programmer is working now. Read Here.

My laptop does not have serial port. And ponyprog, up until now, have not provided support for any USB programmers. Today, I constructed my first USB programmer on a breadboard. I had a old USB extenstion cable which was out of order as the header was slack due to wear. I cut of that part and soldered breadboard wires.

My first goal was to make a ponyprog compatible programmer that emulates parallel port. I started with: USB2LPT

Afterwards, I realized that the emulation makes programming too slow. Thus I had to move to a dedicated programmer. But I really like a GUI for inputting, especially the fusebits. AVRdude is a command prompt based programmer. A wrong fusebit setting can lock the microcontroller irrepairable by a Serial Programmer.

Then I found AVR8 Burn-O-Mat: GUI for avrdude . The interface is even better than pony prog for fuses. It actually has small comments beside fusebits. AVRdude even supports my simplified SIProg. So I proceeded to make the famous USB ASP (http://www.fischl.de/usbasp/) I forgot to connect the ICP and INT0 at first, and kept getting “Unknown USB device”. I reflashed 4 times. Finally the programmer was operational and the driver was installed successfully.

I’ll give details of my schematics later. Here is a picture of the circuit.

Update: My Programmer is working now. Read Here.

15 Comments

Beginner’s Microcontroller Programming-III: (Further) Simplification of the LancOs’s SI Prog the Serial Port Porgrammer

Ok. I guess the most popular microcontrollers now a days in Bangladesh are ATmega8 and ATmega32. These microcontrollers have inverted reset, that does not work with the second circuit. So I am posting a circuit specially for these sort of noninverted IC. If your AVRs reset pin in datasheet have a bar on the name of it. ( Reset ) (or has a circle outsidethe pin of it), then this programmer is suitable for you. In the circuit diagram I have already shown the pin out of the BC 547 ic.

(Note: My programmer was not working. I tried to debug it and found that the Emitter and Base of the 547 IC was short circuit. So, to check if your BC547 is working properly, take your multimeter in diode mode, and check if  an approximately 0.7 Volt drop occur between base and emitter. This will save your valuable time of debugging. (3 hours in my case. )
The completed circuit is shown in picture. It is programming my ATmega8 microcontroller.

A friend of mine asked me to make him a cable. So I made one for him. I tested it with ATmega32.

To program go to Lancos and download the latest version of Ponyprog from there (http://www.lancos.com/prog.html).

8 Comments

Beginner’s Microcontroller Programming-II: (Further) Simplification of the LancOs’s SI Prog the Serial Port Porgrammer

Thanks to all of you who tried my previous version of SI prog. One of my friends tried to implement it on his vero-board and it did not work. I gave him my previous one to test. Now there is a Curfew going on in Bangladesh so I could not get his one. So I tried to rebuild the previous circuit. It just did not work! I was flummoxed, and spent a whole day on it. Today I took a good look at the LancOs circuit and found out that they uses two separate reset lines, one through the collector of a BJT, and the another directly through a Zener Diode regulator. In my second circuit, I had omitted the sener regulator part, and had just used the BJT. Luckily I kept some extra space in my vero-board this time, and added the extra resistor and zener diode regulator. I was all out of 4.7K resistors and can’t go to the shop right now (because of the curfew), so I used 1.7Ks merely hoping that they would not fry my serial port. I disconnected the previous reset line (through the BJT) and connected the zener regulated version to the bread board, and it works!!! So I think for microcontrollers not having non inverted reset, this simpler circuit would be just fine.

My previous vero-board plan had errors, so I would not dare to make another one this time. My new veroboard is also not optimized, so I am not uploading any pictures. The entire circuit can be fitted inside a DB9 connector I believe. So AVR fans, please try it out. I’ll try to make a version like that when I manage to get some helping hands. (I am terrible when it comes to soldering.)

Please note that you are trying these circuits AT YOUR OWN RISK. Please don’t come back to me crying you have fryed your serial port, mother board, or the microcontroller. I take absolutely no responsibilities for any injuries or equipment damages.

No Comments

Beginner’s Microcontroller Programming: Simplification of the LancOs’s SI Prog

(Note: If you are looking for a beginners tutorial, you may proceed to: http://sajiduc.blogspot.com/2008/10/really-beginners-microcontroller-guide.html)

Most beginners of microcontroller programming need a cheap microcontroller programmer to play around. Most universal programmers are quite expensive, so beginners now try to start with S51 from 8051 series, and AVRs which support In-System-Programming (ISP) capability.

To load program in a microcontroller via ISP, various types of programmers have been constructed. The most popular one is perhaps the STK200 variants, one of which can be found in Peter Fleury’s website.

But these variants have some limitations. The cable length should be less than 70cm, and some people have claimed that this device damages the parallel port after using it several times.

LancOs has made a program called ponyprog to load programs into the microcontroller using various types of programmers. It supports the STK200, aswell as programming of other devices. STK200 cannot program PIC microcontrollers (to the best of my knowledge) LancOs has designed a programmer that can program all the devices supported by pony prog. This device can program AVR, PIC-12, PIC-16 and various other microcontrollers and eeproms. (To see the full list go to: http://www.lancos.com/prog.html) The schematic of the SI-prog can be obtained from Lancos web site. Their schematic is great, that uses PCs serial ports drained power to program microcontrollers. They also have optional jumpers to feed in external power to the circuit. The schematic is like this: (click to open)

If you take a good look at the schematic, you will find that the circuit is quite complicated. It might be good for professionals (I’m not sure if it is for professionals) but I thought that for beginners the circuit should be simplified a bit.

If you take a good look at the circuit, you’ll see that a lot of mumbo-jumbos have been done just to drain power from the serial port. I thought that it was unnecessary. If you are not too fuzzy about power, you can just use a 7805 IC and use an adapter to power your microcontroller on your bread board. If that is done, you can omit all the switching diodes (4148s) and the rare-to-find voltage regulator (LM2936Z-5). (I couldn’t find it in my country, Bangladesh, the shopkeeper demanded that it was just equivalent to 78L05, but the Lancos sheet asks not to use a 78L05)

The total circuit then dramatically reduces to:

(Note the pin numbers here

Note: If you connect pin-4 of parallel port directly with a wire to represent it as MISO, and omit the last track of the veroboard, you can fit the entire circuit inside a serial port connector. But I personally prefer to keep the programmer circuit as close to my bread board as possible.

I took some photographs:



Once you have constructed it on a veroboard you can use Peter Fleury’s circuit to test. Just connect the appropriate MOSI, MISO, SCK, GND, RESET lines, and write the program using pony prog.

Note: Questions and Comments are welcome: robin boss (at_the_rate) gmail (dot) com (Exclude the spaces and type properly if you are a human, and not a webcrawler….)

(If you are an absolute new bee, then you probably need to visit this page first to see how the things look like: http://ahsanuc.blogspot.com/)

Update: I suggest you take a look at the further stripped down version here: http://sajiduc.blogspot.com/2008/04/beginners-microcontroller-programming.html)

7 Comments