I downloaded [AVR Data sheet for Attiny45] from [http://www.atmel.com/dyn/products/product_card.asp?PN=ATtiny45 Atmel]
==AVR ==
==AVR ==
Line 44:
Line 47:
*Step into
*Step into
==Alternate the code ==
Define variablbe.
.def sensor_pin = PB3 ; we call pin PB3 a sensor pin
def charge_pin = PB4 ; PB4 is our charge pin
.def sensor_value_high = R23 ; temporary storage for sensor value (here we store our sensor values (because we have 10 bit value, here we have the higher value)
.def sensor_value_low = R24 ; temporary storage for sensor value (here we store our sensor values (because we have 10 bit value, here we have the lower value)
Revision as of 11:02, 30 March 2010
Hello Speaker and Hello Step
I decided to try to start making the board, by drawing it in Eagle.
I downloaded and installed the Eagle Freeversion from Cad Soft USA
I downloaded [AVR Data sheet for Attiny45] from Atmel
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
Alternate the code
Define variablbe.
.def sensor_pin = PB3 ; we call pin PB3 a sensor pin
def charge_pin = PB4 ; PB4 is our charge pin
.def sensor_value_high = R23 ; temporary storage for sensor value (here we store our sensor values (because we have 10 bit value, here we have the higher value)
.def sensor_value_low = R24 ; temporary storage for sensor value (here we store our sensor values (because we have 10 bit value, here we have the lower value)