This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;assembly version of Cylon Eyes p.60 | |
;compile with gavrasm cylonEyes.asm | |
; | |
;--- set up --- | |
.device atmega168 | |
.cseg | |
.org 0 | |
.def delayH =r25 | |
.def delayL =r24 | |
.def led =r16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;showingOffBits assembly version | |
; | |
;compile with gavrasm showBits.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.XXXXXXX -b 19200 -U flash:w:showBits.hex | |
;--- set up --- | |
.device atmega168 | |
.cseg | |
.org 0 | |
.def delayH =r25 | |
.def delayL =r24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;serial io echo program from AVR Programming p.81 by Elliot Williams | |
;help from T. Margush Some Assembly Required | |
;compile with gavrasm serial_assembly.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.XXXXXXX -b 19200 -U flash:w:serial_assembly.hex | |
; | |
; cpu_f = 1,000,000 baud = 9600 use 2x(USX0 = 1) | |
;Programmer: Me | |
;2 mhz clock speed, 9600 baud UBBR = 12 | |
.equ UBBRvalue = 12 | |
.equ UCSR0C = 0xc2 ; SRAM address of UCSR0C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;serial io echo program from AVR Programming p.81 by Elliot Williams | |
;help from T. Margush Some Assembly Required | |
;compile with gavrasm serial_assembly.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:serial_assembly.hex | |
; | |
; cpu_f = 1,000,000 baud = 9600 use 2x(USX0 = 1) | |
;Programmer: Me | |
;2 mhz clock speed, 9600 baud UBBR = 12 | |
.equ UBBRvalue = 12 | |
.equ UCSR0C = 0xc2 ; SRAM address of UCSR0C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Serial Organ program p.100 | |
;compile with gavrasm organAssembly.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:organAssembly.hex; | |
;USART configure: 2x 1Mhz clock speed, 9600 baud UBBR = 12 | |
.equ UBBRvalue = 12 | |
.def temp = r16 | |
.def zL = r30 | |
.def zH = r31 ;not defined | |
.def byte_tx = r18 | |
.def inB = r20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;example program using debouncing | |
;from AVR Programming by Elliot Williams p.115 | |
; | |
;compile with gavrasm debouncer.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:debouncer.hex | |
; | |
.def temp = r16 | |
.device atmega168 | |
;--- inits --- | |
.def b_pressed = r17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Light Meter assembly version | |
;based on E.Williams AVR Programming lightSensor.c p.135 | |
;compile with gavrasm lightMeter.asm | |
; | |
.device atmega 168 | |
.cseg | |
.org 0 | |
.def temp = r16 | |
;--- Inits --- | |
ldi temp,0xff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Night Light program from p.148 | |
; | |
;example program using adc, mux, and sram variable storage | |
; | |
;compile with gavrasm serial_assembly.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:serial_assembly.hex | |
; | |
;program to utilize adc mux | |
.device atmega 168 | |
rjmp start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Interrupt 0 Example | |
; Flashes LED0 at a fixed rate, interrupting whenever button is pressed | |
; | |
.device atmega 168 | |
.def temp = r16 | |
.def temp2 = r17 | |
.org 0 | |
; | |
;Interrupt Vector Table | |
jmp reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Capacitive sensor demo in avr assembly | |
;compile with gavrasm capSense.asm | |
;flash with avrdude -c avrisp -p m168 -P /dev/tty.usbmodem1411 -b 19200 -U flash:w:capSense.hex | |
; | |
; | |
;what I learned from this program: | |
; always save the status reg when using interrupts | |
; and use the right jump vector for interrupt calls | |
; and keep track of registers used in subroutines | |
; |
OlderNewer