Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Test 01: Ports definieren, keinen Ausgang schalten -> LEDs aus
- 'Test 02: Eine LED schalten -> keine Probleme
- 'Test 03: LED ein/ausschalten (1-500ms) -> keine Probleme
- 'Test 04: Mosfets durchschalten, 1 LED ein (500ms) -> keine Probleme
- 'Test 04B: Zeit beschleunigen ->! MITLEUCHTEN ab ca. 5 ms
- '
- $regfile = "m644pdef.dat"
- $crystal = 14745600
- Ddra = &B00000111 'Ein-Ausgaenge [kannst auch alle auf 1=output stellen]
- Ddrb = &B11111111 'alle auf output [OK]
- Ddrc = &B11111111 'alle auf output [OK]
- Ddrd = &B00000010 'reserviert fΓΌr taster bis auf einen pin?
- 'PORTA.0: Latch Enable ROT
- 'PORTA.1: Latch Enable GRUEN
- 'PORTA.2: Latch Enable BLAU
- ' rest: NC
- 'PORTB.0..7: Gate Mosfet 1..8
- 'PORTC.0..7: Latch Data Input 1..8 (Reihen)
- 'PORTD : -nicht belegt-
- 'Hauptprogramm:
- Do
- Portc.0 = 1 ' Reihe1 an
- Waitus 50
- Porta.0 = 1 ' Enable ROT
- Waitus 50
- Porta.0 = 0 ' Disable ROT
- Waitus 50
- Portb.0 = 1 ' Enable Mosfet1
- Waitus 50
- Portc = 0 ' Reihe1..8 aus
- Waitms 5 ' Leuchten
- Portb.0 = 0 ' Disable Mosfet1
- Waitus 50
- 'Portc.0 = 1 'Reihe 1 an
- Porta.0 = 1 ' Enable ROT
- Waitus 50
- Porta.0 = 0 ' Disable ROT
- Waitus 50
- Portb.1 = 1 ' Enable Mosfet2
- Waitus 50
- Portc = 0 ' Reihe1...8 aus
- Waitms 5 ' Leuchten
- Portb.1 = 0 ' Disable Mosfet2
- Waitus 50
- Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement