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

Help reading from multiplexer

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



Joined: 14 May 2007
Posts: 14

View user's profile Send private message

Help reading from multiplexer
PostPosted: Tue Nov 20, 2007 12:41 pm     Reply with quote

Hello.
I'm beginner with PIC and ccs. I need some help/advices in reading data from a multiplexer.
I'm using a PIC16f876 for reading 9 digital inputs. Initially I've set portB (all 8 pins) and pin RC5. Now I intend to use a 4x16 LCD display and to read data from a sonar. portA is used to control 3 motors.
I can group the 9 digital inputs into 3 groups of 3 (because they are different types) and use 3 multiplexers (my ideea is to use 3 multiplexers 8-to-1 in order to have signals of 8 bits and use only 3 input ports). What I do not know is how can I read these bits from the multiplexer. (using ccs PCM compiler version 4.032 under Linux)

EDITED:
The sensors are actually acting like switches (I'm reading only the On or Off state).
Any help/advice would be appreciated.

P.S: I saw an example of reading digital inputs (but from sonars) using multiple serial lines. Example:
#use rs232(baud=9600, INVERT, BITS = 8, PARITY = N, rcv=SONAR_1_XMIT, stream=sonar1)
#use rs232(baud=9600, INVERT, BITS = 8, PARITY = N, rcv=SONAR_2_XMIT, stream=sonar2)
... Where SONAR_1(and 2)_XMIT were defined as PIN_A3 and PIN_A2

I wonder if I could apply this to multiplexer output.

Thanks


Last edited by c0de on Tue Nov 20, 2007 12:59 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 20, 2007 12:59 pm     Reply with quote

How to do an LCD interface with 3 signal wires:
http://www.myke.com/lcd.htm
c0de



Joined: 14 May 2007
Posts: 14

View user's profile Send private message

PostPosted: Tue Nov 20, 2007 1:03 pm     Reply with quote

PCM programmer wrote:
How to do an LCD interface with 3 signal wires:
http://www.myke.com/lcd.htm


Thats cool. Thanks:)

I'm still interested in reading those bits.
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