Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

* increment segment display

Assembly file 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.  It is important
to note, that in original solution frequency of 8MHz was used and on
avra version I will try to change it to 1Mhz. 8bit Timer/Counter1 was
used.

I plan to port this code from atmel studio to
traditional +emacs+ unix-like (+OpenBSD+ Gentoo) environment + plus switch to lower frequency
of MCU.

** Files
| File     | Description            |
| main.asm | File from Atmel studio |



** Table of MCU frequency, OCR1A value and fusebits for avrdude

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:
1. 256 / freq = x
2. 1 / x = res
3. Round and convert to hex
   
** Commands for avrdude

*** Write fusebits
=avrdude -c avrftdi -p m16 -P usb -Ulfuse:w:0xE1:m -U hfuse:w:0xD9:m=
(Command from windows/Atmel IDE project)

Calculated with [[https://www.engbedded.com/fusecalc/][fuse-calc]].

*** Flash MCU
=avrdude -c avrftdi -p m16 -P usb -U flash:w:file:a=

This command is from windows AVRDUDESS.
On OpenBSD see =/usr/local/share/doc/pkg_reamdes/avrdude=
for info on flashing.


About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages