In this book the author presents all essential aspects of microcontroller programming, without overloading the reader with unnecessary or quasi-relevant bits of information. Having read the book, you should be able to understand as well as program, 8-bit microcontrollers.
The introduction to microcontroller programming is worked out using microcontrollers from the PIC series. Not exactly state-of-the-art with just 8 bits, the PIC micro has the advantage of being easy to comprehend. It is offered in a DIP enclosure, widely available and not overly complex. The entire datasheet of the PIC micro is shorter by decades than the description of the architecture outlining the processor section of an advanced microcontroller. Simplicity has its advantages here. Having mastered the fundamental operation of a microcontroller, you can easily enter into the realms of advanced softcores later.
Having placed assembly code as the executive programming language in the foreground in the first part of the book, the author reaches a deeper level with ‘C’ in the second part. Cheerfully alongside the official subject matter, the book presents tips & tricks, interesting measurement technology, practical aspects of microcontroller programming, as well as hands-on options for easier working, debugging and faultfinding.
Learn to interface and program hardware devices in a wide range of useful applications, using ARM7 microcontrollers and the C programming language. Examples covered in full detail include a simple LED to a multi-megabyte SD card running the FAT file system.
Features of this book
Build prototype circuits on breadboard or Veroboard and interface to ARM microcontrollers.
A 32-bit ARM7 microcontroller is used in interfacing and software examples.
Interfacing principles apply to other ARM microcontrollers and other non-ARM microcontrollers as well.
Example programs are written in the C programming language.
Use only free or open source software.
Download and install all programming tools from the Internet.
Template project files are provided for easy project creation.
Hardware
Interface to LEDs, transistors, optocouplers, relays, solenoids, switches, keypads, LCD displays, seven segment displays, DC motors, stepper motors, external analogue signals using the ADC, RS232, RS-485, TWI, USB, SPI and SD memory cards.
Software
Once hardware has been interfaced to a microcontroller, software must be written to control the hardware. You will learn how to write programs to operate externally interfaced hardware devices, use timers and interrupts. Also learn how to port FAT file system code for use with an SD memory card, program the PWM to produce an audio sine wave, program the PWM to speed control a DC motor and more.
A chapter on more advanced ARM microcontrollers is included with an overview of some of the newest ARM microcontrollers and their features.
Mit dem Elektor Arduino Nano Trainingsboard (MCCAB) eigene Projekte realisieren
Der Mikrocontroller ist das wohl faszinierendste Teilgebiet der Elektronik, denn aufgrund der Vielzahl von Funktionen, die er auf seinem Chip vereinigt, ist er für den Entwickler ein universelles Multi-Tool zur Realisierung seiner Projekte. Praktisch jedes Gerät des täglichen Gebrauchs wird heute von einem Mikrocontroller gesteuert. Für einen elektronischen Laien blieb es aufgrund der Komplexität bisher allerdings ein Wunschtraum, eigene Ideen mit einem Mikrocontroller zu realisieren. Das Arduino-Konzept hat den Einsatz von Mikrocontrollern weitgehend vereinfacht, sodass jetzt auch Laien eigene Elektronik-Ideen mit einem Mikrocontroller verwirklichen können.
Buch & Hardware im Bundle: 'Learning by Doing'
Dieses im Bundle mitgelieferte Buch (im großen A4-Format) zeigt, wie man auch ohne große Erfahrung in Elektronik und Programmiersprachen eigene Projekte mit einem Mikrocontroller realisieren kann. Es ist ein Mikrocontroller-Praxiskurs für Einsteiger, denn nach einem Überblick über die Interna des Mikrocontrollers und einer Einführung in die Programmiersprache C liegt der Schwerpunkt des Kurses auf den praktischen Übungen. Der Leser eignet sich die erforderlichen Kenntnisse durch 'Learning by Doing' an: in dem umfangreichen Praxisteil mit 12 Projekten und 46 Übungen wird das im vorderen Teil des Buches Gelernte mit vielen Beispielen unterlegt. Die Übungen sind dabei so aufgebaut, dass der Bearbeiter eine Aufgabenstellung erhält, die er mit seinem im Theorieteil des Buches aufgebauten Wissen löst. Für jede Übung gibt es anschließend eine ausführlich erklärte und kommentierte Musterlösung, die dem Bearbeiter bei Problemen weiterhilft und die er mit seiner eigenen Lösung vergleichen kann.
Arduino IDE
In der Arduino IDE, einer Software-Entwicklungsumgebung, die kostenlos auf den eigenen PC heruntergeladen werden kann und die das gesamte Softwarepaket enthält, das für ein eigenes Mikrocontroller-Projekt benötigt wird, schreibt der Bearbeiter mit dem Editor der IDE seine Programme („Apps“) in der Programmiersprache C. Der in die Arduino IDE integrierte Compiler übersetzt sie in die Bits und Bytes, die der Mikrocontroller versteht und die dann über ein USB-Kabel in den Speicher des Mikrocontrollers auf dem Elektor Arduino Nano Trainingsboard (MCCAB) geladen werden.
Externe Sensoren, Motoren oder Baugruppen abfragen oder steuern
Das Elektor Arduino Nano Trainingsboard (MCCAB) enthält neben einem Mikrocontrollermodul Arduino Nano alle für die Übungen benötigten Bauteile wie Leuchtdioden, Schalter, Taster, akustische Signalgeber usw. Auch externe Sensoren, Motoren oder Baugruppen können mit diesem Mikrocontroller-Übungssystem abgefragt oder gesteuert werden.
Technische Daten (Arduino Nano Trainingsboard MCCAB)
Stromversorgung
Über die USB-Verbindung des zur Erstellung der Programme sowieso angeschlossenen PCs oder ein externes Netzteil (nicht im Lieferumfang enthalten)
Betriebsspannung
+5 Vcc
Eingangsspannung
Alle Eingänge
0 V bis +5 V
VX1 und VX2
+8 V bis +12 V (nur bei Verwendung eines externen Netzteils)
Mikrocontrollermodul
Arduino Nano
Hardwareperipherie
LCD
2x16 Zeichen
Potenziometer P1 & P2
JP3: Auswahl der Betriebsspannung von P1 & P2
Verteiler
SV4: Verteiler für die BetriebsspannungenSV5, SV6: Verteiler für die Ein-/Ausgänge des Mikrocontrollers
Schalter und Taster
RESET-Taster auf dem Arduino Nano-Modul6x Tastschalter K1 … K66x Schiebeschalter S1 … S6JP2: Verbindung der Schalter mit den Eingängen des Mikrocontrollers
Summer
Piezo-Summer Buzzer1 mit Steckbrücke auf JP6
Leuchtanzeigen
LED L auf dem Arduino Nano-Modul, verbunden mit GPIO D1311x LED: Zustandsanzeige für die Ein-/AusgängeJP6: Verbindung der LEDs LD10 … LD20 mit den GPIOs D2 … D12
Serielle SchnittstellenSPI & I²C
JP4: Auswahl des Signals an Pin X der SPI-Steckerleiste SV12SV9 bis SV12: SPI-Interface (3,3 V/5 V) bzw. I²C-Interface
Schaltausgang für externe Geräte
SV1, SV7: Schaltausgang (maximal +24 V/160 mA, extern zugeführt)SV2: 2x13 Pins zum Anschluss externer Module
3x3 LED-Matrix (9 rote LEDs)
SV3: Spalten der 3x3 LED-Matrix (Ausgänge D6 … D8)JP1: Verbindung der Reihen mit den GPIOs D3 … D5
Software
Library MCCABLib
Steuerung der Hardware-Komponenten (Schalter, Taster, Leuchtdioden, 3x3 LED-Matrix, Summer) auf dem MCCAB Trainingsboard
Betriebstemperatur
bis +40 °C
Abmessungen
100 x 100 x 20 mm
Technische Daten (Arduino Nano)
Mikrocontroller
ATmega328P
Architektur
AVR
Betriebsspannung
5 V
Flashspeicher
32 KB, davon 2 KB vom Bootloader belegt
SRAM
2 KB
Taktfrequenz
16 MHz
Analoge IN-Pins
8
EEPROM
1 KB
DC-Strom pro I/O-Pin
40 mA an einem I/O-Pin, insgesamt maximal 200 mA an allen Pins gemeinsam
Eingangsspannung
7-12 V
Digitale I/O-Pins
22 (6 davon sind PWM-fähig)
PWM-Ausgänge
6
Stromverbrauch
19 mA
Abmessungen
18 x 45 mm
Gewicht
7 g
Lieferumfang
Elektor Arduino Nano MCCAB Trainingsboard
Arduino Nano
Buch: Mikrocontroller-Praxiskurs für Arduino-Einsteiger
Architecture, Programming and Applications
The MSP430 is a popular family of microcontrollers from Texas Instruments. In this book we will work with the smallest type, which is the powerful MSP430G2553. We will look at the capabilities of this microcontroller in detail, as it is well-suited for self-made projects because it is available in a P-DIP20 package.
We will take a closer look at the microcontroller and then build, step by step, some interesting applications, including a 'Hello World' blinking LED and a nice clock application, which can calculate the day of the week based on the date.
You also will learn how to create code for the MSP microcontroller in assembler. In addition to that, we will work with the MSP-Arduino IDE, which makes it quite easy to create fast applications without special in-depth knowledge of the microcontrollers.
All the code used in the book is available for download from the Elektor website.
Program, build, and master over 50 projects with MicroPython and the RP2040 microprocessor The Raspberry Pi Pico is a high-performance microcontroller module designed especially for physical computing. Microcontrollers differ from single-board computers, like the Raspberry Pi 4, in not having an operating system. The Raspberry Pi Pico can be programmed to run a single task very efficiently within real-time control and monitoring applications requiring speed. The ‘Pico’ as we call it, is based on the fast, efficient, and low-cost dual-core ARM Cortex-M0+ RP2040 microcontroller chip running at up to 133 MHz and sporting 264 KB of SRAM, and 2 MB of Flash memory. Besides its large memory, the Pico has even more attractive features including a vast number of GPIO pins, and popular interface modules like ADC, SPI, I²C, UART, and PWM. To cap it all, the chip offers fast and accurate timing modules, a hardware debug interface, and an internal temperature sensor. The Raspberry Pi Pico is easily programmed using popular high-level languages such as MicroPython and or C/C++. This book is an introduction to using the Raspberry Pi Pico microcontroller in conjunction with the MicroPython programming language. The Thonny development environment (IDE) is used in all the projects described. There are over 50 working and tested projects in the book, covering the following topics: Installing the MicroPython on Raspberry Pi Pico using a Raspberry Pi or a PC Timer interrupts and external interrupts Analogue-to-digital converter (ADC) projects Using the internal temperature sensor and external temperature sensor chips Datalogging projects PWM, UART, I²C, and SPI projects Using Wi-Fi and apps to communicate with smartphones Using Bluetooth and apps to communicate with smartphones Digital-to-analogue converter (DAC) projects All projects given in the book have been fully tested and are working. Only basic programming and electronics experience is required to follow the projects. Brief descriptions, block diagrams, detailed circuit diagrams, and full MicroPython program listings are given for all projects described. Readers can find the program listings on the Elektor web page created to support the book.
32 neue Projekte, praktische Beispiele und Übungen mit dem Elektor Arduino Nano MCCAB Trainingsboard
Die Elektronik und die Mikrocontrollertechnik bieten die Möglichkeit, kreativ tätig zu sein. Mit diesem Mikrocontroller-Praxiskurs besteht die Möglichkeit, eigene Arduino-Projekte zu realisieren und solche Erfolgsmomente erleben zu können. Im Idealfall funktioniert beim ersten Einschalten alles so, wie man es sich vorgestellt hat. In der Praxis läuft es dagegen selten wie erwartet. Dann braucht man Kenntnisse, um den Grund für das Nichtfunktionieren effizient suchen und finden zu können.
In diesem Buch für Fortgeschrittene steigen wir tief in die Welt der Mikrocontroller und der Arduino IDE ein, um neue Verfahren und Details kennen zu lernen, und erfolgreich noch anspruchsvollere Situationen angehen und lösen zu können.
Mit diesem Buch gibt der Autor dem Leser das nötige Rüstzeug, um eigenständig Projekte zu kreieren und auch schnell Fehler finden zu können. Anstatt nur fertige Lösungen zu bieten, erklärt er die Hintergründe, die verwendete Hardware und die eventuell benötigten Tools. Er stellt Aufgaben, bei denen der Leser seine eigene Kreativität einbringt und den Arduino-Sketch selbst schreibt.
Falls man einmal keine vernünftige Idee hat und nicht weiterkommt, gibt es natürlich zu jedem Projekt und zu jeder Aufgabe einen Lösungsvorschlag mit zugehöriger Software, der im Buch ausführlich kommentiert und erklärt wird.
Sie erfahren mit diesem Praxiskurs mehr über das Innenleben des Arduino Nano und des darauf befindlichen Mikrocontrollers. Sie lernen Hardware-Module kennen, mit denen Sie neue interessante Projekte realisieren werden. Sie beschäftigen sich mit Softwareverfahren wie z. B. "Zustandsmaschinen", durch deren Anwendung sich Aufgabenstellungen oft einfacher und übersichtlicher lösen lassen.
Die zahlreichen praktischen Projekt- und Übungs-Sketche realisieren wir wieder auf dem vom "Mikrocontroller-Praxiskurs für Arduino-Einsteiger" bekannten MCCAB Trainingsboard, das die gesamte Hardware-Peripherie und die Bedienungselemente enthält, die wir für die Ein-/Ausgabe-Operationen unserer Sketche benötigen.
Leser, die das MCCAB Trainingsboard noch nicht besitzen, können die benötigte Hardware separat erwerben, oder alternativ auch auf einem Breadboard aufbauen.
Programmierung in Assembler und C am Beispiel der ATtiny-Familie
Dieses Buch bietet einen eingehenden Blick auf die 8-Bit-AVR-Architektur in ATtiny- und ATmega-Mikrocontrollern, hauptsächlich aus der Sicht der Software und der Programmierung. Erforschen Sie die AVR-Architektur unter Verwendung von C und Assembler in Microchip Studio (früher Atmel Studio) mit ATtiny-Mikrocontrollern.
Lernen Sie die Details der internen Funktionsweise von AVR-Mikrocontrollern kennen, einschließlich der internen Register und des Speicherplans von ATtiny-Bausteinen.
Programmieren Sie ATtiny-Mikrocontroller mit einem Atmel-ICE-Programmiergerät/Debugger oder verwenden Sie ein preiswertes Hobby-Programmiergerät oder sogar einen Arduino Uno als Programmiergerät.
Die meisten Code-Beispiele können mit dem Microchip Studio AVR-Simulator ausgeführt werden.
Lernen Sie, Programme für ATtiny-Mikrocontroller in Assembler zu schreiben.
Erfahren Sie, wie Assemblersprache in Maschinencodebefehle umgewandelt wird.
Finden Sie heraus, wie Programme, die in der Programmiersprache C geschrieben wurden, in Assemblersprache und schließlich in Maschinencode umgewandelt werden.
Verwenden Sie den Microchip Studio Debugger in Kombination mit einem Hardware-USB-Programmierer/Debugger, um Assembler- und C-Programme zu testen oder verwenden Sie den Microchip Studio AVR-Simulator.
ATtiny-Mikrocontroller im DIP-Gehäuse werden verwendet, um eine einfache Nutzung auf Breadboards zu ermöglichen.
Erfahren Sie mehr über Timing und Taktimpuls in AVR-Mikrocontrollern mit ATtiny-Bausteinen.
Werden Sie zu einem AVR-Experten mit fortgeschrittenen Debugging- und Programmierfähigkeiten.
Program, build, and master 60+ projects with the Wireless RP2040
The Raspberry Pi Pico and Pico W are based on the fast, efficient, and low-cost dual-core ARM Cortex M0+ RP2040 microcontroller chip running at up to 133 MHz and sporting 264 KB of SRAM and 2 MB of Flash memory. Besides spacious memory, the Pico and Pico W offer many GPIO pins, and popular peripheral interface modules like ADC, SPI, I²C, UART, PWM, timing modules, a hardware debug interface, and an internal temperature sensor.
The Raspberry Pi Pico W additionally includes an on-board Infineon CYW43439 Bluetooth and Wi-Fi chipset. At the time of writing this book, the Bluetooth firmware was not yet available. Wi-Fi is however fully supported at 2.4 GHz using the 802.11b/g/n protocols.
This book is an introduction to using the Raspberry Pi Pico W in conjunction with the MicroPython programming language. The Thonny development environment (IDE) is used in all of the 60+ working and tested projects covering the following topics:
Installing the MicroPython on Raspberry Pi Pico using a Raspberry Pi or a PC
Timer interrupts and external interrupts
Analogue-to-digital converter (ADC) projects
Using the internal temperature sensor and external sensor chips
Using the internal temperature sensor and external temperature sensor chips
Datalogging projects
PWM, UART, I²C, and SPI projects
Using Bluetooth, WiFi, and apps to communicate with smartphones
Digital-to-analogue converter (DAC) projects
All projects are tried & tested. They can be implemented on both the Raspberry Pi Pico and Raspberry Pi Pico W, although the Wi-Fi-based subjects will run on the Pico W only. Basic programming and electronics experience are required to follow the projects. Brief descriptions, block diagrams, detailed circuit diagrams, and full MicroPython program listings are given for all projects.
With Examples for Raspberry Pi Pico and ESP32
Creating and programming small electronic systems is now easier than ever before. With inexpensive development boards and modern software tools, anyone curious about embedded design can quickly move from an idea to a working piece of hardware. At the heart of this change is MicroPython—a clear, interactive, and beginner-friendly way to program microcontrollers while still remaining closely connected to the underlying electronics.
This book introduces embedded programming through MicroPython on popular platforms such as the Raspberry Pi Pico and the ESP32. You will discover how to use microcontrollers for reading inputs, processing data, and controlling outputs in a predictable, real-time loop. With just a few lines of code, you can blink LEDs, read sensors, drive motors, and communicate with the outside world. The interactive REPL programming interface encourages experimentation and fast learning, making concepts tangible from the very first chapter.
While different boards offer different capabilities, they all share the same core principles. Timers, GPIO, analog I/O, PWM, interrupts, and communication interfaces form the foundation of every embedded system.
By focusing on these universal building blocks, this book helps you build skills that transfer across platforms and scale naturally toward more advanced development. Whether you are a beginner or an experienced programmer entering embedded systems, you will find that working with MicroPython is both practical and genuinely enjoyable.
This book contains 50 fun and exciting projects for PIC microcontrollers such as a laser alarm, USB teasing mouse, eggtimer, youth repellent, soundswitch, capacitive liquid level gauge, 'finger in the water' sensor, guarding a room using a camera, mains light dimmer (110-240 volts), talking microcontroller and much more. Several different techniques are discussed such as relay, alternating current control including mains, I²C, SPI, RS232, USB, pulse width modulation, rotary encoder, interrupts, infrared, analog-digital conversion (and the other way around), 7-segment display and even CAN bus.
You can use this book to build the projects for your own use. The clear explanations, schematics and even pictures of each project make this a fun activity. For each project the theory is discussed and why the project has been executed in that particular way. That means you can also use this book as a studybook, or as basis for larger and more complicated projects. All projects use a breadboard so modification and expansion is easy.
Three PIC microcontrollers are used, the 16f877A, 18f4455 and 18f4685. It is also discussed how you can migrate your project from one microcontroller to another – 15 types are supported - including two example projects.
All software that is used in this book can be downloaded for free. That also applies to the open source programming language JAL. This powerful and yet easy to learn language is used by hobbyists as well as professionals.
This book can also be used as a reference guide. It explains all JAL commands, as well as the expansion libraries. Using the index you can easily find example projects that illustrate the use of these commands. Even when you have built all projects in this book you will still want to keep it within arm's reach.
Wie enigszins bekend is met moderne microprocessor systemen als Arduino, kent ongetwijfeld ook de problemen met dit soort kaarten. Ze zijn te duur om voor elk project een aparte kaart aan te schaffen en zijn bovendien nogal fors van formaat.
Het aardige van de ATtiny is dat de schijn bedriegt. Het lijkt een klein IC met een beperkt toepassingsgebied, maar het heeft een verbazingwekkend scala aan (speelse) mogelijkheden.
Dit boek beschrijft de enorme veelzijdigheid van de ATtiny microcontroller aan de hand van ongeveer vijftig leuke elektronica projecten, speciaal gericht op de beginner. De meeste ontwerpen zijn volledig uitgewerkt, enkele zijn meer als ontwerpidee gepresenteerd. De inhoudsopgave laat zien dat we ons op vele terreinen zullen begeven, van zonnevolger tot helling indicator. Dit boek is beslist geen theorieboek. Het is een boek dat gelezen zal worden met de soldeerbout in de hand.
Voor het programmeren van de ATtiny maken we dankbaar gebruik van een Arduino kaart. Als de Arduino ingesteld word als programmer, kunnen we er de meeste Arduino “sketches” mee overzetten naar de ATtiny. We wensen u veel plezier met het nabouwen van de schakelingen.