Moin,
ich habe heute ein ziemlich eigenartiges Problem mit dem internen
Pull-Up von PD1 eines mega16:
Der Widerstand zwischen GND und PD1 ist >2MOhm, aber die Spannung
beträgt am offenen Taster nur ca. 1V.
Ziehen des Pins gegen GND bringt nichts.
Ein externer Widerstand gegen VCC (Pullup) führt zu einer Reaktion.
Hier der komplette Code:
.include "m16def.inc"
.def tempL =r16
.def tempH =r17
; CPU
ldi tempL, (1<<JTD) ;disable JTAG
out MCUCSR, tempL
clr tempL
out SFIOR, tempL ;pull ups allowed
; Stack
ldi tempH,high(RAMEND)
ldi tempL,low(RAMEND)
out SPH,tempH
out SPL,tempL
; PortB
ldi tempL, 0b10110001
out DDRB, tempL
ldi tempL, 0b00000111
out PortB, tempL
; PortD
ldi tempL, 0b11110000
out DDRD, tempL
ldi tempL, 0b11001011
out PortD, tempL
loop:
sbic PinD, PD1
rjmp LEDon
sbi PortB, PB0
rjmp loop
LEDon:
cbi PortB, PB0
rjmp loop
Hat irgendjemand von Euch eine Idee?
Viele Grüße, Hendrik