Oki hosi, uz bezi, len s tym problemom, ze ked sa prekroci urcita hodnota myslim ze je to 255, tak zmrzne, ostanu svietit ledky a ani ho nehne,… mam tam toto: [code]LIST P=16F88
#include <p16f88.inc>
TMP0 EQU 21h
_INTOSC_OSC_NOCLKOUT EQU H’3FFC’
ORG 0x2007 ; adresa konfiguracie PIC16F88
DW _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _INTRC_IO
ORG 0
GOTO START
ORG 4
GOTO START
START
BANKSEL STATUS
CLRF STATUS
BANKSEL OSCCON
BSF OSCCON,IRCF2 ;KMITOCET 8 Mhz
BSF OSCCON,IRCF1
BSF OSCCON,IRCF0
BANKSEL ANSEL
MOVLW B’00000001’ ;Pin RA0/AN0 analogovy vstup
MOVWF ANSEL
MOVLW B’00000000’
MOVWF OPTION_REG
BANKSEL ADRESL ;vymazanie registrov prevodu
CLRF ADRESL
BANKSEL ADRESH
CLRF ADRESH
BANKSEL TRISB
MOVLW B’00000000’
MOVWF TRISB ;B-port ako vystupny
MOVLW B’10111111’
MOVWF TRISA
BANKSEL PORTB
CLRF PORTB
CLRF PORTA
BANKSEL ADCON1
MOVLW B’11000000’ ;radenie sprava, casovanie AD, AVdd-AVss
MOVWF ADCON1
BANKSEL ADCON0
MOVLW B’10000000’ ;FOSC/64, 000-1 vstup AD na AN0, stav 0, AD vypnuty
GOTO PROGRAM
PROGRAM
BANKSEL ADCON0
MOVWF ADCON0
BSF ADCON0,0 ;zapnutie AD prevodniku
CALL CEK40us ;cakanie na nabitie kondenzatora
BSF ADCON0,2
BTFSC ADCON0,2 ;cakanie na ukoncenie prevodu
GOTO $-1
BANKSEL ADRESL
MOVFW ADRESL ;Adresl do pracovneho reg.
BANKSEL PORTB
MOVWF PORTB ;Pracovny do portu B.
GOTO PROGRAM
CEK40us ;Delay 40 cycles
MOVLW .255
MOVWF TMP0
DECFSZ TMP0,F
GOTO $-1
RETURN
END[/code]