Update for 03-11-21 17:45

This commit is contained in:
Tyler Perkins 2021-11-03 17:45:01 -04:00
parent 80d85733ff
commit 4c0c6ee6ce

View File

@ -38,10 +38,18 @@ see [[arduino_techniques|Programming Techniques]]
=== Pins ===
Pins are controller by the atmega's ports. Each port has different port
registers. Each bit of the 8 bit register controls a single pin. Port D
controls pins 0 through 7, C controls the analog pins, and B controls 8 through
13
The ATMega328P can control all of its pins via the use of an abstraction,
called ports. Each port has registers associated to it, and each pin
corresponds to a bit in a port register.
Port D controls pins D0 - 7,
Port C controls the analog Pins,
Port B controls pins D8 - 13
Each port has 3 registers associated with it. Port* is the register that allows
writing to the pins. These are PortB (0x25), PortC (0x28)
* PortC
- Port C data regiser
- 0x28
@ -176,7 +184,7 @@ as WGM13 and WGM12 respecitvly. When ordred WGM13 through WGM10, they create a
| 1 | PWM, phase correct, 8bit | 0x00FF | TOP | BOTTOM |
| 2 | PWM, phase correct, 9-bit | 0x01FF | TOP | BOTTOM |
| 3 | PWM, phase correct, 10-bit | 0x03FF | TOP | BOTTOM |
| 4 | CTC | OCR1A | Immediate | MAX |
| 4 | Clear on compare match | OCR1A | Immediate | MAX |
| 5 | Fast PWM, 8bit | 0x00FF | BOTTOM | TOP |
| 6 | Fast PWM, 9bit | 0x01FF | BOTTOM | TOP |
| 7 | Fast PWM, 10bit | 0x03FF | BOTTOM | TOP |
@ -189,7 +197,6 @@ as WGM13 and WGM12 respecitvly. When ordred WGM13 through WGM10, they create a
| 14 | Fast PWM | ICR1 | BOTTOM | TOP |
| 15 | Fast PWM | OCR1A | BOTTOM | TOP |
While in normal mode the Timer/Counter 1 Register counts up (inremental) and no
counter clear is done. The counter will overflow when the max 16 bit value
(0xFFFF) is reached. The registers that contain the counter values are The