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
16F877A A/D question
Moderator: Benj
- 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
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
Good luck Buddy!
Werner
Werner
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"
- 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
Hey, Werner!
Thanks for the input. If you simmed it, I would imagine it will work.
I"ll give it a shot.
-Craig
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
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
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
- 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
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
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
Hi Craig,
Tried on hardware.
This works.
I have used LCD on portA and AN0 together.
Martin
Tried on hardware.
This works.
I have used LCD on portA and AN0 together.
Martin
- Attachments
-
- LCD ACD same pin.fcf
- (7 KiB) Downloaded 352 times
Martin
- 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
Martin,
Thanks, works for me to.
What are the components after the loop for?
And how could the program get there?
Thanks,
-Craig
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
Hi Craig, I have posted my test file for you to try.CRAIG CHAMBERLAIN wrote: What are the components after the loop for?
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