CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

2 PIC18F4520 for 1 LCD

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
faridh3



Joined: 17 Mar 2014
Posts: 21

View user's profile Send private message Send e-mail

2 PIC18F4520 for 1 LCD
PostPosted: Fri Mar 21, 2014 6:43 pm     Reply with quote

Hello,
Can we use 2 PIC18F4520 for 1 LCD16x2 ?
Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 21, 2014 8:58 pm     Reply with quote

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.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 2:46 am     Reply with quote

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
faridh3



Joined: 17 Mar 2014
Posts: 21

View user's profile Send private message Send e-mail

PostPosted: Sat Mar 22, 2014 3:24 am     Reply with quote

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.
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 4:52 am     Reply with quote

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
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 6:30 am     Reply with quote

Are you prepared to use more hardware?
OR
Do you want a purely software solution?

We need to know where to start from.

Mike
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 11:48 am     Reply with quote

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:
Quote:
multitasking

You will find more threads on the topic.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group