Advertisement
RuiViana

PLL NEW REduzido

Aug 24th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.75 KB | None | 0 0
  1. ; Ladeni SAA1057 s PIC16F84
  2. ; -------------------------
  3. ; (C) 1999-2001 Piratske radio - www.pira.cz
  4. ;
  5. ; Verze 5 - opakovany upload v danem intervalu
  6. ; Pro assembler MPASM - www.microchip.com
  7. ;
  8. ; Zapojeni: DAT 3 (OUT)
  9. ; DLEN 2 (OUT) TUNED 18 (OUT)
  10. ; CLB 1 (OUT) jumpery 6-13 (IN)
  11.  
  12. LIST P=PIC16F84A
  13. #include <p16F84a.inc>
  14. __CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _RC_OSC
  15.  
  16. DAT EQU 4
  17. DLEN EQU 3
  18. CLB EQU 2
  19. TUNED EQU 1
  20. PORTA EQU 5
  21. PORTB EQU 6
  22. COUNT EQU 0Ch
  23. WORKA EQU 0Dh
  24. WORKB EQU 0Eh
  25. CNT1 EQU 0Fh
  26. CNT2 EQU 10h
  27. CNT3 EQU 11h
  28. TRISA EQU 85h
  29. STATUS EQU 3
  30. OPT EQU 81h
  31. W EQU 0
  32. f EQU 1
  33. C EQU 0
  34. Z EQU 2
  35.  
  36. CLRWDT
  37. BCF PORTA,TUNED
  38. BSF STATUS,5
  39. CLRF TRISA
  40. MOVLW B'01111111'
  41. MOVWF OPT ;pull-ups and WDT on
  42. BCF STATUS,5
  43.  
  44. START CLRWDT
  45. CLRF PORTA
  46. CLRF COUNT
  47. MOVLW B'00100000'
  48. MOVWF WORKA
  49. MOVLW B'00111010'
  50. MOVWF WORKB
  51. SOUCET CLRWDT
  52. MOVF PORTB,W
  53. BCF STATUS,C
  54. ADDWF WORKB,f
  55. BTFSC STATUS,C
  56. INCF WORKA
  57. INCF COUNT
  58. MOVLW 0Ah
  59. SUBWF COUNT,W
  60. BTFSS STATUS,Z
  61. GOTO SOUCET
  62. MOVLW 0xFF
  63. MOVWF COUNT
  64.  
  65. ZNOVA CLRWDT
  66. CALL PULS
  67. CALL PULS
  68. CALL PULS
  69. CALL PULS
  70. CALL PULS
  71. CALL PULS
  72. CALL PULS
  73. CALL PULS
  74. CALL PULS
  75. CALL PULS
  76. CALL PULS
  77. CALL PULS
  78. CALL PULS
  79. CALL PULS ;14 PULZU NA CLB
  80. BCF PORTA,DAT
  81. BSF PORTA,DLEN ;DLEN 1
  82. CALL PULS ;0
  83. BSF PORTA,DAT
  84. CALL PULS ;1
  85. CALL PULS ;2
  86. BCF PORTA,DAT
  87. CALL PULS ;3
  88. BSF PORTA,DAT
  89. CALL PULS ;4
  90. CALL PULS ;5
  91. CALL PULS ;6
  92. BCF PORTA,DAT
  93. CALL PULS ;7
  94. BSF PORTA,DAT
  95. CALL PULS ;8
  96. BTFSS COUNT,7
  97. BSF PORTA,DAT
  98. BTFSC COUNT,7
  99. BCF PORTA,DAT
  100. CALL PULS ;9
  101. BCF PORTA,DAT
  102. CALL PULS ;10
  103. CALL PULS ;11
  104. CALL PULS ;12
  105. CALL PULS ;13
  106. BSF PORTA,DAT
  107. CALL PULS ;14
  108. BCF PORTA,DAT
  109. CALL PULS ;15
  110. BSF PORTA,DAT
  111. CALL PULS ;16
  112. BCF PORTA,DAT
  113. BCF PORTA,DLEN
  114. CALL PULS
  115. NOP
  116. NOP
  117. NOP
  118. BSF PORTA,DLEN
  119. CALL PULS ;0
  120. CALL PULS ;1
  121. CALL PULS ;2
  122. BSF PORTA,DAT
  123. CALL PULS ;3
  124. BCF PORTA,DAT
  125. CALL PULS ;4
  126. BTFSS WORKA,3
  127. BCF PORTA,DAT
  128. BTFSC WORKA,3
  129. BSF PORTA,DAT
  130. CALL PULS ;5
  131. BTFSS WORKA,2
  132. BCF PORTA,DAT
  133. BTFSC WORKA,2
  134. BSF PORTA,DAT
  135. CALL PULS ;6
  136. BTFSS WORKA,1
  137. BCF PORTA,DAT
  138. BTFSC WORKA,1
  139. BSF PORTA,DAT
  140. CALL PULS ;7
  141. BTFSS WORKA,0
  142. BCF PORTA,DAT
  143. BTFSC WORKA,0
  144. BSF PORTA,DAT
  145. CALL PULS ;8
  146. BTFSS WORKB,7
  147. BCF PORTA,DAT
  148. BTFSC WORKB,7
  149. BSF PORTA,DAT
  150. CALL PULS ;9
  151. BTFSS WORKB,6
  152. BCF PORTA,DAT
  153. BTFSC WORKB,6
  154. BSF PORTA,DAT
  155. CALL PULS ;10
  156. BTFSS WORKB,5
  157. BCF PORTA,DAT
  158. BTFSC WORKB,5
  159. BSF PORTA,DAT
  160. CALL PULS ;11
  161. BTFSS WORKB,4
  162. BCF PORTA,DAT
  163. BTFSC WORKB,4
  164. BSF PORTA,DAT
  165. CALL PULS ;12
  166. BTFSS WORKB,3
  167. BCF PORTA,DAT
  168. BTFSC WORKB,3
  169. BSF PORTA,DAT
  170. CALL PULS ;13
  171. BTFSS WORKB,2
  172. BCF PORTA,DAT
  173. BTFSC WORKB,2
  174. BSF PORTA,DAT
  175. CALL PULS ;14
  176. BTFSS WORKB,1
  177. BCF PORTA,DAT
  178. BTFSC WORKB,1
  179. BSF PORTA,DAT
  180. CALL PULS ;15
  181. BCF PORTA,DAT
  182. CALL PULS ;16
  183. BCF PORTA,DLEN
  184. CALL PULS
  185. INCF COUNT
  186. NOP
  187. NOP
  188. NOP
  189. BTFSS COUNT,3
  190. GOTO ZNOVA
  191. BSF PORTA,DLEN ;DLEN 1
  192. CALL PULS ;0
  193. BSF PORTA,DAT
  194. CALL PULS ;1
  195. CALL PULS ;2
  196. BCF PORTA,DAT
  197. CALL PULS ;3
  198. CALL PULS ;4
  199. CALL PULS ;5
  200. CALL PULS ;6
  201. BSF PORTA,DAT
  202. CALL PULS ;7
  203. CALL PULS ;8
  204. CALL PULS ;9
  205. BCF PORTA,DAT
  206. CALL PULS ;10
  207. CALL PULS ;11
  208. CALL PULS ;12
  209. CALL PULS ;13
  210. BSF PORTA,DAT
  211. CALL PULS ;14
  212. BCF PORTA,DAT
  213. CALL PULS ;15
  214. BSF PORTA,DAT
  215. CALL PULS ;16
  216. BCF PORTA,DAT
  217. BCF PORTA,DLEN
  218. CALL PULS
  219. NOP
  220. NOP
  221. NOP
  222. BSF PORTA,DLEN
  223. CALL PULS ;0
  224. CALL PULS ;1
  225. CALL PULS ;2
  226. BSF PORTA,DAT
  227. CALL PULS ;3
  228. BCF PORTA,DAT
  229. CALL PULS ;4
  230. BTFSS WORKA,3
  231. BCF PORTA,DAT
  232. BTFSC WORKA,3
  233. BSF PORTA,DAT
  234. CALL PULS ;5
  235. BTFSS WORKA,2
  236. BCF PORTA,DAT
  237. BTFSC WORKA,2
  238. BSF PORTA,DAT
  239. CALL PULS ;6
  240. BTFSS WORKA,1
  241. BCF PORTA,DAT
  242. BTFSC WORKA,1
  243. BSF PORTA,DAT
  244. CALL PULS ;7
  245. BTFSS WORKA,0
  246. BCF PORTA,DAT
  247. BTFSC WORKA,0
  248. BSF PORTA,DAT
  249. CALL PULS ;8
  250. BTFSS WORKB,7
  251. BCF PORTA,DAT
  252. BTFSC WORKB,7
  253. BSF PORTA,DAT
  254. CALL PULS ;9
  255. BTFSS WORKB,6
  256. BCF PORTA,DAT
  257. BTFSC WORKB,6
  258. BSF PORTA,DAT
  259. CALL PULS ;10
  260. BTFSS WORKB,5
  261. BCF PORTA,DAT
  262. BTFSC WORKB,5
  263. BSF PORTA,DAT
  264. CALL PULS ;11
  265. BTFSS WORKB,4
  266. BCF PORTA,DAT
  267. BTFSC WORKB,4
  268. BSF PORTA,DAT
  269. CALL PULS ;12
  270. BTFSS WORKB,3
  271. BCF PORTA,DAT
  272. BTFSC WORKB,3
  273. BSF PORTA,DAT
  274. CALL PULS ;13
  275. BTFSS WORKB,2
  276. BCF PORTA,DAT
  277. BTFSC WORKB,2
  278. BSF PORTA,DAT
  279. CALL PULS ;14
  280. BTFSS WORKB,1
  281. BCF PORTA,DAT
  282. BTFSC WORKB,1
  283. BSF PORTA,DAT
  284. CALL PULS ;15
  285. BCF PORTA,DAT
  286. CALL PULS ;16
  287. BCF PORTA,DLEN
  288. CALL PULS
  289. CLRF CNT1
  290. CLRF CNT2
  291. CLRF CNT3
  292. CEKANI CLRWDT
  293. INCF CNT1
  294. BTFSS STATUS,Z
  295. GOTO CEKANI2
  296. INCF CNT2
  297. BTFSC CNT2,5
  298. INCF CNT3
  299. CEKANI2 BTFSS CNT3,0
  300. GOTO CEKANI
  301. LOOP CLRWDT
  302. BSF PORTA,TUNED
  303. GOTO LOOP
  304.  
  305. PULS BSF PORTA,CLB
  306. BCF PORTA,CLB
  307. RETURN
  308.  
  309. END
  310.  
  311. CONFIG B'11111111111111'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement