From 88c493e6fa217e36649fc9236d3cb5d3cd6dc989 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 14 Jan 2007 19:37:44 +0000 Subject: [PATCH] added thermo app --- thermo/thermo.asm | 189 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 thermo/thermo.asm diff --git a/thermo/thermo.asm b/thermo/thermo.asm new file mode 100644 index 0000000..a66a491 --- /dev/null +++ b/thermo/thermo.asm @@ -0,0 +1,189 @@ +; +; thermo - getting temperature using analog comparator +; +; author: hackbard@hackdaworld.org +; + +; specify device +.include "../include/tn2313def.inc" + +; +; interrupts +; + +; RESET +rjmp INIT + +; INT0 +reti + +; INT1 +reti + +; T1 CAPT1 +rjmp T1_CAPTURE + +; T1 COMP A +reti + +; T1 OVF1 +reti + +; T0 OVF0 +reti + +; UART RX +reti + +; UART UDRE +reti + +; UART TX +reti + +; ANA COMP +reti + +; PCINT +reti + +; T1 COMP B +reti + +; T0 COMP A +reti + +; T0 COMP B +reti + +; USI START +reti + +; USI OVF +reti + +; EE READY +reti + +; WDT OVF +reti + +; +; init function +; + +INIT: + + ; stackpointer + ldi r16,low(RAMEND) + out SPL,r16 + + ; zero to register 0 + ldi r17,0 + mov r0,r17 + + ; uart init + UART_INIT: + + ldi r16,51 ; 9600 bps @ 8mhz + out UBRRL, r16 + out UBRRH, r0 + + ldi r16,(1<