I looked at some example code on Altera's website, and the few I found
were not very helpful. They weren't very close to what I need to do.
Any help that can be offered would be greatly appreciated. Thanks.
Ezra Harrington
Sent via Deja.com http://www.deja.com/
Before you buy.
> I'm having difficulties getting bidirectional pins working on an Altera
> PLD. I need to have two 8-pin bidirectional ports, D1 and D2.
> Sometimes the input from D1 has to be output to D2, and sometimes the
> input from D2 has to be output to D1. Should I just be able to use
> statements like 'D1 <= D2' or 'D2 <= D1', or do I need to have an
> intermediary internal signal, or do I need to do something else all
> together.
>
> I looked at some example code on Altera's website, and the few I found
> were not very helpful. They weren't very close to what I need to do.
If the PLD features tristate ports I'd do it like this:
d1 <= any_signal when my_condition = '1' else "ZZZ...ZZZ";
As a source, you can use it like any normal input pin:
any_signal <= d1;
Hope this helps.
-Andreas
Therefore usually for MOST projects we just use Altera's MegaFunction
to generate all the Generic Functions such as counters, shift registers
and what you need:
Bi-Directional Buffers
We also find that COMBINING heiarchical sheets of BOTH VHDL and the
Schematic MegaFunctions DO work reliably.
Therefore if your problem is only the the Bi-Directional problem then
link that in as a schematic MegaFunction with your existing VHDL code.
I'll email some example files on request.
___________________________________________
H A R V E Y T W Y M A N
Department of Electronics,
University of Kent.
Canterbury. U.K.
ABOUT ME: http://www.Twyman.org.uk/CV.htm
EMAIL ME: H.E.T...@ukc.ac.uk
___________________________________________
In article <90mep7$1tk$1...@nnrp1.deja.com>,
Ezra Harrington <tv...@my-deja.com> wrote:
> I'm having difficulties getting bidirectional pins working on an
Altera
> PLD. I need to have two 8-pin bidirectional ports, D1 and D2.
> Sometimes the input from D1 has to be output to D2, and sometimes the
> input from D2 has to be output to D1. Should I just be able to use
> statements like 'D1 <= D2' or 'D2 <= D1', or do I need to have an
> intermediary internal signal, or do I need to do something else all
> together.
>
> I looked at some example code on Altera's website, and the few I found
> were not very helpful. They weren't very close to what I need to do.
>
port0 is bidirectinal port
dir_reg is ur direction control register
for i in 0 to 7 loop
if dir_reg(i) = '1' then
port0 <= 'Z';
elsif dir_reg = '0' then
port0 <= '0';
end loop;
to configure the port as input u would have write all 1 to dir_reg(i) bit.
To output values simply write to dir_reg register.
Hope this helps
"Andreas Ackermann" <ac...@rommel.stw.uni-erlangen.de> wrote in message
news:3A2F968B...@rommel.stw.uni-erlangen.de...
> Ezra Harrington wrote:
>
> > I'm having difficulties getting bidirectional pins working on an Altera
> > PLD. I need to have two 8-pin bidirectional ports, D1 and D2.
> > Sometimes the input from D1 has to be output to D2, and sometimes the
> > input from D2 has to be output to D1. Should I just be able to use
> > statements like 'D1 <= D2' or 'D2 <= D1', or do I need to have an
> > intermediary internal signal, or do I need to do something else all
> > together.
> >
> > I looked at some example code on Altera's website, and the few I found
> > were not very helpful. They weren't very close to what I need to do.
>
if DIR = '1' then
D1 <= ( others => 'Z' );
D2 <= D1;
else
D2 <= ( others => 'Z' );
D1 <= D2;
end if;
Cheers
Dave.
"Ezra Harrington" <tv...@my-deja.com> wrote in message
news:90mep7$1tk$1...@nnrp1.deja.com...
> I'm having difficulties getting bidirectional pins working on an Altera
> PLD. I need to have two 8-pin bidirectional ports, D1 and D2.
> Sometimes the input from D1 has to be output to D2, and sometimes the
> input from D2 has to be output to D1. Should I just be able to use
> statements like 'D1 <= D2' or 'D2 <= D1', or do I need to have an
> intermediary internal signal, or do I need to do something else all
> together.
>
> I looked at some example code on Altera's website, and the few I found
> were not very helpful. They weren't very close to what I need to do.
>