Commit ab6a4621223a41a40105d5fc1a134456094dc9e1
1 parent
200026c1
Ajout de l'init du CAN et début de la fonction
Showing
1 changed file
with
40 additions
and
5 deletions
Show diff stats
Algorithme
... | ... | @@ -2,18 +2,42 @@ |
2 | 2 | |
3 | 3 | ;Initialisation |
4 | 4 | |
5 | -0x0000: | |
5 | +.equ RAMEND = 0x21FF | |
6 | +.equ SPH = 0x3E | |
7 | +.equ SPL = 0x3D | |
8 | + | |
9 | +.equ ADMUX = 0x7C | |
10 | +.equ ADCSRB = 0x7B | |
11 | +.equ ADCSRA = 0x7A | |
12 | +.equ ADCL = 0x78 | |
13 | +.equ ADCH = 0x79 | |
14 | + | |
15 | + | |
16 | + | |
17 | + | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | + | |
23 | + | |
24 | +.org 0x0000: | |
6 | 25 | JMP debut |
7 | 26 | |
8 | -0x0002: | |
27 | +.org 0x0002: | |
9 | 28 | JMP HMJN |
10 | 29 | |
11 | -0x0004: | |
30 | +.org 0x0004: | |
12 | 31 | JMP MH |
32 | + | |
33 | +.org 0x0006: | |
34 | + JMP CAN | |
13 | 35 | |
14 | -0x002E: | |
36 | +.org 0x002E: | |
15 | 37 | JMP inc_heure |
16 | 38 | |
39 | + | |
40 | + | |
17 | 41 | debut: |
18 | 42 | DDRA = 0x07 |
19 | 43 | DDRB = 0xFF |
... | ... | @@ -23,6 +47,10 @@ debut: |
23 | 47 | EIMSK = 0x037 |
24 | 48 | EICRA = 0x06 |
25 | 49 | EICRB = 0x00 |
50 | + LDI R28, low(RAMEND) | |
51 | + LDI R29, high(RAMEND) | |
52 | + OUT SPL, R28 | |
53 | + OUT SPH, R29 | |
26 | 54 | ADMUX <- 0b00010000 |
27 | 55 | ADCSRB <- 0b00000000 |
28 | 56 | ADCSRA <- 0b11100101 |
... | ... | @@ -169,7 +197,7 @@ MH: |
169 | 197 | reglage: |
170 | 198 | H_reglage_jour=Heure_jour[Jour]:Minute_jour[Jour]; |
171 | 199 | H_reglage_nuit=Heure_nuit[Jour]:Minute_nuit[Jour]; |
172 | - T=capteur ;Lecture de la valeur du capteur de température | |
200 | + CALL CAN ;Lecture de la valeur du capteur de température | |
173 | 201 | if(Heure:Minute<H_reglage_jour || Heure:Minute>H_reglage_nuit) |
174 | 202 | if(T_nuit-T>0.5 && !chauffe) |
175 | 203 | demarrage chaudiere ;Démarrage de la chaudière |
... | ... | @@ -186,6 +214,13 @@ reglage: |
186 | 214 | chauffe=0 |
187 | 215 | RET |
188 | 216 | |
217 | + | |
218 | +CAN: | |
219 | + T = ADCH | |
220 | + | |
221 | + | |
222 | + | |
223 | + | |
189 | 224 | inc_heure: |
190 | 225 | Top_seconde=Top_seconde+1 |
191 | 226 | if(Top_seconde==250) | ... | ... |