Advertisement
Guest User

7-segment

a guest
Apr 24th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. setC:
  2. bcf status,6
  3. bsf status,5
  4. movlw 0xF0
  5. movwf trisc
  6. bcf status,5
  7. start0:
  8. bsf portc,0
  9. bcf portc,1
  10. bcf portc,2
  11.  
  12. btfsc portc,4
  13. goto key1
  14. btfsc portc,5
  15. goto key2
  16. btfsc portc,6
  17. goto key3
  18. btfsc portc,7
  19. goto key4
  20.  
  21. portc1:
  22. bsf portc,1
  23. bcf portc,0
  24. bcf portc,2
  25. btfsc portc,4
  26. goto key5
  27. btfsc portc,5
  28. goto key6
  29. btfsc portc,6
  30. goto key7
  31. btfsc portc,7
  32. goto key8
  33. portc2:
  34. bsf portc,2
  35. bcf portc,0
  36. bcf portc,1
  37.  
  38. btfsc portc,4
  39. goto key9
  40. btfsc portc,5
  41. goto key0
  42. call low
  43. goto start0
  44.  
  45. key1:
  46. bcf status,6
  47. bsf status,5
  48. movlw 0
  49. movwf trisb
  50. bcf status,5
  51.  
  52. movlw 0x6
  53. movwf portb
  54. goto start0
  55. key2:
  56. bcf status,6
  57. bsf status,5
  58. movlw 0
  59. movwf trisb
  60. bcf status,5
  61.  
  62. movlw 0x5B
  63. movwf portb
  64. goto start0
  65. key3:
  66. bcf status,6
  67. bsf status,5
  68. movlw 0
  69. movwf trisb
  70. bcf status,5
  71.  
  72. movlw 0x4F
  73. movwf portb
  74. goto start0
  75. key4:
  76. bcf status,6
  77. bsf status,5
  78. movlw 0
  79. movwf trisb
  80. bcf status,5
  81.  
  82. movlw 0x66
  83. movwf portb
  84. goto start0
  85. key5:
  86. bcf status,6
  87. bsf status,5
  88. movlw 0
  89. movwf trisb
  90. bcf status,5
  91.  
  92. movlw 0x6D
  93. movwf portb
  94. goto start0
  95. key6:
  96. bcf status,6
  97. bsf status,5
  98. movlw 0
  99. movwf trisb
  100. bcf status,5
  101.  
  102. movlw 0x7D
  103. movwf portb
  104. goto start0
  105. key7:
  106. bcf status,6
  107. bsf status,5
  108. movlw 0
  109. movwf trisb
  110. bcf status,5
  111.  
  112. movlw 0x7
  113. movwf portb
  114. goto start0
  115. key8:
  116. bcf status,6
  117. bsf status,5
  118. movlw 0
  119. movwf trisb
  120. bcf status,5
  121.  
  122. movlw 0x7F
  123. movwf portb
  124. goto start0
  125. key9:
  126. bcf status,6
  127. bsf status,5
  128. movlw 0
  129. movwf trisb
  130. bcf status,5
  131.  
  132. movlw 0x67
  133. movwf portb
  134. goto start0
  135. key0:
  136. bcf status,6
  137. bsf status,5
  138. movlw 0
  139. movwf trisb
  140. bcf status,5
  141.  
  142. movlw 0x3F
  143. movwf portb
  144. goto start0
  145. low:
  146. bcf status,6
  147. bsf status,5
  148. movlw 0
  149. movwf trisb
  150. bcf status,5
  151. movlw 0
  152. movwf portb
  153. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement