(Please view in fixed font :)
Hi All
I have built an IDE compact flash card interface for a particulat embedded system and all boards work except for one, which i am having consistant truoble with. I want to know why it doesn't work, to make sure that the other working boards won't develop the same problem (i.e. they aren't on the edge of failing)
The board uses a DS80C320 and PSD813 with a 20MHx XTAL. Peripherals are connected to the PSD813 using separate 8 bit address and data buses, and the PSD chip select outputs.
The circuit at the bottom of the page is the interface to the compactflash card in IDE mode. Why IDE mode? :) Well because we are using CF-IDE adapter boards cause we didn't want to do any surface mount soldering. However the card must be able to be taken out and put back in with out turning off the unit. I have a switch to turn it off, however it also draws power from the data and address pins, hence the two buffers with output enable set to the card enable. This way when I switch the card off, the software stops writing to the card registers, thus /CS0 remains high and the buffers have a high impedence output, stopping the card from drawing power. On the bad board it sometimes works fine, sometimes hangs waiting for the DRQ bit (bit
3) to be set in the status register during sector reads and writes, and sometimes the identify drive command returns crap. The bad board always works with a normal sandisk compactflash, but not an industrial one. Streching MOVX makes no difference.Ok I hope that made sense. Question 1: Is there anything wrong with the interface circuit? Question 2: I do a check every 100ms to see if the RDY (bit 5) bit is set in the status register and CF D5 and /IORD look like this:
. +--l. +--l. . | '-_ | '-_ . | '-| -. . | '-__ .---+ '----- CF D5 . .---+ +-----+ +---------------- /IORD . | | | | . | | | | . | | | | . +--+ +--+
This is OK isnt it? Or should i put some pull downs in? Question 3: Does any one have a similar circuit they can describe to me
Thanks Ross
Interface Circuit: All D? pulled high All other signals straight from PSD813
. 74HC245 . +---------+ All D? pulled high CF D7 -------------| B7 A7 |--------------- D7 CF D6 -------------| B6 A6 |--------------- D6 CF D5 -------------| B5 A5 |--------------- D5 CF D4 -------------| B4 A4 |--------------- D4 CF D3 -------------| B3 A3 |--------------- D3 CF D2 -------------| B2 A2 |--------------- D2 CF D1 -------------| B1 A1 |--------------- D1 CF D0 -------------| B0 A0 |--------------- D0 . | DIR |--------------- /IORD . | /OE |--------------- /CS0 (ATA reg select) . +---------+ . . 74HC541 . +---------+ CF /IOWR ----------| Y7 A7 |--------------- /IOWR CF /IORD ----------| Y6 A6 |--------------- /IORD CF A1 -------------| Y5 A5 |--------------- A1 . ----| Y4 A4 |--------------- GND CF A0 -------------| Y3 A3 |--------------- A0 CF A2 -------------| Y2 A2 |--------------- A2 CF /CS0 -----------| Y1 A1 |--------------- /CS0 CF /CS1 -----------| Y0 A0 |--------------- /CS1 (Always high) . | /OE1 |--------------- /CS0 (ATA reg select) . | /OE2 |--------------- /CS0 (ATA reg select) . +---------+