File: ramp-on-R2RDAC.S

package info (click to toggle)
kuttypy 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,896 kB
  • sloc: python: 58,651; javascript: 14,686; xml: 5,767; ansic: 2,716; makefile: 453; asm: 254; sh: 48
file content (13 lines) | stat: -rw-r--r-- 333 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
; generates a ramp waveform on R-2R DAC connected to port B
#include <avr/io.h>

     .section .text   
     .global main                           
main: 	
     ldi   r16, 255
     sts  DDRB, r16       ; all bits of DDRB set
loop:  
      inc	r1                 
      sts PORTB, r1   ; R1 to PORTB. LEDs
      rjmp loop
      .end