View previous topic :: View next topic |
Author |
Message |
faridh3
Joined: 17 Mar 2014 Posts: 21
|
2 PIC18F4520 for 1 LCD |
Posted: Fri Mar 21, 2014 6:43 pm |
|
|
Hello,
Can we use 2 PIC18F4520 for 1 LCD16x2 ?
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Mar 21, 2014 8:58 pm |
|
|
Possibly, if you can guarantee that one of the PICs is active and the other
PIC has its LCD connection pins set to "floating" (ie., set as inputs).
But, how are you going to guarantee this condition (only one PIC is active
and the other "disconnected", in effect) ? Holding the \MCLR pin at a low
level will keep the PIC in reset (assuming you don't have the NOMCLR
fuse selected). When a PIC is held in reset, all of its i/o pins are in a
"Hi-Z" (floating) state and are not active.
In general, avoid having two PICs connected to one LCD. Find some
other way to solve the problem. |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat Mar 22, 2014 2:46 am |
|
|
You could guarantee isolation with a hardware mux.
I did something similar (and the other way round) a long time ago when I wanted four hardware UARTS using MAX232s.
OR
Use PIC_1 to drive the LCD, PIC_2 simply tells PIC_1 what to display.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
faridh3
Joined: 17 Mar 2014 Posts: 21
|
|
Posted: Sat Mar 22, 2014 3:24 am |
|
|
okey thank you
the problem is, that i need to run 2 infinite loops at the same time and i have no idea how to do it. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9170 Location: Greensville,Ontario
|
|
Posted: Sat Mar 22, 2014 4:52 am |
|
|
A third method is to have the LCD connected to one PIC(host/master), the other PIC is then a 'remote' or 'slave' and sends data to the 'host' or 'master' PIC which then displays that data on the LCD.
However from your last post it sounds like you really want to
start
do something, display result
do something else, display that result
loop to start
If you give an better description of the project, we can guide you to examples of code, either in this forum or the code library.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat Mar 22, 2014 6:30 am |
|
|
Are you prepared to use more hardware?
OR
Do you want a purely software solution?
We need to know where to start from.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 22, 2014 11:48 am |
|
|
Quote: |
The problem is, that i need to run 2 infinite loops at the same time and i
have no idea how to do it.
|
Read this thread below, with this title:
Running 2 loops at the same time?
http://www.ccsinfo.com/forum/viewtopic.php?t=31878
Read the link in that thread that I posted. I has a basic outline of the
type of code you need to write. But, you must be at least an intermediate
level C programmer (with some experience), to do this. A beginner
can't do this type of program or understand it.
Also do a forum search for:
You will find more threads on the topic. |
|
![](templates/subSilver/images/spacer.gif) |
|