Skip to content

Instantly share code, notes, and snippets.

Bob Burns BobBurns

Block or report user

Report or block BobBurns

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BobBurns
BobBurns / cylonEyes.asm
Created Nov 13, 2014
assembly version of cylon eyes from Elliot Williams AVR Programming
View cylonEyes.asm
;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
@BobBurns
BobBurns / showBits.asm
Created Nov 14, 2014
another assembly version of Elliot Williams AVR Programming. Chapter 4
View showBits.asm
;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
@BobBurns
BobBurns / serial_assembly.asm
Created Nov 14, 2014
serialLoopback.c program from Elliot Williams AVR Programming written in avr assembly
View serial_assembly.asm
;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
@BobBurns
BobBurns / serial_assembly2.asm
Created Nov 15, 2014
Hello World - even better version of serial_assembly.asm
View serial_assembly2.asm
;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
@BobBurns
BobBurns / organAssembly.asm
Created Nov 18, 2014
AVR assembly program to toggle a speaker from USART serial connection. Based on serialOrgan.c from E.Williams AVR Programming p.100
View organAssembly.asm
;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
@BobBurns
BobBurns / debouncer.asm
Created Nov 20, 2014
AVR Assembly simple debouncer
View debouncer.asm
;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
@BobBurns
BobBurns / lightMeter.asm
Created Nov 21, 2014
light metering program in avr assembly
View lightMeter.asm
;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
@BobBurns
BobBurns / lightLight.asm
Created Nov 22, 2014
AVR Assembly program using adc, the multiplexer, and sram for variable data
View lightLight.asm
;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
@BobBurns
BobBurns / helloInterrupt.asm
Created Nov 22, 2014
AVR Interrupts. Assembly version of Elliot Williams helloInterrupts.c
View helloInterrupt.asm
;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
@BobBurns
BobBurns / capSense.asm
Created Nov 27, 2014
example program using pin change interrupts from AVR Programming by Elliot Williams
View capSense.asm
;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
;
You can’t perform that action at this time.