Intro to Bare Metal Programming - Episode 14: Final Project - Part 1

preview_player
Показать описание
This is the first video (of two) for the final project in this series. The final project consists of 2 AVR-DD Curiosity Nano dev boards; one is the Host device, while the other is the Client device. The Host and Client are connected via an SPI data bus. Both devices initialize and then go into the lowest power sleep state. When the button on the Host device is pressed, it wakes from sleep and takes an ADC reading and a Window Comparison measurement. It then sends the data over the SPI bus and returns to sleep. When the Client device detects an arriving SPI packet, it wakes from sleep and converts the SPI data packet into a human-readable format. It then writes the data out to the USART and returns to sleep. The final project leverages libraries built up during the course of this series.

AVR Bare Metal Episode 14:

00:11 - In the previous video
00:24 - In this video
00:44 - Final Project Description
01:36 - Intro to State Machines
02:18 - Host device State Machine design
02:49 - Client device State Machine design
03:18 - Wiring diagram
03:55 - Host device MPLABX implementation
04:01 - Including Header and Source files
05:13 - SPI data block anatomy
05:48 - Host device implementation
06:11 - Using a spin lock instead of _delay_ms
07:08 - State machine enum and struct
07:41 - Main function and switch case statement
08:05 - INIT state
08:20 - Low Power Clock function
09:37 - Port Init function
10:08 - AVR Low Power Techniques
12:08 - Sleep modes
13:02 - Choice of oscillator
14:16 - Unused pins
17:21 - ADC Init function
18:42 - USART Init function
19:00 - Determining baud rate
20:00 - Sleep Init function
20:32 - SLEEP state
20:40 - Wake from sleep using button press
23:10 - READ_ADC state
23:20 - ADC library
25:47 - VREF settling time for ADC
27:03 - ADC Conversion
27:27 - ADC Window Comparison & Writing ADC data to SPI data array
28:37 - SWITCH_TO_HI_SPD_CLK state
29:34 - SEND_SPI state
29:37 - SPI Host Init function
32:16 - Host SPI data send
32:42 - SPI Write Block function
33:54 - Host SPI data send (cont.)
34:18 - SWITCH_TO_LOW_PWR_CLK state
35:04 - In the next (and final) episode

Links:
AVR64DD32 Datasheet:

AVR-DD Curiosity Nano Hardware User Guide:

Microchip University: State machines class

App Note AN2515 AVR Low Power Techniques
Рекомендации по теме