Table of contents
Chapter 1 Introduction, i.e. new members of the AVR family (11)
- Book examples (12)
- Microcontrollers XMEGA (12)
- XMEGA and other AVRs (15)
- Compiler (15)
- New peripheries (16)
Chapter 2 How to get started, i.e. installation of the environment (21)
- Xplained as a developmental plate (22)
- Installation of Xplained in the system (22)
- XMEGA installation with DFU class bootloader (25)
- XMEGA chip programming (25)
- FLIP firmware upload (26)
- Atmel Bootloader (28)
- Basic options of the batchisp (28)
- JTAG interface (32)
- Programming using the PDI interface (34)
- Programmers (34)
- AVRISP mkII (35)
- JTAGICE mkII (35)
- JTAGICEIII (36)
- AVROne! (36)
- AVR Dragon (36)
- Programming and debugging XMEGA processors (43)
- Power decoupling (44)
- Installation of needed software (44)
- Atmel Studio 6 - basics (45)
- Programming with AS6 - why use elf files (53)
Chapter 3 Project organisation and management (55)
- Comments (55)
- Nomenclature (57)
- Code division into files (61)
- Visibility of functions (66)
- Visibility of variables (66)
- Subdirectories (67)
- Division of functions (69)
- Global variables (70)
- Versioning systems (74)
- SVN server on your own computer (75)
- How to use SVN (78)
- Working with SVN (81)
- Final comments (84)
- Other facilities (85)
- How to write better programs? (86)
Chapter 4 How to create better and more effective code (89)
- Enabling optimisation (90)
- Type length (91)
- Global and local variables (93)
- Modifier register (94)
- Use of global general purpose registers (97)
- Use of other registers as GPIOR (99)
- Initialisation of global variables (99)
- Position of variables in memory (99)
- Loop optimization (100)
- Optimisation of functions (101)
- Optimization of the main function (101)
- Optimization of function prologues and epilogues (101)
- Optimization of the transfer of function parameters (102)
- Optimization of function return (105)
- Additional function attributes (106)
- Others (110)
- Elimination of dead code (111)
- Constructors and destructors (114)
Chapter 5 How to sort out chaos, i.e. complex data types and lists (117)
- Boards (118)
- Structures (119)
- Deep copy and shallow copy (123)
- Indicators and structures (126)
- Anonymous structures (127)
- Initialization of structure fields (128)
- Unie (129)
- Bitfields (130)
- Structures and programme optimisation (131)
- Letters (135)
- One-way letters (136)
- Two way letters (140)
- XOR Lists (142)
- Buffers (148)
- Ring buffer (149)
- FIFO/LIFO queues (152)
- Stack (152)
Chapter 6: No more mess, i.e. names of registers and peripherals (155)
- Structures describing XMEGA microcontrollers (159)
- Registry names (162)
- Bit names (162)
Chapter 7 Better and simpler, i.e. CPU IO ports on steroids (167)
- Input and output pins (168)
- Conversion of logical levels between systems operating with different supply voltages (171)
- Connecting the processor output to a 5-volt (171) system
- Use of an active converter (174)
- Conversion from higher to lower voltage (174)
- Resistance divider (176)
- Use of integrated buffer voltage conversion (177)
- Two-way buffer for open drain buses (178)
- Control over CPU ports (181)
- Input and output pins (182)
- Synchronizer (184)
- Pin driver configuration (186)
- Totem-field configuration (186)
- Pull up/down configuration (187)
- Bus keeper configuration (188)
- Wired-AND configuration (189)
- Wired-OR configuration (191)
- Reversing outputs IO (192)
- Control of rate of descent and slope rise (193)
- Pin event control (193)
- Port control register (194)
- Atomic Pin State Modification and Support for RMW (196)
- Alternative pin functions (199)
- Virtual Ports (200)
- Handing over the registry as function parameter (202)
- Remaping IO outputs (203)
Chapter 8 NVM Controller - how to make memory easy and enjoyable (205)
- EEPROM memory and related operations (206)
- Access to EEPROM from AVR-libc (208)
- Access to the EEPROM by means of direct access to the NVM controller (213)
- Wear leveling techniques (219)
- Separation of memory deletion and recording (221)
- Access to EEPROM using tokens (224)
- EEPROM and power failure (232)
- Atomic problem with access to EEPROM (244)
- Entry into EEPROM using interrupts (244)
- Prevention of damage to EEPROM contents (246)
- Access to FLASH memory (246)
- Data types related to FLASH memory (248)
- Reading data from FLASH memory (250)
- Access to FLASH in the compiler avr-gcc 4.7 and higher - named address spaces (252)
- Indicators using address spaces (254)
- 24-bit types (258)
Chapter 9. I need more power - a few words about the clock configuration (259)
- Clock control records (260)
- Clock configuration (262)
- Sources of the clock (263)
- Unlocking the clock source (270)
- Layout PLL (270)
- DFLL (272)
- External clock monitoring system (275)
- Change of clock source and frequency (277)
- Locking the clock setting (277)
- Clock prescalers (278)
- Notes (281)
- Decoupling capacitors (282)
Chapter 10 Interruption and interruption controller (285)
- Interruptions (285)
- What are interruptions? (285)
- Masked breaks (286)
- Non-maskable interruptions (287)
- Sources of interruptions (287)
- Configuration and interruption handling (288)
- Response time to interruption request (288)
- Interruption control function (289)
- Break vectors (290)
- Empty interruption vectors (292)
- Empty interruptions (293)
- Code sharing by interrupts (294)
- Naked attribute and interrupt handling in assembler (295)
- Breakage levels (297)
- Interruption of interruptions (300)
- Breakdown priorities (302)
- Dynamic priority (302)
- Global flag of interruption authorisation (303)
- Unmaskable interruption (304)
- Interrupt controller status log (304)
- Volatile modifier (305)
- Re-ordering of instructions (307)
- Atomicity of access to data (308)
- Atomic memory modification instructions (311)
- Access to multi-byte IO registers (314)
- Functions of the reentrant (314)
- General purpose OI registers (316)
Chapter 11 Event system (319)
- Event channel multiplexer register (320)
- Advanced Event channel functions (322)
- Digital filter (322)
- Square decoder (322)
- Square encoder with index (331)
- Software event control (332)
- Events as control signals for external systems (333)
- Other register functions (334)
Chapter 12 Timers and counters (337)
- What's the meter? (337)
- Clock sources and prescaler (338)
- Counter types and functions (340)
- Counter output pins (350)
- Type 2 counter (351)
- Type 4/5 timers (353)
- Caching (354)
- Control over the meter (357)
- Cascade linking of meters (358)
- TEMP temporary registry (359)
- Using PWM to generate analogue signals (361)
- Example - variable amplitude voltage generation (363)
- Example - generation of any run (364)
- PWM and interruptions (369)
- How about DMA? (371)
- Resolution enhancement extension (374)
- HiRes mode for counter type 2 (377)
Chapter 13 DMA Controller (379)
- Memory-to-memory transfer (383)
- Data inversion (384)
- Transfer of overlapping memory blocks (385)
- Filling the memory with the standard (388)
- Memory-Remove IO (389)
- Triggers (392)
- Buffer operation (395)
- DMA channel priorities (396)
- DMA interruptions (397)
- DMA transmission error (397)
- Termination of the transaction (398)
Chapter 14. LEDs - what can be squeezed out of them? (399)
- LED strips (399)
- A little bit about the properties of the eye, that is RGB in practice (403)
- Control programme (404)
- 7-segment LED displays (407)
- LED matrixes (416)
- PCB design and power supply (421)
- Matrix supply voltage selection (422)
- Diode current adjustment (423)
- Two-colour array (423)
- Matrix control (425)
- PWM differently, i.e. how to obtain colour shades (433)
Chapter 15 Clock systems in practice (437)
- RTC or... RTC? (438)
- 16-bit RTC chip (438)
- Synchronization of access to RTC registers (441)
- PER and COMP registers (442)
- RTC in sleep mode (445)
- 32-bit RTC chip (445)
- Clock signal generator (445)
- PER and COMP registers (445)
- CNT register (446)
- Example calendar programme (446)
- Linux time marker (447)
- Time conversion (447)
- Time by radio, or DCF77 (451)
- A little more about DCF77 (452)
- Data decoding (454)
- DCF77 receiver module (454)
- Example (455)
- Power supply backup system (462)
- Selection of emergency power source (463)
- Use of batteries (463)
- Supercondensers (463)
- Batteries (464)
- Power support for the entire processor (465)
- Battery backup system (465)
Chapter 16: We build a clock with an alarm clock, which is a finished state machine in practice (469)
- FSM based on switch/case (471)
- FSM based on tables (474)
- Alarm clock (477)
- Still about the state machines (489)
Chapter 17 Communication in different ways, or USART in practice (491)
- Electrical implementation of the USART interface (492)
- Data transmission format (494)
- Transmission speed (496)
- Terminal (496)
- Data transmission preview (497)
- Virtual serial port (499)
- Interface configuration (500)
- Pin configuration IO (501)
- Configuration of the data frame format (502)
- Additional interface functions (502)
- Interface speed setting (503)
- Data validation (508)
- Data transmission (509)
- Transmission by pooling (509)
- Use of interruptions (512)
- Use of DMA (517)
- Simultaneous access to USART from multiple "threads" (525)
- Access to USART using streams (527)
- Get method (528)
- Put method (528)
- Opening the stream (529)
- MPCM mode (530)
Chapter 18 Data visualisation (535)
- Atmel Data Visualizer (535)
- Data format (537)
- Structures used by ADV (540)
- Ultrasonic distance measurement (543)
- Digital modules (544)
- Own module (548)
- We are building a logical state analyzer (550)
- Equipment (551)
- Communication protocol (553)
- Protocol implementation (555)
- How fast can you sample? (560)
- Customer (564)
- Practical comments (566)
Chapter 19: Use of infrared for data transmission (569)
- IR modulation (570)
- Let's talk to the TV remote. (572)
- Equipment part, namely the IR receiver (572)
- The software part, or coding standards (574)
- NEC and related standard (575)
- RC5 and Motorola (581)
- RC5 code (587)
- Other coding standards (592)
- IR transmitter (592)
- Reverse engineering - we decode the Canon remote control signal (595)
- Data transmission (597)
- We build a data package (600)
- Hardware CRC generator (602)
- Packet transmission (605)
- Universal remote control (608)
- IrDA and IRCOM interface (613)
Scorch (615)
|