Hallo Zusammen,
mein erstes Programm läuft nicht.
Ich möchte mit einem Attiny13 ein Signal ausgeben.
Ausgabe auf Pin b4.
Der Puls ist 1ms.
Je nach Zustand von Pin b0 soll die Pause 5 oder 2 ms sein.
Es ist jedoch egal ob ich GND oder VCC an b0 anlege.
Die Pause ist immer 2ms
Warum?
'Target ATtiny13'
Code:$regfile = "ATtiny13.dat" 'der mit internen 9,6MHZ getaktet wird (Fuse Takt/8 nicht gesetzt!)' $crystal = 9600000 $hwstack = 32 $swstack = 8 $framesize = 8 'Dims ---------------------------------------------------------------------------' Dim Eingabe As Word Dim Puls As Word Dim Pause As Word Config Pinb.0 = Input Config Pinb.4 = Output Do If Portb.0 = 1 Then Pause = 5 Else If Portb.0 = 0 Then Pause = 2 End If End If Portb.4 = 1 Waitms 1 Portb.4 = 0 Waitms Pause Loop End







Zitieren

Lesezeichen