Altera_Forum
Honored Contributor
20 years agodataavailable / waitrequest questions
Hi all,
I'm interfacing a FTDI 245 to a Cyclone. I have an Avalon slave that kind of works but it's very picky and I have to set wait states and hold times just right to make it work. I'm rewriting the component with flow control (dataavailable and readyfordata) right now but I'm running into a problem with dataavailable. My plan is to raise dataavailable when the chip says it has data and then lower dataavailable at the end of the read. Then, when the chip has toggled it's flag I raise dataavailable again. My question: - When exactly should I lower dataavailable? If I do it too fast (e.g. one clock after the rising edge of read) the bus never reads anything. If I do it too late the bus keeps issuing read cycles too fast and I read the same data over and over. The manual says that dataavailable can only be deasserted at the "end of a cycle" but when is that? Now I'm starting to wonder if the better thing to do would be to use dataavailable only to get the transfer started and then use waitrequest to hold off the bus until the chip is done with a transfer. That raises another question: - How do I avoid indefinitely stalling the bus if a transfer gets cancelled on the sending side (PC)? Should I add a control signal to reset my component or is there something in the Avalon bus I can use (e.g. somehow send a reset to the slave device). Thanks, Andrew