PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Mege16 hat an einigen Pins(z.B. PortC) immer 5V - Warum?



Papsi
07.09.2007, 12:47
Hallo,

irgendwie komisch, ich habe an einigen Pins immer 5V anliegen oder gar nichts, egal, was ich ihm für ein Zustand gebe.

Habe diesen Testaufbau auf meinem Steckbrett:
https://www.roboternetz.de/wissen/images/3/30/Avrtutorial_grundschaltung_mitquarz.gif

Und dazu diesen Code:

$regfile = "m16def.dat"
$crystal = 8000000

Config Pinc.0 = Output
Config Pinc.1 = Output
Config Pinc.2 = Output
Config Pinc.3 = Output
Config Pinc.4 = Output
Config Pinc.5 = Output
Config Pinc.6 = Output
Config Pinc.7 = Output

Do
Portc.0 = 1 '5V
Portc.1 = 1 '5V
Portc.2 = 1 '5V
Portc.3 = 1 '5V
Portc.4 = 1 '0V ***
Portc.5 = 1 '5V
Portc.6 = 1 '5V
Portc.7 = 1 '5V
Loop

Und den hier:

$regfile = "m16def.dat"
$crystal = 8000000

Config Pinc.0 = Output
Config Pinc.1 = Output
Config Pinc.2 = Output
Config Pinc.3 = Output
Config Pinc.4 = Output
Config Pinc.5 = Output
Config Pinc.6 = Output
Config Pinc.7 = Output

Do
Portc.0 = 0 '0V
Portc.1 = 0 '0V
Portc.2 = 0 '5V ***
Portc.3 = 0 '5V ***
Portc.4 = 0 '0V
Portc.5 = 0 '5V ***
Portc.6 = 0 '0V
Portc.7 = 0 '0V
Loop
Ich habe die komischen Zustände mal mit 3*** markiert.

Woran kann es liegen, das der Mega 16 so ein Quatsch macht.
Habe auch schon einen 2. Chip probiert, aber mit dem gleichen Ergebnis

Gruß
Papsi

Papsi
07.09.2007, 13:42
Hallo,

Habs selber rausgefunden...

Es war die JTAG Schnittstelle, die "ab Werk" aktiviert war

Jetzt läuft es, wie es sein soll