I want to use RB0-RB7 to both drive 7-segment displays and get input from a hex keypad ... in other words, what's the best way to connect more than one device to the same i/o pins (bus) ..
Use the same ports to scan displays and keys, and separate ports for segment driving and keypad reading. This is an orthodox way to deal with several displays and keys.
If i want to drive a 7 segment display and recieve the output of an external ADC using the same I/O pins...Do I need to use tristate buffer to isolate an element when the other is active ?
If i want to drive a 7 segment display and recieve the output of an external ADC using the same I/O pins...Do I need to use tristate buffer to isolate an element when the other is active ?
It would be easy to help you if you descibe the pin assignement in your project.
There are many options to solve your problem. You mentioned that you have an external ADC,
wich means that you are receiving in your I/O pins digital signals level all the time.
What I will do is to use an octal latch (like 74HC573/574) and drive the 7 segment display with them,
in this way you don´t need to waste dedicated pins and processor time to keep the display On.
When you need to drive the display, output your data in Port B, trigger the 74HC573 latch Enable pin,
and then you can reverse your I/O pins to get external data coming from the ADC.
Hope you understand the idea.
If i want to drive a 7 segment display and recieve the output of an external ADC using the same I/O pins...Do I need to use tristate buffer to isolate an element when the other is active ?
It would be easy to help you if you descibe the pin assignement in your project.
There are many options to solve your problem. You mentioned that you have an external ADC,
wich means that you are receiving in your I/O pins digital signals level all the time.
What I will do is to use an octal latch (like 74HC573/574) and drive the 7 segment display with them,
in this way you don´t need to waste dedicated pins and processor time to keep the display On.
When you need to drive the display, output your data in Port B, trigger the 74HC573 latch Enable pin,
and then you can reverse your I/O pins to get external data coming from the ADC.
Hope you understand the idea.