Update for 03-11-21 17:15
This commit is contained in:
parent
7178088572
commit
39a231a24d
@ -42,7 +42,6 @@ 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
|
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
|
controls pins 0 through 7, C controls the analog pins, and B controls 8 through
|
||||||
13
|
13
|
||||||
|
|
||||||
* PortC
|
* PortC
|
||||||
- Port C data regiser
|
- Port C data regiser
|
||||||
- 0x28
|
- 0x28
|
||||||
@ -135,7 +134,7 @@ controlling Timer/Counter 1, along with Timer Counter 1 Control Register B
|
|||||||
compare output mode for channel A and B respectivly. These are controlled with
|
compare output mode for channel A and B respectivly. These are controlled with
|
||||||
2 bit combinations as shown below.
|
2 bit combinations as shown below.
|
||||||
|
|
||||||
NOTE These settings only apply to normal mode
|
NOTE These settings only apply to normal mode, and are on TTCR1A
|
||||||
|
|
||||||
| Bits | Description |
|
| Bits | Description |
|
||||||
----------------------
|
----------------------
|
||||||
@ -191,6 +190,8 @@ set when The input capture set by WGM to be used as the TOP value. Bits 2-0 are
|
|||||||
set when TCNT1 matches the value in OCR1B, OCR1A, when when TCNT1 overflows,
|
set when TCNT1 matches the value in OCR1B, OCR1A, when when TCNT1 overflows,
|
||||||
respectivly.
|
respectivly.
|
||||||
|
|
||||||
|
==== Prescaler ====
|
||||||
|
|
||||||
To make the clock useful, the following will be an example of how to use Timer
|
To make the clock useful, the following will be an example of how to use Timer
|
||||||
1 to delay a certain amount of time. You will need the following information
|
1 to delay a certain amount of time. You will need the following information
|
||||||
|
|
||||||
@ -203,3 +204,16 @@ the desired freqency. Be sure that the value is smaller than the max timer
|
|||||||
value. If it is to large, choose a larger prescaler. Then place this in the
|
value. If it is to large, choose a larger prescaler. Then place this in the
|
||||||
OCR** Register and enable the desired interrupt.
|
OCR** Register and enable the desired interrupt.
|
||||||
|
|
||||||
|
To assist in finding the correct value, below are the values of the clock speed
|
||||||
|
(16Mhz) over the prescalers.
|
||||||
|
|
||||||
|
NOTE to help with calculations, 0xFFFF is 65536 and 0xFF is 256
|
||||||
|
|
||||||
|
| prescaler | value |
|
||||||
|
---------------------
|
||||||
|
| 8 | 2000000 |
|
||||||
|
| 64 | 250000 |
|
||||||
|
| 256 | 62500 |
|
||||||
|
| 1024 | 15625 |
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user