Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Programa Micro

Programa Micro

Ratings: (0)|Views: 4|Likes:
Uploaded from Google Docs
Uploaded from Google Docs

More info:

Published by: Jose Angel Alanis Villalon on Apr 21, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

11/19/2014

pdf

text

original

 
;***************************************************;***************************************************;*** SOFTWARE FOR WATER SOFTNER ****;***************************************************;*** VER 0.1 LAST UPDATE 09/12/96 ****;***************************************************;***************************************************; FOR 12C508 @ 4MHz WDOG ONLIST P=12C508,F=INHX8M;IMMEDIATE EQUATESPERIOD EQU 010H ;LENGTH OF TIME AT FREQLOW_FREQ EQU 0FFH ;653 HzHIGH_FREQ EQU 040H ;2577HzDIFFERENCE EQU LOW_FREQ - HIGH_FREQPERIOD_50HZ EQU 00 ;approx 5 secs of 50hzINADD EQU 00RTCC EQU 01PC EQU 02STATUS EQU 03FSR EQU 04CAL EQU 05GPIO EQU 06;BIT DEFINITIONS#DEFINE LED1 GPIO,04 ;RED LED#DEFINE DRIVE GPIO,00 ;TRANSISTOR DRIVE OUTPUT#DEFINE TEST_IN GPIO,03 ;COIL TEST INPUT#DEFINE C STATUS,0#DEFINE Z STATUS,2COUNT EQU 07H ;GENERAL RAM LOCATIONSCOUNT1 EQU 08HCOUNT2 EQU 09HCOUNT3 EQU 0AHTEMP EQU 0BHORG 00MOVWF CAL ;LOAD CAL VALUE INTO CAL REGGOTO CLDSTT;*****************************************************; SUBROUTINES;*****************************************************
 
LONG_DELAY;LONG DELAY TO LET THINGS SETTLE AFTER POWER UPMOVLW 000HGOTO DELAY0SHORT_DELAY;APPROX. 65mS DELAY FOR PULSING LEDMOVLW 040HDELAY0MOVWF COUNTCLRF COUNT1DELAY1CLRWDTDECFSZ COUNT1GOTO DELAY1DECFSZ COUNTGOTO DELAY1RETLW 0FFH;DELAY USED IN 50HZ ROUTINEDELAY_50HZMOVLW 0AHMOVWF COUNT1DELAY50MOVLW 0F8HMOVWF COUNTDELAY51CLRWDTDECFSZ COUNTGOTO DELAY51DECFSZ COUNT1GOTO DELAY50RETLW 0FFH COIL_ERROR;LED WILL STAY ON FOR 2 SECS UNTIL WDOG;RESETS THE PICBCF LED1BTFSS TEST_INGOTO COIL_ERRORRETLW 0FFH;PULSE LEDP_LED
 
BCF LED1CALL SHORT_DELAYCALL COIL_ERROR ;TEST COILBSF LED1RETLW 0FFH;ADD THE BUZZER ROUTINE IF REQUIRED;TO SIGNAL AN ERROR IN THE COILBEEPRETLW 0FFH CLDSTTCALL LONG_DELAY ;LET THE POWER SUPPLY SETTLE;WE SET THE TIMING INTERVAL UP HERESETUPMOVLW B'00001000' ;ONLY GP3 IS AN INPUTMOVWF GPIOTRIS GPIOCALL P_LED ;PULSE THE LED TO SHOW THAT WE ARE WORKINGMOVLW 026H ;WE USE THIS COUNTER TO COUNT THE NUMBER OF LOOPSMOVWF COUNT3 ;WE DO BEFORE GOING TO THE 50HZ LOOP(APPROX 1 MIN);THIS ROUTINE WILL GENERATE THE SWEPT TONE;IT ONLY SWEEPS UP IN FREQUENCE THEN ROLLS;OVER AND STARTS AGAIN;LOW_FREQ DEFINES THE START FREQ AND WE DEC;ONE FROM THIS VALUE TO GET A SHORTER PERIOD;AND SO A HIGHER FREQ;THE VALUE OF DIFFERENCE SETS THE UPPER FREQ;AND EQUALS THE LOW_FREQ - THE HIGH_FREQ;RUN SWEEP ROUTINESWEEPCLRWDT

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->