12.07.2015 Views

EK-6 - 320Volt

EK-6 - 320Volt

EK-6 - 320Volt

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

078079080081082083084085086087088089090091092093094095096097098099100101102103104105106107108109110111112113114115116117movwf trisc ;Set TRISC register;*** Ultrasonic sending period initialization (Timer0)movlw b'11010111' ;T0CS=0,PSA=0,PS=1:256movwf option_reg ;Set OPTION_REG registerbcf status,rp0 ;Change to Bank0clrf tmr0 ;Clear TMR0 register;*** Capture mode initialization (Timer1)movlw b'00000001' ;Pre=1:1 TMR1=Int TMR1=ONmovwf t1con ;Set T1CON registerclrf ccp1con ;CCP1 off;*** A/D converter initializationmovlw b'01000001' ;ADCS=01 CHS=AN0 ADON=ONmovwf adcon0 ;Set ADCON0 registerbsf status,rp0 ;Change to Bank1movlw b'00001110' ;ADFM=0 PCFG=1110movwf adcon1 ;Set ADCON1 registerbcf status,rp0 ;Change to Bank0;*** Display initialization (Timer2)movlw disp_u ;Set digit head addressmovwf disp_ha ;Save digit head sddressmovlw h'0a' ;"Detect error" datamovwf disp_u ;Set 1st digitmovwf disp_t ;Set 10th digitmovwf disp_h ;Set 100th digitmovlw d'3' ;Digit countermovwf digit_cnt ;Set digit countermovlw seg70 ;Set 7seg head addressmovwf seg7_ha ;Save 7seg head addressmovlw seg7_0 ;Set 7segment pattern 0movwf seg70 ;Save pattern 0movlw seg7_1 ;Set 7segment pattern 1movwf seg71 ;Save pattern 1movlw seg7_2 ;Set 7segment pattern 2movwf seg72 ;Save pattern 2movlw seg7_3 ;Set 7segment pattern 3movwf seg73 ;Save pattern 367

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!