What can you do with a microcontroller
Microcontrollers - How to start
Lately I've been asked more and more how I started programming microcontrollers (µC for short). What's the easiest way to start? What do I need? Is it expensive? I would like to explain that a little here and maybe explain a few basic terms.
Atmel AVR microcontroller
You can write either very little or an insane amount about these 8-bit microcontrollers. They're small, inexpensive, and can do a lot of different jobs. They are available with 8, 20, 28, 40 and even more connections. Depending on the area of activity, a small or a larger AVR-µC is used. As the number of pins increases, so does the price. An ATmega8 has 28 pins and you can buy it for less than 2 euros. An ATmega16 has 40 pins and is available for less than 3 euros. The low price and the simple programmability are some of the reasons why the AVR microcontrollers are also so interesting for hobby electronics.
AVR - microcontroller textbook
To start with, I had a good book! And that AVR - microcontroller textbook by Roland Walter.
Information about this book can be found at this address: http://www.rowalt.de/mc/avr/avrbuch/index.htm
Using the fine and very affordable 8-bit RISC ATmega8 controller from Atmel, Roland explains everything you need to know to get started. The nice thing about it is that Roland helps people to help themselves. Not only does he make some assertion, but also mostly explains where this information comes from and why he does something exactly the same way and not differently.
In order to be able to try out the examples in practice - and this is really important with this subject - he has developed an experiment board whose components and circuit board can be ordered from Segor electronic. This experimental board is really well thought out. You only notice that when you read the book. I really recommend everyone to order this experiment board and try out the examples from the book with it and do their own experiments with it.
In order to be able to transfer a finished program from the computer to the microcontroller, you need a programmer. This is a device or cable with a few components on it that connects the µC to the computer. He explains how to use a few resistors and a couple of diodes to create a connector with which the µC can be connected to the parallel port of the computer. Unfortunately, there are always problems. Of course he points this out in the book and I have to say that I had these problems myself. In short: you can no longer access the parallel port directly with a program as it was once with Windows 95. Windows now prevents direct access and this can only be overridden by installing a driver. Unfortunately there are different drivers for it and these are hardly maintained. I tried the parallel port programmer with two computers. It works on my older computer and doesn't work on my new computer. : - |
Addendum: As an alternative to parallel ports with low voltage, I have now found a STK200-compatible programmer.
I recommend the mySmartUSB programmer because I haven't had any problems with it and it is so versatile. You can use it to program the most important AVR microcontrollers and use it as an I²C or RS232 converter. This programmer can be used directly from Bascom. In order for Bascom to use this programmer, you only have to select the "AVR ISP Programmer" in the Bascom settings and set the associated COM port. It's not particularly fast - but it works. And that is the most important thing for a beginner. If everything works, you can address the programmer via an external program (e.g. avrdude). Then an ATmega8 is programmed in two to three seconds.
Later I bought the AVR-Dragon-Programmer - as a supplement to the mySmartUSB. But the mySmartUSB is completely sufficient for the beginning.
Further information can be found in the chapter Small Bascom AVR Course - Programmer.
Bascom-AVR is a program that can be used to write programs for AVR microcontrollers. The programs are written in BASIC and converted (compiled) into machine language by Bascom. It offers ready-made routines to establish a connection to a computer or other microcontrollers e.g. via UART (e.g. RS-232). Furthermore, high-level routines for analog-digital conversion, for debouncing connected buttons, for I²C, for SPI and for reading out key fields (up to 4x4) are on board. It can be used to display data on LCDs. And small programs can even be tested before they are transferred to the µC.
Bascom isn't free. But with the demo version you can write programs up to a size of 4 kB. And that's not as little as one might think. An ATmega8 has an 8 kB flash memory. And when the time comes, and you create programs that are larger than 4 kB, then you have already learned so much that the 79 euros for Bascom are certainly not wasted money.
The "ATMEL Evaluation Board Version 2.0" from Pollin seems to be a very useful part despite the low price. Together with the "strip / dot matrix board adapter", you can extend your experiments to other ATmega and ATtiny controllers and connect them to breadboard circuits. With the additional ATMEL add-on board from Pollin you are already quite well equipped. :-)
Changes I made to the evaluation board and the adapter board:
For simple test setups, I bought a breadboard. Such a breadboard is a wonderful thing and can be obtained (cheaper) from Conrad or Reichelt.
To make it really fun, you need an LCD. You can get these at Pollin (search result "lcd display") for a relatively low price.
In the meantime there is also the small Bascom AVR course, which I can warmly recommend for getting started with microcontroller programming :-). Yes, self-praise - I know. : D
GP software technology
For more than 20 years I have been active in the fields of information technology, IT training and programming. And now you can also find me as a self-employed Software engineer and IT consultant book.
I like things to be uncomplicated. Just write me an email. :-)
to the contact page
- What are the good books for EJB
- Investing in crypto currency today is a good move
- What are healthier alternatives to sugar
- What do you mean by legitimate anger
- Can you help me with diabetes
- It is important to understand the application in software development
- What are guided media and unmanaged media
- All enzymes are protein
- Did Queen Esther really exist?
- What do you think of Allen Chandigarh
- Why are Canadian collectibles so cheap
- What does subject in math mean
- How poisonous are scorpion spiders
- When will Pakistan surrender itself to India?
- You can grow your own cocoa plant
- How can I find my identity
- How are banks regulated
- How can I legally withhold the rent
- How many children did Michael Jackson have
- Are the gods all different
- What are some useful uses of water
- Why do people believe in things that are superstitious?
- Who was H Goebbels
- Is creating artificial intelligence ethical?
- What are narcissistic cues
- You can grow your own cocoa plant
- What causes moles on the face
- Can I use Delhi bike in Pune
- What are the three macroeconomic goals of governments
- If 28x 45 39 what is x
- How big can a monster truck get
- What are after tax deduction