Hallo,
ich bins mal wieder :) ich hab mich gerade mit dem Beispiel aus dem ADC
Tutorial
beschäftigt(http://www.mikrocontroller.net/articles/AVR-Tutorial:_ADC#Ausgabe_als_ADC-Wert),
aber ich komm da einfach nicht weiter...
Ich hab das so angeschlossen wie auf dem Schaltbild und wenn ich starte
dann bekomm ich nur 000 angezeigt :(
1
.include "m8def.inc"
2
3
.def temp1 = r16
4
.def temp2 = r17
5
.def temp3 = r18
6
.def temp4 = r19
7
.def adlow = r20
8
.def adhigh = r21
9
.def messungen = r22
10
.def ztausend = r23
11
.def tausend = r24
12
.def hundert = r25
13
.def zehner = r26
14
.def zeichen = r27
15
16
.equ F_CPU = 4000000
17
.equ BAUD = 9600
18
19
.equ UBRR_VAL = ((F_CPU+BAUD*8)/(BAUD*16)-1)
20
.equ BAUD_REAL = (F_CPU/(16*(UBRR_VAL+1)))
21
.equ BAUD_ERROR = ((BAUD_REAL*1000)/BAUD-1000)
22
23
.if ((BAUD_ERROR>10) || (BAUD_ERROR<-10))
24
.error "Systematischer Fehler der Baudrate grösser 1 Prozent und damit zu hoch!"
25
.endif
26
27
; Stackpointer Initalisierung
28
29
ldi temp1, LOW(RAMEND)
30
out SPL, temp1
31
ldi temp1, HIGH(RAMEND)
32
out SPH, temp1
33
34
; UART Initalsierung
35
36
ldi temp1, LOW(UBRR_VAL)
37
out UBRRL, temp1
38
ldi temp1, HIGH(UBRR_VAL)
39
out UBRRH, temp1
40
41
sbi UCSRB, TXEN
42
43
; ADC initialiesieren: Single Conversion, Vorteiler 128