Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F877A John Becker home Alarm.

Status
Not open for further replies.

spr001

New Member
Hi All
I am totally new to all this so please give me a chance. In the past the most complicated thing I have had to deal with was Dolby Cinema sound processors and old valve cinema amps so PIC and programming is all new.

As I am now disabled I needed to find new hobby's and reinvent old ones so 6 months ago I started with electronics and PIC's. Having used the 16F877A for my midi organ I looked for an alarm using the same pic as I still had 5 left. when I found the John Becker one it was perfect. I know that this has been talk about back in 2008 but none of that has helped me so far. I built it up on the bread board, downloaded the program but no matter what I do I can not get it to work. I am using PikLab, picprog2009, the Velleman 8048. I have downloaded 3 asm file and the Hex file from EPE. I programmed the Hex file then read the pic and the Hex file from the pic is identical to the original. I have replaced the pic and the LCD but all I get is a blank LCD. I have tried other programs to check the pic and LCD and they worked fine.
I have added transistors and led's to the programmer board to monitor the data, clock and reset to the pic and it all looks fine.
I have one concerns, one, the crystal I am using is a 4Mhz and not the 3.286 as in the diagram.
Could this be the crystal or am I doing something totally stupid?
This alarm is perfect for my needs as I have 2 sheds and a workshop plus it has the panic button for when I fall.
Any help would be very much appreciated.
Steve :(
 
It is hard to give you any help with the information provided and what you are attempting.
First go over your circuit wire by wire to make sure you have it right.
Have you verified that the PIC has been programmed?

If that does not help post the schematic or a link to it. We can write you a little test program to blink an LED or such.

I have two suggestions for the future.

The first is to get a pickit3 from microchip for $45.

The second it to learn to program. You will get far more out of this hobby by doing so. There are a lot of details but nothing that is all that hard about it.
 
Quite possibly the crystal is causing the problem, in the article he states;

"The PIC is operated at 3·2768MHz, as
set by crystal X1. It is this rate which determines
the accuracy of the software clock
that controls the bell-on duration and
entry/exit timing. In order to comply with
the allocated timings, a different frequency
must not be used with this design."
 
Last edited:
Thank you all for you reply. How is Rochdale? I have not been there since 1974 when I worked at the Odeon.

This is the link to the EPE download for the Hex file. It is in Home > library > project codes > 2002 > April. **broken link removed**.

I did discover that John used his own code when I fist tried it as it just would not compile and I then noticed all the odd $ every where.. I then found an asm file which said it was a mod for MPLAB. This will compile but, I get this in the compile log :-
gpasm -c -I/home/spr/Pic Alarm/ -pp16f877a -w0 New Alarm.asm
New Alarm.asm:3: warning: Processor superseded by command line.
New Alarm.asm:17: error: Value of symbol "OPTION_REG" differs on second pass
pass 1=129, pass 2=1
New Alarm.asm:41: error: Value of symbol "EECON2" differs on second pass
pass 1=397, pass 2=13
*** Exited with status: 1 ***

I have been looking for the link to the site I downloaded it from but can not find it and I am not sure if I can attach or paste it to a reply here. Here is the schematic View attachment 67425

I am certain that the pic is programmed as I can read it back from the pic. As I said in the first post I compared the 2 and there was no difference.
I have programmed the same pic in my programmer with other programs and they all work fine.
I am learning to program and am doing ok. The midi program I have used for my organ was written to scan 127 keys, I only needed 61 so I set about changing that. It took me two days as I have to stop every so often because of my pains but I did it and that is what lead on to this.
 
hi spr001
I have converted the alarm415.asm to alarm415c.asm that can be assembled with MPLAB or Oshonsoft.

It appears to run OK, the rest is up to you.:rolleyes:

E.
 
I was not to sure about the 0.1uF's and the resistor network but, working on some of the early Dolby cinema sound processors nothing surprises me any more including an amp that hummed like hell unless you used coax cable.
I will give the program a shot later thank you.
Steve
 
Standard practice is to 0.1uf to decouple digital ICs very near every ICs power pins. I recall that project. I think it originally used the Tech-Tools assembler (which I liked at the time).
 
After a bit of fun with R2 which is on RW of the LCD and should read 10K but read 4M on the Fluke meter I got Eric's asm file up and running. I have a bug on the buzzer, when you set the alarm. When the exit count down ends instead of going silent the buzzer changes tone. It will only stop if I press an other key on the key pad. The same thing happened on entry, when you have keyed in the code the buzzer will not stop nor will the LCD change to show "ALARM OFF" until I press the # key.
This can not be much. a good look at the code should reveal the problem unless this did not happen when Eric tried it, but the exercise will do me good.

I have added capacitor to the supply rails by the side of the PIC. I have also added resistors to the bell, strobe, panic and the free out put. With the zone inputs resistor networks as they are they work well.
I have had it on test for 24 hours and it works fine. once I have the bug sorted out I will install it.
Steve
 
hi spr,
Scan thru the asm file I posted.
Where I made changes to the code I didn't delete the 'old' parts I just remme'd them out.

The original code did not use a prefix for 'decimal' values, so used the '.' prefix eg: movlw 15 I changed to movlw .15
The b'00000000 binary and $ EQU's values I changed to hex , eg b'00001111 changed to 0x0F

E

EDIT:
Have rechecked the conversion, cannot see see any errors.
 
Last edited:
Hi E
I have just finished the making the board for the alarm and as I have the breadboard connected up to the workshop I programmed an other PIC and that one works fine so it must have been in the programming of the test pic.

I did look at the code and noticed how you had modified it. It must have taken sometime to do.
Now I have a good basics system working I will use the breadboard to play about with as I need to learn more and my wife asked if I could make remote control entry so she only has to press a button on a key fob to disarm the alarm when she has her hands full of shopping. I would like it to call me if the alarm goes off when I am away from home.

Once again thank you for your help.

Steve
 
I'm a hobbyist, i like this project very much,but i have a problem to make hardware part. sir cant find 3.2768 MHz crystal in my region.can modified codes(whitch part of asm file) for 4/8/10/Mhz crystal?pls i like and want to make this help me to solve this problem...can u send me a all codes files..i want and still learning pic programming.(still 0 but i try)
 
Status
Not open for further replies.

Latest threads

Back
Top