Hi,
Yes, your circuit is right. You have to also connect Vref- and IN- to ground. Your connections to 89S52 are also right. But, if you are a student, trying to learn microcntrollers, and developing your own software, I will advise you to change the connections as follows:
Connect ADC RD to P3.7
ADC WR to P3.6
ADC CS to P3.5
ADC INTR to P3.2
Also extend present eight connections from (P1.0...P1.7) to (P0.0 ....P0.7) also. Keep the present data connections in tact.
The above connection changes will allow you try writing software in wait mode or in interrupt driven mode. You can also learn the advantage of MOVX instruction compared to MOV instruction in such applications.
You have not shown the crystal and ground connections for 89S52, but I suppose they are implied.
Regards, Laktronics
Will this circuit work when I connect adc0804 to port 2 of at89s52? And do I need to connect a 10k pull ups resistors to port 0 of at89s52 when I connect adc0804?
Hi,
Normally when you use port0, your are supposed to connect a pull up resistor net work since port0 is of open drain type. I have not suggested this since I thought that a parallel connection with port1 will provide the necessary pull up also.
If you use port2 instead of port1, parallel connection to poer0 will have a problem if you use MOVX@DPTR instructions since the address high appearing on port2 will load ADC data during address phase. Ofcourse, in this case, you can still use a high address with all bits high to avoid loading.I am not sure if could solve the problem totally using MOVX@Rp, please see the timing diagram and check if port2 outputs change for this instruction during address phase, if not I do not find any reason for not using port2 instead of port1. In any case, you have to ensure that if you are using port0, the parallely connected port is left untouched at its reset all high bit state.
Any how,parallel connection of port0 with another port will give you two options of development of data collection software, purely from educational point of view. You should keep your data processing and display module separate from data collection software to try out these two options.