This is a screen shot of an AVR assembler program that turns PORTB's least significant bit on and off very quickly.
;
; AssemblerApplication4.asm
;
; Created: 17/05/2018 10:15:30 AM
; Author : peterb
;
; Set up stack pointer and turn PB0 on and off. No delay.
start:
out PORTB,r16
LDI R16, LOW(RAMEND)
OUT SPL, R16
LDI R16, HIGH(RAMEND)
OUT SPH, R16
;better make PB0 an output. Write a 1 into PB0 of DDRB.
clr r16
inc r16
out DDRB,r16
repeat:
clr r18
inc r18
rcall sendtob
clr r18
rcall sendtob
rjmp repeat
; the subroutine is below. Always ends with ret.
sendtob:
out PORTB, r18
ret
Wednesday, May 16, 2018
Subscribe to:
Post Comments (Atom)
A outline of what's in the test. The test will be in our normal classroom on Tuesday 19 June at 8:00 There will be a picture of...
-
This is a screen shot of an AVR assembler program that turns PORTB's least significant bit on and off very quickly. ; ; Assemble...
-
All AVR devices, like our Mega328, have ports. Usually they are a group of 8 pins that send or receive binary to or from the outside world. ...
-
View the differences in this page here. https://learn.sparkfun.com/tutorials/redboard-vs-uno

No comments:
Post a Comment