Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] ADC0809 not working with 8051

Status
Not open for further replies.

hobbyckts

Advanced Member level 1
Joined
Mar 12, 2015
Messages
481
Helped
88
Reputation
176
Reaction score
85
Trophy points
28
Activity points
2,457
Hi everyone,

I'm using ADC0809 along with 8051 controller. The analog input for ADC is fed through voltage divider circuit with one resistor as a variable one and another as a fixed one. The input voltage is varied through variable resistor. The clock for ADC is supplied through 555 astable multivibrator. I'm monitoring SOC , ALE and clock signals using controller. Now problem is I'm not getting constant data from ADC even though there is no varaition from ADC input. Most of the times I'm getting the FF as the data from ADC. I even tried by varying the clock frequency from 3KHz to 300KHz its of no use the problem still persists. Not sure about the controller code because I have not written it. Tried a lot but the problem I'm facing for seriously very long time.
Please suggest what should be the actual clock frequency.
As I want to measure the unknown resistance value from the field I have used voltage divider circuit to read and calculate it. This signal is converted to 0 to 5 volts through instrumentation amplifier which made using opamps. The output of INA is applied to the ADC.

Please someone guide me to solve the long pending issue.

If someone provides the code that's also fine for me.
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
Trophy points
1,393
Activity points
0

hobbyckts

Advanced Member level 1
Joined
Mar 12, 2015
Messages
481
Helped
88
Reputation
176
Reaction score
85
Trophy points
28
Activity points
2,457
Thanks for the response milan....

First I need to prove the code designer that my hardware is not having any issues till then he will not change his code. So please suggest is there anything might have turned up wrong on the hardware side.

Anyway you please give me the test code in such a way that the controller has to receive data periodically (may be once in 2 minutes) and send it to serially. So that I can monitor that on the COM port.
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
Trophy points
1,393
Activity points
0
Please post your circuit. If possible draw it using Proteus.
 

hobbyckts

Advanced Member level 1
Joined
Mar 12, 2015
Messages
481
Helped
88
Reputation
176
Reaction score
85
Trophy points
28
Activity points
2,457
Sorry I don't have circuit made for this right now.

You can consider the same schematic which you have given me as a reference. In my actual design I have hard coded the values of channel select to '0' and I have utilised only ALE, SOC and CLK as a control signal. The controller which I have used is standard 8051 so after all the processing send it to serially through UART.

Thanks in advance

- - - Updated - - -

It will be better if you could provide program in compatible to use with keil
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
Trophy points
1,393
Activity points
0
Hi

Here is the working ADC0808 project which I made. The same applies for ADC 0809. I have not tested in hardware. There are two issues.

1. In Proteus ADC 0808 model the OUTx pins are reversed that is LSB is OUT7 and MSB is OUT0. So, I have reversed the connections with P2 but in your hardware you should not do this.

2. In mikroC the UART baudrate is set as 4800 bps and in Proteus VT the baudrate is set to 9600 bps to make it work. Maybe it is mikroC bug or Proteus bug. I think it is Proteus bug. So, if in hardware you get garbage data then just change baudrate to 9600 bps in code and compile with mikroC PRO 8051 demo Compiler.

117638d1432013422-sim-ss.png
 

Attachments

  • ADC0808.rar
    92.9 KB · Views: 6
  • sim ss.png
    sim ss.png
    41.8 KB · Views: 16

hobbyckts

Advanced Member level 1
Joined
Mar 12, 2015
Messages
481
Helped
88
Reputation
176
Reaction score
85
Trophy points
28
Activity points
2,457
Are you not considering clock pulse in your code? Because clock condition is not checked anywhere in your code.
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
Trophy points
1,393
Activity points
0
No, clock can be generated in code but I am giving 650 KHz clock to CLK pin of ADC0808/0809. Data sheet mentions clock can be between 650 KHz and 1280 KHz. If you want it in code then generate clock pulses in 8051 using Timer 0 or 1 and feed it to ADC 0808/0809 CLK pin.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top