??? 04/24/06 21:27 Modified: 04/24/06 21:41 Read: times |
#114941 - There might be some problems Responding to: ???'s previous message |
You probably ought to spend some time with the timing figures associated with your ADC, and comparing the numbers with what the 8031 produces.
First of all, the ALE is an output from the 8031. The flipflop divides it by two, i.e. generates a clock at half its frequency, which is 4 MHz/12, which should produce an ALE width of 4 microseconds, as seen from the ADC, which suggests the flipflop may be unnecessary. It won't hurt anything, aside from making your code execute slower, which doesn't matter, since the conversion rate, according to the datasheet, is on the order of 10 KHz. you're clearly using the EOC signal as an interrupt or polling it. It's not clear, however, why the OE is held active (HIGH) all the time. This can create a problem, in that it interferes with the 2816's outputs, which are active only when nPSEN is active. With the ADC outputs active all the time, you don't know whether the 8031 is always executing the code it should be executing, since the ADC might interfere. Additionally, I wonder if the START strobe isn't occurring too frequently to allow your conversion to complete, since it is the same signal as drives the CLOCK input. ISTR that some parameters are defined in clock periods. If you restart the conversion each time the Clock occurs, perhaps you won't get the result you desire. Now, it's been over 25 years since I last used one of these, but ISTR that you need to present a channel address some time, apparently 50 ns or so prior to the START strobe, provide a free-running clock (which you do) but hold the analog input stabile for the entire time between START and EOC, and then read the resulting value by presenting OE. This probably means that you might want to reconfigure your circuit such that the ADC receives A0, A1, and A2 (as used on the 2816) as its channel addresses, use A15 as its START strobe, and use EOC as you already have. This will logically address the channel register in the ADC as address 0x800n, where n ranges from 0 to 7. When the EOC strobe arrives, you read the corresponding address, minus 0x8000, or 0x000n, which keeps the START strobe inactive (LOW) and that allows you to read the ADC. At 4 MHz, the ALE width should also be sufficient so that you can use it as shown and there should be no trouble with the converter's access time. However, the circuit requires extensive revision. You'll probably want to invert the nRD strobe from the 8031 and use it as your OE to the ADC. It is only valid for read/write memory accesses, and won't affect your 2816 operation. There are a few apparent drafting errors in your illustration. First of all, the address/data lines to the right of the 2816 appear to be overlapped, hence the software has placed connection dots on the drawing. Additionally, the LED module leads apparently overlap the 8031 pins, hence, no-connect (x) is shown. Also, the signal names at the 2816's outputs are labelled A7..A0, while they probably should be D7..D0. That will produce an incorrect netlist. It appears that you have juxtaposed A7..A0 with D7..D0. I can almost guarantee you that this will not produce the result you desire. Perhaps you will want to spend a bit more time with the 8031 datasheet, and the ADC datasheet. You'll also want to ensure that whatever schematic you finally use has the correct signal names on it, as the netlisting software assumes you know what you're connecting to what, and doesn't care whether it's correct. A label is as good as a wire, so labelling things is equivalent to drawing a discrete connection. RE |