Continue to Site

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.

ADC 0804 interfacing with 89s52

Status
Not open for further replies.

ergman

Newbie level 5
Newbie level 5
Joined
Jun 16, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,341
I am interfacing ADC 0804 with AT89s52. Can i just ground the pin 1 of adc 0804 and write the following conversion code(Assembly):

SOC: ;Start of Conversion
CLR WRITE ;WRITE is pin 2 of 89s52 which is connected to pin 3 of adc0804
NOP
SETB WRITE
JB INTR,$ ;INTR is pin 3 of 89s52 which is connected to pin 5 of adc0804
RET

READADC: ;Read ADC output
CLR READ ;READ is pin 1 of 89s52 which is connected to pin 2 of adc0804
NOP
MOV A,ADCPORT
SETB READ
RET

Is there anything wrong with this code????
 

There are lots of threads on ADC 0804 with 89s52, e.g. this one.
 

ohk..this link is a bit helpful...one more Question...i m using voltage regulator 7805 to produce constant +5V...but when i tested the voltage b/w pin40 and pin 20 of 89s52, it came out to be 4.7V...do u know any reason?? also Can this uC operate at this voltage??
 

It might be ok (it won't be 100% accurate, e.g. Fairchild's 7805 has a +-2% tolerance). Your 89s52 is probably ok at 4.7v.
However, it might be a symptom of having a poor power supply (e.g. drained battery, or less than 8v supply), or worse still,
your circuit may be consuming too much current (e.g. a fault). You can check that by seeing what the
current consumption is. Also, make sure there is a decoupling capacitor (e.g. 10-100nF ceramic) across the 89s52.
Also, make sure you've followed the 7805 datasheet, the capacitors that it will recommend are important.
 
  • Like
Reactions: ergman

    ergman

    Points: 2
    Helpful Answer Positive Rating
ohk..this link is a bit helpful...one more Question...i m using voltage regulator 7805 to produce constant +5V...but when i tested the voltage b/w pin40 and pin 20 of 89s52, it came out to be 4.7V...do u know any reason?? also Can this uC operate at this voltage??

What is the input voltage to the 7805? According to datasheet 7805 regulator needs min. 7.5V to max 20V input. In electronics, the dropout voltage of a voltage regulator is the smallest possible difference between the input voltage and output voltage to remain inside the regulator's intended operating range.
Check this.
Also. At 4.7 volt your micro will run but check how the ADC 0804 is connected(if the Vref/2 is receiving something directly or via a divider or something). Check the voltage at Vref/2 (pin 9). Your step size(if calculated, thinking its 5 Volt supply) will change if measures not been taken.

- - - Updated - - -

I am interfacing ADC 0804 with AT89s52. Can i just ground the pin 1 of adc 0804 and write the following conversion code(Assembly):

SOC: ;Start of Conversion
CLR WRITE ;WRITE is pin 2 of 89s52 which is connected to pin 3 of adc0804
NOP
SETB WRITE
JB INTR,$ ;INTR is pin 3 of 89s52 which is connected to pin 5 of adc0804
RET

READADC: ;Read ADC output
CLR READ ;READ is pin 1 of 89s52 which is connected to pin 2 of adc0804
NOP
MOV A,ADCPORT
SETB READ
RET

Is there anything wrong with this code????

INTR pin is a normally high pin and is active low.
So the code should be:-

Code ASM - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SETB  INTR   
SOC:    
           CLR WRITE    ;WRITE is pin 2 of 89s52 which is connected to pin 3 of adc0804 
           NOP
           SETB WRITE
           JB INTR,$      ;INTR is pin 3 of 89s52 which is connected to pin 5 of adc0804  
           RET
 
READADC:
         
           CLR READ         ;READ is pin 1 of 89s52 which is connected to pin 2 of adc0804 
           NOP
           MOV A,ADCPORT
           SETB READ
           RET

 

@papunblg...7805 part is working well...i hv taken care of the drop out voltage of 7805...and also in my code i had set the intr pin high...i ws jst asking whethr these subroutines are correct or not....

- - - Updated - - -

@sky-123 Sry to bother u again.....Can u plz tell me more abt why the decoupling capacitor should be used...and how should i connect it???
 

@papunblg...7805 part is working well...i hv taken care of the drop out voltage of 7805...and also in my code i had set the intr pin high...i ws jst asking whethr these subroutines are correct or not....

- - - Updated - - -

@sky-123 Sry to bother u again.....Can u plz tell me more abt why the decoupling capacitor should be used...and how should i connect it???

Yes, these subroutines are correct! Are you facing any error?

- - - Updated - - -

@papunblg...7805 part is working well...i hv taken care of the drop out voltage of 7805...and also in my code i had set the intr pin high...i ws jst asking whethr these subroutines are correct or not....

- - - Updated - - -

@sky-123 Sry to bother u again.....Can u plz tell me more abt why the decoupling capacitor should be used...and how should i connect it???

Yes, these subroutines are correct! Are you facing any error?

- - - Updated - - -

A decoupling capacitor is a capacitor used to decouple one part of an electrical network (circuit) from another. Noise caused by other circuit elements is shunted through the capacitor, reducing the effect they have on the rest of the circuit.

An alternative name is bypass capacitor as it is used to bypass the power supply or other high impedance component of a circuit.

Just attach a 0.1 mfd capacitor between +ve and -ve supply.
 
  • Like
Reactions: ergman

    ergman

    Points: 2
    Helpful Answer Positive Rating
No...there is no error in the program....may be there is some hardware problem...I'll hav to recheck all the connections first.....thanx for the info rel to decoupling caps.. :)

- - - Updated - - -

No...there is no error in the program....may be there is some hardware problem...I'll hav to recheck all the connections first.....thanx for the info rel to decoupling caps.. :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top