Advertisement
sunu

test.s attiny2313

Oct 22nd, 2013
155
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;test uji ATMEL AVR ATtiny2313 mode NORMAL wave gen toggle
  2. ;test.s
  3. ;reset; avra test.s ;avrdude -c usbasp -p t2313 -v -U flash:w:test.s.hex
  4. ;reset; avra test.s ;avrdude -c usbasp -p t2313 -F -u -U flash:w:test.s.hex -v
  5.  
  6.  
  7.  
  8. .nolist
  9. .include "tn2313def.inc"
  10. .list
  11.     rjmp    main
  12. main:
  13.     SBI     DDRB,3
  14.     SBI     DDRB,4
  15.     SBI     DDRB,5
  16.  
  17.         ;ldi r16, 0xFF      
  18.         ;out DDRB, r16
  19.    
  20.     CBI PORTB,5
  21.    
  22.     LDI R22,0x50
  23.     ;LDI    R22,0x40
  24.     OUT TCCR1A,R22
  25.     LDI R22,0x01   
  26.     OUT TCCR1B,R22
  27.  
  28.     LDI R22,HIGH(200)  
  29.     OUT OCR1AH,R22
  30.     LDI R22,LOW(200)   
  31.     OUT OCR1AL,R22
  32.  
  33.     LDI R22,HIGH(0)
  34.     OUT OCR1BH,R22
  35.     LDI R22,LOW(0) 
  36.     OUT OCR1BL,R22
  37. HERE:   RJMP    HERE
Advertisement
RAW Paste Data Copied
Advertisement