Advertisement
Guest User

Untitled

a guest
Sep 17th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Test 01: Ports definieren, keinen Ausgang schalten         -> LEDs aus
  2. 'Test 02: Eine LED schalten                                 -> keine Probleme
  3. 'Test 03: LED ein/ausschalten (1-500ms)                     -> keine Probleme
  4. 'Test 04: Mosfets durchschalten, 1 LED ein (500ms)          -> keine Probleme
  5. 'Test 04B: Zeit beschleunigen                               ->! MITLEUCHTEN ab ca. 5 ms
  6. '
  7. $regfile = "m644pdef.dat"
  8. $crystal = 14745600
  9.  
  10. Ddra = &B00000111 'Ein-Ausgaenge [kannst auch alle auf 1=output stellen]
  11. Ddrb = &B11111111 'alle auf output [OK]
  12. Ddrc = &B11111111 'alle auf output [OK]
  13. Ddrd = &B00000010 'reserviert fΓΌr taster bis auf einen pin?
  14.  
  15. 'PORTA.0: Latch Enable ROT
  16. 'PORTA.1: Latch Enable GRUEN
  17. 'PORTA.2: Latch Enable BLAU
  18. ' rest: NC
  19. 'PORTB.0..7: Gate Mosfet 1..8
  20. 'PORTC.0..7: Latch Data Input 1..8 (Reihen)
  21. 'PORTD  : -nicht belegt-
  22.  
  23. 'Hauptprogramm:
  24. Do
  25.    Portc.0 = 1 ' Reihe1 an
  26.    Waitus 50
  27.    Porta.0 = 1 ' Enable ROT
  28.    Waitus 50
  29.    Porta.0 = 0 ' Disable ROT
  30.    Waitus 50
  31.    Portb.0 = 1 ' Enable Mosfet1
  32.    Waitus 50
  33.    Portc = 0   ' Reihe1..8 aus
  34.    Waitms 5    ' Leuchten
  35.    Portb.0 = 0 ' Disable Mosfet1
  36.    Waitus 50
  37.  
  38.    'Portc.0 = 1 'Reihe 1 an
  39.    Porta.0 = 1 ' Enable ROT
  40.    Waitus 50
  41.    Porta.0 = 0 ' Disable ROT
  42.    Waitus 50
  43.    Portb.1 = 1 ' Enable Mosfet2
  44.    Waitus 50
  45.    Portc = 0   ' Reihe1...8 aus
  46.    Waitms 5    ' Leuchten
  47.    Portb.1 = 0 ' Disable Mosfet2
  48.    Waitus 50
  49. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement