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.

Security With LCD

Status
Not open for further replies.
Need Some help porting my code. I dont see the issue with it tho. No errors and no halting just doesnt show anything. The lcd works because i tried it back on the 18F1320 breadboard and even tried another lcd just in case.

Also i changed the delays for 20Mhz. I also changed the A/D stuff. If anyone can lend a hand plz...

The issue is i cant see anything on the LCD not even white bars. Here is my code. (for the PIC18F448)

hi atom,
Is this what you are expecting from the asm.?:)

Changed part of the LCD init code, also the inverted the LCD Enable.

Had to drop the leftshift before the LCD writes in order to run with the Oshonsoft Sim.

EDIT:

Added main2.asm all changes marked with ++++ , just search, about 10 lines changed.
The delays should be a little longer as you are not using RW DB8 Busy.
 

Attachments

  • esp04 Jul. 09.gif
    esp04 Jul. 09.gif
    8.9 KB · Views: 151
  • esp03 Jul. 09.gif
    esp03 Jul. 09.gif
    9.3 KB · Views: 167
  • main2.asm
    6.4 KB · Views: 134
Last edited:
you are going to laugh lol
that code first doesnt work for me. The code i asked for help in works lol

I wired it wrong meaning i wired db4-7 to rb4-7 instead of ra1-4 lol
 
you are going to laugh lol
that code first doesnt work for me. The code i asked for help in works lol

I wired it wrong meaning i wired db4-7 to rb4-7 instead of ra1-4 lol

hi atom,
For that code main2.asm I posted, I had to modify the code, so with your original wiring
[even after you have rewired it] it wouldnt work.

You would have to move the A4 thru A1 down to A3 thru A0.

I did that to show you that your code does work...:):)
 
Last edited:
thanks a bunch reading it now. Even tho i feel like just keep on using your code
but i feel like im not learning if i do use your code. You understand? :D So ill will try to make my own code and hope i dont "futz up" lol you get it? lol im tired :D
 
hi atom,
What type of project board linking wire are you using.?

If you can get your hands on a few metres of old phone trunking cable, the multicore, tinned single strand type,
it makes excellent linking wire.
Also handy for soldered pcbs.

I see you are using the Analog method for the keypad.
If you ever have to install a long single core security loop with the window/door switches connected in series,
you can add a parallel resistor across each normally closed switch.
By choosing a different value resistor for each switch and using the analog method to detect an open switch
[intruder], its possible by measuring the analog voltage with the PIC to determine which switch in the loop is open.

Hope you follow.:)
 
Last edited:
i think i do: let me try to explain what i think you are saying. Its like have that pad with all the buttons pushed down and when a button let go the voltage goes up and since each have a different resistor i can compare what kind of voltage gain i have and determin which switch was released (opened).

Does that about sum it up? Of course not with the actual pad though :D with like window and door sensors, Maybe even a smoke alarm.

P.S. If so great idea!
 
Last edited:
i think i do: let me try to explain what i think you are saying. Its like have that pad with all the buttons pushed down and when a button let go the voltage goes up and since each have a different resistor i can compare what kind of voltage gain i have and determin which switch was released (opened).

Does that about sum it up? Of course not with the actual pad though :D with like window and door sensors, Maybe even a smoke alarm.

P.S. If so great idea!

hi atom,
Rough sketch.
The number of switches can be increased to about 16 if required.

A 0V at the adc input would indicate a cut loop.!

In an actual installation I would add a low value resistor in series with input to the PIC's adc and some filtering. [ cap/zener]
Electrical storms can induce high voltages into a security loop.
 

Attachments

  • esp02 Jul. 10.gif
    esp02 Jul. 10.gif
    4.6 KB · Views: 179
Last edited:
Yes exactly how i pictured it... i know this is like a stupid question but... How can i take in lets say a range from 12-17v and convert it to 0-5v? I think its called a level shifter or something. Im just tired and google isnt my friend right now.
 
Yes exactly how i pictured it... i know this is like a stupid question but... How can i take in lets say a range from 12-17v and convert it to 0-5v? I think its called a level shifter or something. Im just tired and google isnt my friend right now.

hi atom,
If you could accept a rough level shift, you could use a 12V zener connected to a series resistor.
That is the 12VZ to the +12v thru +17v rail and a series resistor to 0V from the anode of the zener.

For greater accuracy and linearity a OPA level shifter is recommended.
 
I was doing a security system ages ago for fun. Best sensor solution was a 1 wire network of DS2401 (3 pin two wire devices)
**broken link removed**
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top