16F877A A/D question

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 A/D question

Post by CRAIG CHAMBERLAIN »

Hi All!
Is it possible to use a A/D on Port A when running the 16 X 2 LCD on port A as well?
If not, what would be recommended?
Thanks,
-Craig

Werner
Posts: 95
Joined: Sat Jun 11, 2011 4:12 am
Has thanked: 87 times
Been thanked: 31 times

Re: 16F877A A/D question

Post by Werner »

Hi Craig, I am fairly new to Flowcode and may get corrected but I think you should be able to use 2 pins - bit 0/1 for A/D and the rest for LCD? It seems to simulate.
Good luck Buddy!
Werner
Werner
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"

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 A/D question

Post by CRAIG CHAMBERLAIN »

Hey, Werner!
Thanks for the input. If you simmed it, I would imagine it will work.
I"ll give it a shot.
-Craig

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: 16F877A A/D question

Post by medelec35 »

Hi CRAIG,
I i remember correctly you need to set an output to low for the enable line of LCD eg 0>A5 (if LCD connected to port A)
But you will will need to remember that:
If you connect any of the data pins to an analoge o/p, then when writing to LCD the pin connected to the LCD data/ analogue line will be an output so will force that line high or low. So I would recommend a resistor in series with analogue source and pin of microcontroller to limit the analogue signal if microcontroller pin is set high and analogue signal is low, and vice-versa. So do not connect the wiper of a pot directly to the data pin of LCD without a resistor (at least 1K to limit to 5mA) in series from wiper of pot to data pin.

Martin
Martin

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 A/D question

Post by CRAIG CHAMBERLAIN »

Hi Martin.
I plan on using a multiplexor to send in the input signal to whatever is the best A/D to use.
The output of the multiplexor will be in tristate until I do a read of whatever channel.

Is there a way to access the a/d inputs on ports other than A?
I don't see the option on the component macro for A/D inputs.

Cheers,
-Craig

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: 16F877A A/D question

Post by medelec35 »

Hi Craig,
Tried on hardware.
This works.
I have used LCD on portA and AN0 together.


Martin
Attachments
LCD ACD same pin.fcf
(7 KiB) Downloaded 351 times
Martin

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 A/D question

Post by CRAIG CHAMBERLAIN »

Martin,
Thanks, works for me to.
What are the components after the loop for?
And how could the program get there?
Thanks,
-Craig

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: 16F877A A/D question

Post by medelec35 »

CRAIG CHAMBERLAIN wrote: What are the components after the loop for?
Hi Craig, I have posted my test file for you to try.

I use them components at the beginning of my flow charts for testing the hardware is running at the correct speed, and to test what bits light up when toggled.

I then dragged the group below the main loop, so will never be accessed until I require them again, to test a different port for example.

So you can delete them as they now don't play a part in the flowchart.

Martin
Martin

Post Reply