| 1 |
; generates a ramp waveform on R-2R DAC connected to port B |
| 2 |
#include <avr/io.h> |
| 3 |
|
| 4 |
.section .text |
| 5 |
.global main |
| 6 |
main: |
| 7 |
ldi r16, 255 |
| 8 |
sts DDRB, r16 ; all bits of DDRB set |
| 9 |
loop: |
| 10 |
inc r1 |
| 11 |
sts PORTB, r1 ; R1 to PORTB. LEDs |
| 12 |
rjmp loop |
| 13 |
.end |