Microchip: AVR Assembly Web Documentation
2018-2019 ICS4U: AVR Optimization (Blog: Ethan M) EAGLE LIBRARY: ACES_SMT.lbr
Session 6: ACES DC Fan Project
Jun
10
Distribution of DC Desktop Fans to
2019 ACES Graduates
(made possible by the phenomenal
commitment to his peers by Kreher F-A
)
Click to enlarge
77
May 29
ISPs...
GB, JC, AH, KFA
SK, DR, HR
Final Class
It'll be hard to compete with average...
  30d
76
May 27
30c
75
May 23
  ISP Work Period   30c
74
May 21
DC Fan Videos...
GB*, JC, AH, KFA
SK, DR*, HR
ISP Work Period   30c
73
May 16
Timer0 Regs
Timer1: Input Capture (ICP)
DC Fan Project: Full
DER
(due Monday)
5b
72
May 14
AP Calculus Work Period for GB, AH, HR   5b
71
May 10
5b
70
May 8
AP English Work Period for KF-A   5b
69
May 6
Flex Videos...
GB, JC, AH
KFA, SK, DR, HR
DC Fan Project:
LCD Update: Array Indexing in AVR Assembly
6c
68
May 2
2018 Alumni Visit Flex Work Period DER due 6b
67
Apr 30
POT→ADC→DoubleDabble→LCD
LCDLib.asm

DoubleDabble.asm
Duty Cycle 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
RPM 900 900 900 900 1200 2000 2700 3400 4050 4500 4800

66
Apr 26

Weiman:Alfred State
(Thanks, Graydon)
Complete Double Dabble exercise
15/16 RSGC ACES: LCD Direct Drive
LCD Direct Drive Project Description
LCD Include file:
LCDLib.asm

High Level
Source Code:
LiquidCrystal Library
Hitachi's
HD44780U
LCD Controller/Driver
4-bit
Initialization
Sequence (p. 46)
65
Apr 24
Binary to BCD Conversion:
Double dabble
DoubleDabble
BCD Arithmetics:
AVR204
Recall DS1307 Registers
64
Apr 18
The FASTEST! way to toggle Digital Pin 13:
sbi PINB,5
(or any AVR I/O pin)
Complete LCDBrightnessT2M7.asm
DC Fan
Speed Requirements
Timer2 Compare Match
63
Apr 16
Timer2 Control Regs
Tidy up ServoSweepinClass.asm: lds, not ldi

ServoSweepwithADCRegisterLevel.ino (Demo)
Introduction to the AVR's ADC Peripheral
Timer2 Fast PWM Compare Match Modes

ADC Register References
Timer 2 Modes
Timer2 Prescalers


Arduino Timer Usage
62
Apr 12
ADC Block Diagram
Day 3 of ServoSweep

ServoSweepwithADCRegisterLevel.ino

Sunon 12V
DC Fan Datasheet
61
Apr 10
ADC Block Diagram
Assembly Task #40: The DC Fan
PART D: Speed Control (ADC)

2016/2017 Challenge 4: Analog-to-Digital Conversion
The FASTEST! way to toggle Digital Pin 13:

sbi PINB,5

(or any AVR I/O pin)
60
Apr 8
Adafruit Learning:
Servo Motors

RetroDan:
ADC Assembly Tutorial
(details an LDR Theremin on an ATtiny13/85)
Complete ServoSweep from last class
AS7 Assembly Project: ServoSweepwithADC

MaxEmbedded: The ADC of the AVR
DIDR0

Timers.xlsx
59
Apr 4
AS7 Assembly Project: ServoSweep
AppNotes for Multibyte Arithmetics
AVR200, AVR201 (AVR201.asm), AVR202
58
Apr 2
Timer1 Regs
Flex Page Proposal Due, Common SMT Parts


Assembly-Level PWM Control over your Servo
PWMTimer1Mode15.ino
Timer1 Modes
March 29: FLEX PAGE GROUP DISCUSSION and DEVELOPMENT
56
Mar 27
Long ISP Proposal Due
ACES Desktop Fan Project?
Recall: Servo PWM Requirements
Fan Speed Control:

PWM Requirements (p. 10-11)
Timers.xlsx.SquareWaveApprox

prescalers.inc
prescalers.h

MARCH BREAK
Session 5: AVR ALP: External Interrupts and Detailed Investigation of Timer Interrupts
CLASS REFERENCE CONCEPTS PROJECTS SUPPLEMENTARY
55
Mar 7
Medium ISP Videos...
GB, JC, AH, SK,HR
Medium ISP Presentations
Medium ISP Videos...
GB, JC, KF-A, AH, SK, DR, HR
54
Mar 5
Reliable Webcasters:
Ben Eater
Nick Gammon
Ken Shirriff
Kevin Darrah
(if PCBs arrive, it's an ISP work period)
CTC: Timer 1 Mode 4
(Clear Timer on Compare match)
20c, 20d
53
Mar 1
Ken Shirriff's:
Secrets of
Arduino PWM
Demonstration of Morland Bargraph SMD V1
Arduino Forum: PWM Cheat Sheet

Timers.xlsx, Excel VLookUp() Function
Timer Interrupt Flags
Fast vs Phase-Correct
52
Feb 27
HARDWARE-LEVEL INTERRUPTS
Squeezing the last drop of interrupt value
from Normal Mode 0
:
Output Compare on Timer 1 and Timer 0
51
Feb 25
4-Wire DC Fan. Pt. A.
GB
HARDWARE-LEVEL INTERRUPTS
Squeezing the last drop of interrupt value
from Timer1 Normal Mode 0
:
Output Compare
TIMSK1 & OCIE1
50
Feb 19
Hugo's ISP Preview

Timer and Interrupt Etiquette
explains the role of the volatile keyword
Complete (first draft of):
T1NormalOVFISR.asm

Modifications to T1NormalOVFISR.asm
1. Lower Frequency 2. Higher Frequency
(without changes to prescaler)
AVR Timer Calculator

5
Interrupts

analogWrite()

tone()

Sunon 12V
DC Fan Datasheet
49
Feb 19
DirtyPCBs
RSGC ACES: Common SMD Parts (Updated)
ASM: T1NormalOVFISR.asm
Timer-Based Functions:
delay(), millis(), microseconds(), Servo, Tone
Acquire: prescalers.h
48
Feb 13

Application Note:
AVR Timers
Introduction to AVR Timers
AVR Assembly Task: Timer 1 Normal Mode
Arduino C: Timer 1 Library and Resources
TimerOne
Source: TimerOne.h, TimerOne.cpp
TimerOne Documentation
TimerOne
Examples: Interrupt, FanSpeed
Timer1 Modes
Timer1 Regs
47
Feb 11
Medium ISP Previews
Hodgson Kitchens: Bakin' the SMT Bargragh @ 3!
46
Feb 7
SPI: Serial Peripheral Interface
Some Guy's MCP4231 10k DigiPot VLog
Datasheet: MCP4231
MCP4231.ino
Interleaving two
threads with
compiler directives:
ShiftOutvsSPI.ino
SPIInterrupt.ino
SPI Task B.
45
Feb 5
SPI: Serial Peripheral Interface
(Hardware SPI vs Software Shiftout)
AVR910: In-System Programming
AVR151: Setup and Use of the SPI
Knight Rider...
GB, JC, KF-A,
AH, SK, DR*, HR
43
Jan 30
Feb 1
D. Raymond's
RTC Appliance
AS7 Project Dependencies:
See line 946 in m328Pdef.inc
External Interrupt (RTC SQW)
4 328P Int. Vecs.(p.66)
42
Jan 28
Include file:
iom328p.h

External Interrupts
We've talked about this as a terrific ISP:
Arduino 3D Wire Bending Machine
Your first peripheral...
ASM:
External Interrupt (RTC SQW)
41
Jan 24
AS Debugging Resources

Interrupts
Nick Gammon's Notes on Interrupts (lots of examples)
Tutorial #2: AVR Microcontroller Interrupts
328P Int. Vecs.(p.66)
Session 4: Introduction to ATMEL Studio 7 with ATMEL ICE: C and AVR Assembly Language Programming
CLASS REFERENCE CONCEPTS PROJECTS SUPPLEMENTARY
40
Jan 22
Assembler Directives ATMEL Studio 7: AVR Assembly
Efficiency + Accuracy Productivity:
Customize your Template (BareMinimum328p.asm)
ASM: BlinkSafe and BlinkBicolor
Medium ISPs
39
Jan 18
  AS7: C version of shiftOut on Bargraph Appliance   MorlandShiftBarC.docx
38
Jan 16
A. Hodgson's
Reflow Demonstration
SMD Version of the Morland Bargraph
(.sch, .brd)
RSGC ACES
: Common SMD Parts (Updated)
Medium ISPs
37
Jan 14
Atmel ICE: Setup and Debugging AutoDesk EAGLE
List of Integrated Package Types
RSGC ACES
: Common SMD Parts
AS7: C version of shiftOut on Bargraph Appliance
  Medium ISP
Proposal Due

20a
36
Jan 10
pp. 12-21
AVR Optimization
(CBlink.c)
AS7 & Atmel-ICE: CBlink.c
Blog
: Arduino Assembly/C Programming with ICE
Microchip's ATMEL/AVR Webdoc
20a
35
Jan 8
Medium ISP and Proposal Form
IDE
: Atmel Studio 7
Programmer: Atmel-ICE
  Rotary BCD...
GB, JC, KF-A,
AH, SK, DR, HR
20a
DECEMBER BREAK
Session 3: Introduction to AVR Assembly Language: Arduino IDE Inline and Standalone Assembly Language Programming
CLASS REFERENCE CONCEPTS PROJECTS SUPPLEMENTARY
34
Dec 18
オープンソースでプログラムもできる、ニキシー管デジタル時計がアツい
ExploreBits
ACES' Alumni visit
(10:30-10:50)
3, 20a
33
Dec 14
AVR AppNotes:
Comparing 16-bit Regs
AVR Addressing Modes
(Full) AVR Instruction Manual (Ch. 2)
Arrays (with Example handout)
Comparing 16-bit Registers
3
32
Dec 12

ExploreBits
(HW: 3 & 4)

3
31
Dec 10
AVR Status Register: SREG (0x3F)

Using as
Assembler Directives, AVR Dependent Features


ExploreBits

3

tst, swap,
inc, dec,
breq, brne
30
Dec 6
BicolorBlink (see F/C for solutions) 3
ser, com, sbi, cbi
29
Dec 4
Presentation of Telephone Keypad Projects
AVR-as Example program (with Notes at End)
Assembly Access to the Serial Monitor
Keypads...
GB, JC, KF-A,
AH, SK, DR, HR

3

28
Nov 30
Please have Windows 10 & Atmel Studio 7 Installed
TrafficLight (Enhanced) (Schaffer, ACES '18)

Arduini IDE: Standalone AVR Assembly
Arduino: main.cpp
AVR Assembler Reference
RGBLED (Standalone Assembly)

Traffic Light (Basic)
Make maximum use of Predefined Constants
io328p.h
27
Nov 28
Blink (completed)
TrafficLight (Basic) (Schaffer, ACES '18)
AVR Delay Loop Calculator
GPIO Ports
26
Nov 26
AVR Optimization

pp. 24-26, 77
volatile
Arduino IDE: Inline AVR Assembly
8-bit AVR-gcc Assembly Language Instruction Syntax:
mnemonic [dst,] [src]
Arduino IDE
: Inline Assembly Coding
asm ("mnemonic dst,src \n") ;

First Attempt: Blink


AVR 8-bit Instruction Set
Online Reference
Summary vs Detailed
ldi, out, clr, eor
Session 2: ISP Presentations, Interrupts and Keypad Button Debouncing Techniques
CLASS REFERENCE CONCEPTS PROJECTS SUPPLEMENTARY
25
Nov 22
PWM
(Pulse Width Modulation)
vs
BCM
(Binary Code Modulation)
Hackaday: Debounce your Noisy Buttons
Bounce
Blum: Debouncing Noisy Buttons
Schmitt (Trigger) Gates
24
Nov 20
Hackaday: Debounce your Noisy Buttons
Bounce
Blum: Debouncing Noisy Buttons
Schmitt (Trigger) Gates
Make heavy use of these
Predefined Constants
io328p.h
23
Nov 14
Button Pressing (Software Debounce) to generate
Hardware Interrupts
(External, PinChange)
Blum: Hardware Interrupts
328p Int. Vectors
22
Nov 8
Short ISP Videos...
KF-A, DR
Short ISP Presentations
Course Reset:
Install Windows 10 and Atmel Studio 7
10d, 2a
21
Nov 6
Short ISP Videos...
GB, JC, AH, SK,HR
Short ISP Presentations
20
Nov 2
  Short ISP Work Period 10c  
19
Oct 31
  Short ISP Work Period 10c
18
Oct 29
  Short ISP Work Period    
SHORT ISP (4 weeks) : Sep-Oct ( Component ) ( Options )
Session 1: The CHUMP Processor
CLASS REFERENCE CONCEPTS PROJECTS SUPPLEMENTARY
17
Oct 25
  CHUMP: Completed Processor Videos...
GB, JC, KF-A, AH, SK, DR, HR
Short ISP Work Period
   
16
Oct 23
CHUMP: Day 11
Final Build Session: Completed Processor
1e  
15
Oct 19
  CHUMP: Day 10
Second-to-Last Build Session: Completed Processor
1e  
14
Oct 17
InSPiration from Mariano,
Looking for 7-Segment
Awesomeness?
CHUMP: Day 9
Third-to-Last Build Session: Completed Processor
1e
13
Oct 15
CHUMP: Processor (Common) Videos...
GB, JC, KF-A, AH, SK, DR*, HR*
Short ISP Work Period
1e  
12
Oct 11
CHUMP: Day 8
Build The Processor
1d
11
Oct 9
Short ISP: Preview
(see ICS4U post for details)
1d
10
Oct 4
CHUMP: Day 7
Build The Processor
Pro Wiring...
10b, 1d
9
Oct 2
CHUMP: ALU Videos...
GB*, JC*, KF-A, AH, SK, DR**, HR
Short ISP Work Period #2
10b, 1d 2's Complement
B. Eater's Discussion
8
Sep 28
2 Binary Variables?...



...16 Logical Functions!
CHUMP: Day 6
The Arithmetic and Logic Unit
Concept: Active LOW vs Active HIGH Logic
Part 3: The Arithmetic and Logic Unit
Reference: Eater's ALU Page
Boolean Ops of 2 vars
74LS181 ALU
Active High Operations
7
Sep 26

74LS181 Comb. Circuit
CHUMP: Day 5
The Arithmetic and Logic Unit
English Translation of a Polish Blog
Review: Ken Shirriff's Blog:
The SN74LS181 ALU
How it Works and Why it's so Strange
1c
6
Sep 24
List of Short ISPs CHUMP: Clock Videos...
GB, JC, KFA, AH, SK, DR, HR
Short ISP Work Period #1
(first class of each week)
RSGC's 1st Computer
(Jan 7, 1980 @ $25K)
Our PDP-11/03
Minicomputer

(SN74LS181 as ALU)
5
Sep 19
  CHUMP: Day 4
The Clock Module Build Session
1b
4
Sep 17

CHUMP DAY 3:
The Clock Module (CLK): Distribute Clock Kits
Ben Eater's Terrific 4-part 555 Clock Series...
Astable 555, Monostable 555
Bistable 555, Comb. Logic
1b
3
Sep 13
List of Short ISPs
pp. 81-82
Short ISP Selection: Submit Hard Copy Proposal
First Look at the Project and Code
CHUMP: Day 2
10a, 1a
2
Sep 11
List of Short ISPs

Read upside down (it's worth the RISC)
First Look at the Project and Code
Committed CHUMP Program due Saturday
CHUMP: Day 1
10a, 1a SAPP-1: First Look
1
Sep 7
2018/2019 ACES Program
Student Outline
Mr. D's Timetable
Our ACES' Program: Contradictions
ACES Hall of Fame: E. McAuliffe ('18), Mariano Elia ('15)
Distribute Workbooks
AVR Optimization
TA Day Assignments (First Term)
PB Machine: Due Thursday in class
Short ISP Discussion, Sep 8: The Launch
Starters are a dime-a-dozen...
For our second Field Trip of the year we have been invited to visit a factory that is developing solar panels. Since this device is an integral part of our Greenhouse Project this year, early familiarity with this technology will be advantageous.
What better way is there to start the year than with a walking field trip to acquire the electronic components that we will make good use of? You'll also be aware of its location for your own personal projects.
I have no formal training in electronics or electrical engineering - I'm just really interested in this field. The knowledge and skill I have has been largely acquired over the last few years from learning alongside many talented Georgians and I look forward to expanding my capabilities by working with you this year.
I ask six things of my ACES (for most other things I'm usually flexible):
1. Do not cheat.
2. Show respect for adult visitors that enter the DES by immediately stopping what you are doing, standing and facing the individual(s).
3. Show respect for the lab by not eating in the DES. You may go into the hallway for a quick bite if you need to.
4. Show respect for the lab's resources by not wasting or misusing them.
5. Show respect for others that use the lab by putting your projects away and leaving your bench area tidy when you leave.
6. Show respect for yourself by looking (and speaking) your best. It's the little things keep the doors of opportunity open.
Growing Success, p. 29
Responsibility, Organization, Independent Work, Collaboration, Initiative, Self-Reliant Growing Success. p.11.

It is worth noting, right from the start, that assessment is a human process, conducted by and with human beings, and subject inevitably to the frailties of human judgment.
However crisp and objective we might try to make it, and however neatly quantifiable may be our "results", assessment is closer to art than science.
It is, after all, an exercise in human communication.
Knowledge: Subject-specific content acquired in each course (knowledge), and the comprehension of its meaning and significance (understanding).
Thinking: The use of critical and creative thinking skills and/or processes, as follows:
Communication: The conveying of meaning through various forms, as follows:
Application: The use of knowledge and skills to make connections within and between various contexts.