Shop OBEX P1 Docs P2 Docs Learn Events
MUX Channel Array - Newbie Question — Parallax Forums

MUX Channel Array - Newbie Question

Jimmy_RuJimmy_Ru Posts: 8
edited 2011-03-02 09:57 in Propeller 1
Can anyone point me towards an elegant solution to creating a channel selector for a multiplexer?
I am new to the propeller and its languages.

When I say elegant solution, my frame of reference is python used in a functional style of programming... just my frame of reference and putting my ignorance in the open.

For the multiplexer I am using a TI CD4067be and my searches for projects that detail multiplexers have some up empty this morning. Optimally should channel selection just be explicitly set in the constants section of code or should/can I create a method/proc for each channel?

Thanks for any help: links or details in reply.

JR

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-02 09:57
    The CD4067 just requires a 4 bit select value. Typically, these 4 bits would be supplied from 4 successive I/O pins on the Propeller. Assuming that's the case, say you're using I/O pins 4-7, you'd first (during initialization) set the I/O pins to outputs with "DIRA[ 7..4 ] := %1111". When you want to set a channel, you'd do something like "OUTA[ 7..4 ] := theChannel" where "theChannel" can be any expression.

    Download and look at the Propeller Manual for detailed descriptions and examples of these statements. You might download and go through the Propeller Education Kit tutorials to learn how to use the Propeller. Both are available from Parallax's Downloads webpage.
Sign In or Register to comment.