Advertisement
Guest User

Untitled

a guest
Sep 9th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ nomod51
  2. $ include(AT89C51CC03.inc)
  3.  
  4. main:
  5. org 0000h
  6. ljmp haupt
  7.  
  8. org 001Bh ;Interrupt Zähler Timer 1 Übergelaufen
  9. ljmp inter
  10.  
  11. org 0050h ;Hauptprogramm
  12. haupt:
  13. mov sp,#80h ;Stack Pointer auf 80h, damit viel Unterprgramme laufen können, externer Register
  14. mov p1,00h ;Resonanzkonverter
  15. mov p2,00h ;Display
  16. mov p3,00h ;I2C Bus
  17. sda equ p3.0 ;I2C Bus
  18. scl equ p3.1 ;I2C Bus
  19. mov 20h,#0C8h ;Low Teil Führungsgröße 130 Grad
  20. mov 21h,#32h ;High Teil Führungsgröße 130 Grad
  21. mov tmod,#11h ;Timer 1 im Modus 1 / Timer 0 im Modus 1
  22. mov 30h,#0F6h ;Vorladewert Timer 0 50kHz
  23. mov 40h,#80h ;Low Teil maximale Regelgröße 160 Grad
  24. mov 41h,#3Eh ;High Teil maximale Regelgröße 160 Grad
  25. mov 50h,#00h ;Low Byte Regelgröße, für Display Ausgabe
  26. mov 51h,#00h ;High Byte Regelgröße, für Display Ausgabe
  27. mov 78h,#00h ;Low Byte Regelgröße
  28. mov 79h,#00h ;High Byte Regelgröße
  29. mov 7Ah,#00h ;Low Byte Regelgröße, für PWM SD Signal
  30. mov 7Bh,#00h ;High Byte Regelgröße, für PWM SD Signal
  31. mov R6,#0Fh ;Vorladewert Timer 1 1sek 15 Durchläufe
  32. mov tl1,#00h ;Interrupt Timer
  33. mov th1,#00h ;Interrupt Timer
  34.  
  35. lcall lcd_init ;Display Initalisierung
  36. setb ea  ;Interrupts freigeben
  37. setb et1 ;Interrupt Timer 1
  38. setb tr1
  39.  
  40. lcall PWM_Signal
  41. Ljmp $
  42. inter:
  43. lcall interrupt
  44. reti
  45.  
  46. $ include(Zeit_6us.a51)
  47. $ include(Start.a51)
  48. $ include(Adresse_befehl.a51)
  49. $ include(ACK_Adresse_Befehl.a51)
  50. $ include(Befehl.a51)
  51. $ include(ACK_befehl.a51)
  52. $ include(Neustart.a51)
  53. $ include(Adresse_auslesen.a51)
  54. $ include(ACK_Adresse_auslesen.a51)
  55. $ include(Zeit_1ms.a51)
  56. $ include(Byte_0_auslesen.a51)
  57. $ include(ACK_Byte0.a51)
  58. $ include(Byte_1_auslesen.a51)
  59. $ include(Stopp.a51)
  60. $ include(I2C_Bus.a51)
  61. $ include(Zeit_Display_Init.a51)
  62. $ include(lcd_init.a51)
  63. $ include(Bindez.a51)
  64. $ include(lcd_ausgabe.a51)
  65. $ include(Display.a51)
  66. $ include(Auswertung.a51)
  67. $ include(interrupt.a51)
  68. $ include(PWMSignal.a51)
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement