PDA

View Full Version : Help LCD with 2 wire Connect (Idea)



jetpr
- 28th June 2005, 17:18
Schematics and 4 Buttom with 1 wire Connect(Some Idea)..

Art
- 28th June 2005, 22:15
Care to elaborate to a point where your post makes sense? :D

NavMicroSystems
- 29th June 2005, 00:16
As Art already said:

If you are expecting any help be as precise as you can on your request.

If you can't (or don't want to) giv more details:
PLEASE DO NOT POST
in this category

jetpr
- 29th June 2005, 14:48
I need to made a Displays Box with Include 4x16 LCD Char and 4 Buttons
But I going to use only 4 wire 1 Power, 2 Serial LCD, 3 Ground and 4 for the 4 push Buttons

Is some one have don this.

NavMicroSystems
- 29th June 2005, 15:08
jetpr,

if one of the four pins that are available is an analog input this shouldn't be much of a problem.

A few resistors setup as R/2R Network give an excellent DAC.

sougata
- 29th June 2005, 15:55
Hi,

You should be using one having hardware USART. What is the distance that you would be hooking upto ? Using a DAC / ADC combination to sense four buttons may then be difficult. I personally tend to use the 18F452 because of its speed. You don't miss characters due to overflow. Keep in mind the code overhead in your main processor. If you mention your application in details may be one of my previous code will suite your app.

Regards

Sougata

jetpr
- 30th June 2005, 03:17
Ken i Use 4 Resistors of R1=10k,R2=20K,R3=30K,R4=40 AND USE THE
ADCIN VoltChannel, Voltage

IF Voltage > XXX THEN THIS IS = BUTTON ONE AND SO ON

sougata
- 30th June 2005, 09:13
What if the user presses all the four or any combination of switches simultaneously. Although this can be accomodated in the algo. You still did not reply to my prevoius query. BTW without anymore details or positive outcome I am out of this thread.

NavMicroSystems
- 30th June 2005, 13:11
Ken i Use 4 Resistors of R1=10k,R2=20K,R3=30K,R4=40 AND USE THE
ADCIN VoltChannel, Voltage

IF Voltage > XXX THEN THIS IS = BUTTON ONE AND SO ON

In principle yes.

There are many different ways to set this up,
it depends on what type of buttons you have.
if they have NO + NC contacts then you could setup a real R2R Network
this would allow to detect any combination of keys pressed.
(more than one at a time)

The simplest (with primitive NO-pushbuttons) would be:
5 resistors all of the same value (say 2k2, or 4k7) in series.
(but if more than one key is pressed at a time you will only detect the one pressed closest to the input.)

sougata
- 1st July 2005, 06:25
Lets get down to the requirements straight in break it in short.

You need a remote LCD display. (Master Tx / Slave Rx)

You need to sense a few buttons. (Slave Tx / Master Rx)

To make everything simple connect both the PICs using hardware USART. Depending on the speed needed and code overhead you can choose for RS232 or RS485. This solves the communication problems and takes two wires. The other two wires would be used for power.

Now getting to real life issues :

1. Suppose you send a character from the Master PIC and want to display it on the slave PIC (LCD) , you need to send the cursor position (or there has to be a provision for ). While the character is transmitted the slave PIC was doing something else (say reading buttons and the character buffer overflows), so you miss characters.

The same thing can happen when send switch commands from here.

Send me details (on the forum) on the master PIC (what it is doing) , its code and schematic if possible, I will then send you the design for the slave display and switch module. I am attaching one file that is a serial display routine and you can just access a LCD as if you were accessing the LCDOUT command.

Depending on your app (time sensitive, tight loop), you can go for an interrupt driven prog or poll. Anyway you are in a full duplex mode. So send a character and listen if it was sent okay and bingo its another PBP marvel.

Felch
- 18th August 2005, 06:46
Hi!
It is possible to use just 2 PIC pins for I/O. I did it implementing a shift register for reading keys and another for writing to Nokia 3310 LCD. Take a look at http:/parsek.yf.ttu.ee/~felc You find an unfinished soldering station project with PIC12F675 with schematic and assembly code. Comments are in Estonian but i hope you understand the code
rgds,

/Felch

PS. It IS a little bit slow routine but it works.