Second lab that I did in hackespace.
Assembly project created in Atmel Studio and flashed on Atmega16 on Pinboard2 Rev 2. It used one of the atmega timers, and port d to supply data into 7seg display.
Started with 8Mhz frequency for MCU and switched to 1Mhz
OCR1A — output control register for timer counter 1.
freq | dec | hex | fusebits (xHL) |
8 Mhz | 31250 | 0x7A12 | 0xE4D9 |
2 Mhz | 7813 | 0x1E85 | 0xE2D9 |
1 Mhz | 3907 | 0x0C19 | 0xE1D9 |
How to calculate:
- 256 / freq = x
- 1 / x = res
- Round and convert to hex