Reading out data from octal buffer

C

Chris Online

Hi all,
At the moment I'm using a Altera MAX and MAX+plus2 graphical design
software.
I'm using the following parts inside the altera:
Octal flipflop 74HC273
AddressDecoder 74HC154
Octal Buffer 74HC541

First I place an address at the input of the first FF. This address is
inserted into the AdrDec. Then I put data on the input of a
register(second FF). The output of the AdrDec selects this register
and clocks the data through. This all works fine. I connected some
leds to the output of the register so I can verify the data.

#define DATA PORTB // PORTB is DATAport
DATA = adr; // Set Address
CTRL_OUT &= ~0x04; // Enable AS -> Clock Adr into AdrDec
CTRL_OUT |= 0x04; // Disable AS

DATA = dat; // Set Data
CTRL_OUT &= ~0x02; // Enable DS -> Clock Data through FF
CTRL_OUT |= 0x02; // Disable DS

Next thing I wanna do is get data from a Buffer. I used MAX+plus2 to
connect the inputs of the Buffer to GND or VCC (10101111). The first
OE of the FF is connected to GND and the second OE is connected to a
output of the AdrDec. Again, first I set the address. Then I clock the
Adr into the AdrDec. After that I define PORTB as input. I enable the
buffer and try to read data from the buffer. This is where is goes
wrong. The data which I read from the buffer isn't the same as the one
I set at the input (10101111)

#define DATA PORTB // PORTB is DATAport
DATA = adr; // Set Address
CTRL_OUT &= ~0x04; // Enable AS -> Clock Adr into AdrDec
CTRL_OUT |= 0x04; // Disable AS

OEB = 0x00; // PORTB is input
CTRL_OUT &= ~0x02; // Enable DS -> Enable Buffer
datget = PINSB; // Get Data
CTRL_OUT |= 0x02; // Disable DS
OEB = 0xFF; // PORTB is output

How is this possible? Is there something wrong with the order of
handling things?
Hope someone can help me out with this one

thanks in advance,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top