;**********************************************************
;* TUT452.ASM
;**********************************************************
;* Microchip Technology Incorporated
;* 17 March 2003
;* Assembled with MPASM V3.20 and MPLINK v3.20
;**********************************************************
;* This program configures the A/D Module to convert on
;* A/D channel 0 (the potentiometer) and display the
;* results on the LEDS on PORTB.
;**********************************************************

list p=18f14K50

; Include file, change directory if needed
include "p18f14K50.inc"


; Start at the reset vector
Reset_Vector code 0x000
goto Start

; Start application beyond vector area

code 0x002A
Start ;Regiszterek beállítása

movlw B'01100011' ;Belső oszcillátor, 8MHz, 18.oldal
movwf OSCCON

movlw B'00000100' ;19. oldal
movwf OSCCON2

movlw B'01011111' ;oscillator tuning, PLL engedélyezve, maximum frequency, 20. oldal
movwf OSCTUNE

movlw B'00000000' ;portc nullába állítása, 92. oldal
movwf PORTC

movlw B'00000000' ;portc output, 92. oldal
movwf TRISC

movlw B'00000000' ;93. oldal
movwf LATC

movlw B'00000000' ;bitek digitálisra állítva, 94. oldal
movwf ANSEL

movlw B'00000000' ;bitek digitálisra állítva, 95. oldal, RC6 -> bit0
movwf ANSELH

movlw B'00000100' ;103. oldal
movwf T1CON

movlw B'00001101' ;111. oldal
movwf T3CON

movlw B'00000000' ;139. oldal
movwf SSPCON1

movlw B'11000000' ;115. oldal
movwf CCP1CON

movlw B'00001111' ;127. oldal
movwf ECCP1AS

movlw B'00000000' ;131. oldal
movwf PSTRCON

movlw B'00000000' ;96. oldal
movwf SLRCON

movlw B'00000000' ;245. oldal
movwf REFCON1

movlw B'00000000' ;megszakítások letiltása, 67. oldal
movwf INTCON

movlw B'00000000' ;68. oldal
movwf INTCON2

movlw B'00000000' ;69. oldal
movwf INTCON3


Main
CIMKE: movlw B'11111111'
movwf LATC
GOTO CIMKE
end