16F877A project

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
CRAIG CHAMBERLAIN
Flowcode V4 User
Posts: 24
Joined: Mon Jun 27, 2011 6:05 am
Location: Madison Wisconsin
Has thanked: 6 times

16F877A project

Post by CRAIG CHAMBERLAIN »

I have a 16F877A project that uses a 3 way rotary switch.
Does something like this exist? Can I make one without knowing C?

Or just stick with 3 standard switches and live with it? Not a big problem now that I think about it.

Question 2: It would be very handy for me to be able to Sim a signal multiplexor that will
be used as an input to 1 a/d input (RA0), for 10 different signals.

I realize I should be able to do this via a macro. Before I start, any ideas on the simplest way to do this?
Thanks in advance.
-Craig

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 16F877A project

Post by Benj »

Hello Craig,

1) You can use 3 standard switches in Flowcode to simulate and then use the actual 3-way rotary switch on the hardware. Shouldn't be any problems with doing this.

2) The simplest way to do this would be to read the ADC as a byte, then divide the byte by 26 and finally use the byte as a index for a switch icon with labels 0-9.

User avatar
CRAIG CHAMBERLAIN
Flowcode V4 User
Posts: 24
Joined: Mon Jun 27, 2011 6:05 am
Location: Madison Wisconsin
Has thanked: 6 times

Re: 16F877A project

Post by CRAIG CHAMBERLAIN »

Ben,
Thanks for the reply.
Not quite sure what you mean by reading the ADC as a byte. Are you saying use the address of the data to select a switch perhaps?
I'm no neophyte, But you left me in the dust on this one!
-Craig

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 16F877A project

Post by Benj »

Hello Craig,

Please look for the switch case icon in the flowchart icon toolbar. Add one to your program and go into the properties and you will see if needs an input parameter. Use the variable from your ADC read which you have also done the divide by 26 as the parameter for the switch case icon. Valid switch cases will then be 0 - 9 with regards to the ADC voltage.

User avatar
CRAIG CHAMBERLAIN
Flowcode V4 User
Posts: 24
Joined: Mon Jun 27, 2011 6:05 am
Location: Madison Wisconsin
Has thanked: 6 times

Re: 16F877A project

Post by CRAIG CHAMBERLAIN »

Ben,
I believe you may not understand my goal.
I want to be able to use 4 control lines to control a 1 of 16 analog switch,
which will control which signal is read by the micro. I'll only be using 1 analog input.
It sounds like you are proposing a form of window comparator.

Which does give me an idea for later programming!
-Craig

Post Reply