Production of off timer at 30 or 60 minutes that used PIC

The power supply of the turned-off television set worked in remote control, and it did not enter, and an off timer did not work without permission having of the microcomputer of the television that I was using in the bedroom trouble. Because the television was old, it was not possible to become a mended nature and the state as it is.

Production of off timer that uses PIC12F629

Because it had come to manage to use the PIC microcomputer, the off timer that was able to be used also for the television by holding the study of PIC concurrently was made. It introduces it because it made it to good. It made it with PIC microcomputer PIC12F629 by using the kit of solid-state relay (SSR) of moon Electronic commerce in autumn.

The Tera-Pad editor of free software made the program of the assembler of PIC. MPLAB IDE Ver.7.4 of the Microchip Co. and writing the PIC program handled AKI-PIC programmer Ver.4 in the moon to the PIC development tool in autumn.

Of course, the air conditioner can be able to use it besides the television because of the change in the radio, the radio-cassette, and time and changes of the cooling wheel. (2007.06.04)

Manufacturing methods of an off timer for 30 or 60 minutes

Schematic diagrams of an off timer for 30 or 60 minutes

Schematic diagrams of an off timer for 30 or 60 minutes

Notes of production and How to use.

PIC assembler program

To assume an accurate timer program with PIC

It introduces the device to make it to the timer at accurate time as much as possible. The program is made by the assembler.

It is 2mS. The error margin of the subroutine of 500mS about puts the subroutine call and is +5μS. Accuracy in the program is 1/100,000 or less.

  This is wrong though I assume the goto instruction to be one cycle written by Takao "Easy PIC microcomputer programming & electron construction" Takahashi of the Hidekazu system to which the program creation referred.

(PIC16F628 goto instruction is written one cycle on page 128. Moreover, it is an expression inarticulate when 250 though called 4μS*250=1000μS but 240 is set. If so, it will be 5μS*200=1000μS. )

(It is assumed 4*250=1000μS in the part where 1mS on page 248 in the article on the ramen timer (PIC12F629 is used) is made. Because the goto instructions are two cycles accurately, it is necessary to decrease one nop. )

As for PIC12F629 goto instruction, two cycles are correct. I see because of not becoming accurate time no matter how it experiments ..the examination thoroughly...

Moreover, it can make increasing cycle number by the first DLY_1 loop accurate time. It is because the error margin can be reduced because the loop frequency is limited within 256 because registers are eight bits in this if an error margin outside this loop is the same the time of the DLY_1 loop becomes long when cycle number is increased. Because this cycle number was assumed to be eight, it becomes 8*249=1992μS here in internal clock 4MHz because it is 1 one cycle = μS.

Next, the total of cycle bundled by ( ) in the first half number is 6μS when thinking about cycle when it makes a tour of DLY_2 number by six cycles. It becomes 2μS two cycles if eight cycles of an original DLY_1 part are excluded in the latter half. If the clock is accurate, it becomes accurate in total 2000μS.

DLY_500		;500mS
movlw	d'250'	;		2mS*250=500mS
movwf	CNT2	;
DLY_2	;2mS	;
movlw	d'249'	;	(1)
movwf	CNT1	;	(1)
nop		;	(1)
nop		;	(1)
nop		;	(1)
nop		;	(1)
DLY_1	;    DLY_1 loop
nop		;1	 1
nop		;1	 1
nop		;1	 1
nop		;1	 1
nop		;1	 1
decfsz	CNT1,f	;1	 2
goto	DLY_1	;2
decfsz	CNT2,f	;	 1
goto	DLY_2	;	(2)
return		;

Program of assembler of off timer

Assembler program for off timer

It is an assembler program that I made. Please make the file name timer30_60.asm etc. reading the editor the program part, preserve, and use it.

Completed substrate and peripherals

Completed substrate and peripherals

It is a wall adapter for the cellular phone charge for DC5V, and a timer substrate from the left from which everything used the SSR kit and PIC12F629 of the moon in autumn. It is a state before it encases it. The program of PIC is rewritten many times and IC socket is used to try.

When the timer is made from PIC12F629, an internal oscillation has hurried accuracy though you should use the selah lock or the crystal departure pendulum. Moreover, it is a charm that the circuit is very easy.