Well, it looks there is a lot of great discussion going on in this thread. I haven't thoroughly reviewed every commment that's been made, but many contain excellent suggestions. I noticed a couple of major changes since your earlier hardware that were worth noting:
- Replacement of the 8031 with an 8751 (for the purpose of leveraging its easier to use internal program space). I don't know if it's an option for you, but you can get 8751-pin compatible parts that have internal EEPROM or flash, saving you the hassle of UV erasure and possibly enabling in-system programming; I remember Atmel having some of these, and also recall them being significantly cheaper than their 8751 counterparts.
- Switch to general purpose/bit-banged I/O for the ADC interface. I am not a big fan of bit-banging an interface when a native hardware implementation of that interface is available, for reasons including sofatware complexity and performance. But, part of being a good engineer is truly understanding when such techniques are appropriate, and subseuqantly being able to implement them when they are. Given that the ADC0809 does not have a particulary 8051-friendly interface, that's an entirely reasonable approach. I trust you understand the implications of the hardware implementation illustrated, including the fact that you do not have EOC connected to an interrupt line, and thus will have to poll the ADC or schedule your reads appropriately. For what it is worth, the ADC0809 is something of an antique relic. It does not have quite the same status as the 8155/8255, but it is up there. For your next project, you might want to consider a different one. These days, you can find an ADC with the performance characteristics required, and just about any type of interface you want, regardless of whether it happens to be I2C, SPI, native 8051 parallel memory bus, or something else.
Your schematic indicates little about your accelerometer and "Polaroid Sensor", so I cannot comment much on those; I assume, for example, that the RC networks you have on the outputs of the ADC provide the desired ADC input protection and/or low-pass filtering characteristics.
Upon reviewing the remainder of the schematic, I do have a couple of observations about your hardware, noted here in no particular order:
- Use of RC reset. As discussed many times on this forum, RC reset generators have several notable limitations. For a circuit that is not reliability-critical, and not subjected to electically noisy conditions, you can probably squeak by on this.
- /EA is grounded. Remember, if you want to execute from internal program store, /EA should be tied to VCC.
- The flip flop used to reduce the frequency of the ADC's clock is unnecessary. Note that ALE will run at 1/6 the clock frequency, which in your case, is well within the ADC's range of 10 - 1280 kHz for the clock. The flip flop is unlikely to hurt though, outside of added complexity and slightly increased conversion times.
- You are attempting to source current from port 3 to drive LEDs. 8051 ports tend not to have particularly powerful drivers, and note particularly that port 3 has weak passive pullups on the order of 10s of kOhms. It is unlikely that you will get your LEDs to light properly in this configuration without the addition of an appropriate driver device.
Good luck.
--Sasha Jevtic