Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

DEII GPIO Bidirectional problem

Hi, I am doing a project involving use the nand-flash chip through the DEII GPIO port. the data port for nand flash will be used for both input and output.

This is what I did:

1. declare the port as inout

inout wire [7:0] nand_data_inout,

reg nand_out_enable;

2. use an enable signal to switch between input and output

assign nand_data_inout=nand_out_enable?nand_data_out:8'bZ;

3. usage

in the next state logic, if next cycle, i need the port to be output, i will do:

nand_out_enable=1;

if I need it to be the input, then i will do

nand_out_enable=0;

To read the data, i will do the following:

LEDG_ID=nand_data_inout;

Problem:

I have tested with LEDs, so the output signal is correct, however, the read input seems like doesnt work at all, all I read is 1. Did I do something wrong here?

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Does changing 8'bZ to 8'bZZZZZZZZ help?

    --- Quote End ---

    Thanks for you reply, but seems like its not working...