User:Frosti/Sensors, Actuators, and Displays: Difference between revisions

From Fab Lab Wiki - by NMÍ Kvikan
Jump to navigation Jump to search
avr test
No edit summary
Line 9: Line 9:
Then I tried to use Inkscape to  
Then I tried to use Inkscape to  


[[Image:Step speaker test.png|thumb|500 px|left]]
[[Image:Step speaker test.png|thumb|200 px]]


==AVR ==
==AVR ==
Line 25: Line 25:


  include "tn44def.inc";
  include "tn44def.inc";
  sbi DDRA, 0;
  sbi DDRA, 0;
  ldi R18, 10;
  ldi R18, 10;
Line 38: Line 37:
  Loop3:
  Loop3:
  dec R19;
  dec R19;
brne Loop3
brne Loop3
  dec R18;
  dec R18;
  brne LoopA;
  brne LoopA;


*Build and Run
*Build and Run

Revision as of 14:28, 29 March 2010

Hello Speaker and Hello Step I decided to try to start making the board, by drawing it in Eagle.

First I drew hello.speaker.45.MTA.

Then I tried to use Inkscape to

AVR

  • SBI -> Set Bit in I/O Register
  • CBI -> Clear Bit in I/O Register
  • LDI -> Load Immediate
  • BRNE-> Branch if Not Equal

First we made some experiments

  • Open AVR studio
  • File New Project
  • Write .asm code
include "tn44def.inc";
sbi DDRA, 0;
ldi R18, 10;
LoopA:
	sbi PORTA, 0;
	ldi R19, 15; 
	Loop2:
		dec R19;
		brne Loop2;
		cbi PORTA, 0;
		ldi R19, 20;
		Loop3:
			dec R19;
			brne Loop3
  	dec R18;
  	brne LoopA;
  • Build and Run
  • Step into


Links