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.

158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197btfsc intcon,t0if ;TMR0 time out ?goto send ;Yes. "Pulse send";*************** Illegal interruption *****************illegalmovlw h'0b' ;Set Illegal disp digitaddwf seg7_ha,w ;Seg7 H.Adr + digitmovwf fsr ;Set FSR registermovfw indf ;Read seg7 datamovwf portb ;Write LED databcf porta,ra1 ;RA1=ONbcf porta,ra2 ;RA2=ONbcf porta,ra3 ;RA3=ONgoto $ ;Stop;************ END of Interruption Process **************int_endretfie;*************** Pulse send-out Process ****************sendbcf intcon,t0if ;Clear TMR0 int flagclrf tmr0 ;Timer0 clear;*** Received Pulse detection checkmovfw portc ;Read PORTC registerbtfsc portc,ccp1 ;Detected ?goto detect_off ;Yes. Detectedmovlw h'0a' ;"Detect error" datamovwf disp_u ;Set 1st digitmovwf disp_t ;Set 10th digitmovwf disp_h ;Set 100th digit;*** Receive pulse detector offdetect_offbcf porta,ra5 ;Set detector OFF;*** Capture startclrf tmr1h ;Clear TMR1H registerclrf tmr1l ;Clear TMR1L register69

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

Saved successfully!

Ooh no, something went wrong!