Hello AVR world!

Years ago I have been in electronics world, while never seriously touched digital techniques. I dropped electronics in favour of computer science and become sofware specialist. Now getting back to electronics I see the power in programming integrated circuit to control fixed electronics assembly around. I am really attracted by microcontrollers.

I was quite ignorant before I started digging into μC world. Now, wherever I look, I see these tiny things inside – in microwave oven, in washing mashine, even in my laptop battery which is controlled by microcontroller too.

I have chosen Atmel AVR family and bought USBasp-like programmer. Why AVR and not Microchip PIC? Because the latter is popular in US and former in Europe. It is easier to have local help. Anyway, PICs are on my radar too, at least as a consumer of many interesting ready to use binaries; and this is why I have built brenner8p programmer on my own, but it is different story.

Lack of knowledge pushed me to more controlled way – I got starter kit instead of using bread board with cloud of wires. It was a strategy of minimizing potential errors in multi-step path to first “hello world” result. I was not only short on experience but also on theoretical knowlede. I did not want to spend much time reading books. Modern tactics is more like: google and read, do a small practical step and repeat.

One of cheap and locally popular AVR kits is ZL11AVR with ATtiny2313. I bought factory PCB and soldered all necessary elements. I found sample “blinking led” C code and using WinAVR compiled and programmed 2313 flawlessly, however LED display did not blink. With some basic knowledge of I/O registers I could fix the code to map it to schematic properly. And I have seen the light (of diodes). It proved hardware and software correctness. I was eager to run LCD.

First day with AVR

LCD part was not that easy. I found a library for HD44780-based LCD but it did not  work at all. I spent two hours accelerating with the kit electric schema, foreign C code and google. After digging into the library source and schema I realized that software reads data from LCD while kit had R/W line grounded. Moreover backlit was not connected. I was disappointed and decided to make a bypass wiring things a bit different (see the picture above).

ZL11AVR kit is not that flexible as I thought

I unsoldered goldpin connected R/W LCD pin and wired it to free pin of port B and then mapped in the code appropriatelly. Enabling backlit was simpler since these pins were not connected on PCB, so I wired them with limiting resistor (to drain too much from USB). Now I understand why this kit is sold with book about microcontrollers, it satisfies it needs and (probably) blocks inventors from using it too much – other kits would not be sell if you could have anything you need. Honestly speaking I would buy this book to learn, unfortunatelly it is for BASCOM programmer and I do not want to invest in BASIC language I do not like.

With this tinny success I am quite encouraged and I have already started more serious education to understand all periferials. I also need to remove dust from my C language skills, not used for many years. I am waiting for vacation time to jump into that :]

This entry was posted in Electronics. Bookmark the permalink.

Leave a Reply

Your email address will not be published.