Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Multiplexer with PIC16F877

Status
Not open for further replies.

anishpsla

Member level 2
Joined
Dec 15, 2013
Messages
44
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
402
I want to use 4X1 (74153) multiplexer to my project. The output of the Mux is connected to a counter pin of PIC. I am confused about how to select common select Inputs. I am using RA1 and RA2 pins for this purpose.

pic.jpg
 

Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
790
Trophy points
1,393
Location
Bangalore, India
Activity points
0
Connect pins 1 and 15 to ground to enable the outputs. For MUX 1 provide inputs to pins 3, 4, 5, 6. To select the input that is to select the input that should appear at output set pin 14 and 2 to 00, 01, 10 or 11.
Channel selection pins 14 and 2 are common for both the muxes.
 

anishpsla

Member level 2
Joined
Dec 15, 2013
Messages
44
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
402
Thanks for your reply. I need code example for giving 00,01,10 or 11 to channel selection pin.
 

Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
790
Trophy points
1,393
Location
Bangalore, India
Activity points
0
To set pin you use PORTx.Fx = 1 and to clear you use PORTx.Fx = 0 in mikroC.
 

Attachments

  • MUX.rar
    35.3 KB · Views: 32
Last edited:
  • Like
Reactions: anishpsla

    V

    Points: 2
    Helpful Answer Positive Rating

    anishpsla

    Points: 2
    Helpful Answer Positive Rating

anishpsla

Member level 2
Joined
Dec 15, 2013
Messages
44
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
402
But how to change portB.B0 = 0 portB.B1 = 0 next
portB.B0 = 0 portB.B1 = 1 next
portB.B0 = 1 portB.B1 = 0 and next
portB.B0 = 1 portB.B1 = 1 using MikroC . This is the real problem for me.
 

Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
790
Trophy points
1,393
Location
Bangalore, India
Activity points
0
You can also connect EN pins to micro and disable the outputs of MUX while switching the channels.
 

Attachments

  • MUX v1.rar
    36.2 KB · Views: 28
Last edited:

anishpsla

Member level 2
Joined
Dec 15, 2013
Messages
44
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
402
Thanks for the attachment. I got the idea for my program. Once again thanks for your quick reply.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top