Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Problem with ADC interfacing!!

Status
Not open for further replies.

Tamasco

Full Member level 3
Joined
Jun 27, 2006
Messages
155
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,298
Activity points
2,083
Hi Everyone !!

I simulated an 8051 with an ADC8004 but got some unexpected results. The following is the schematic. For simplicity, I output the result to leds. The output is the same irrespective of the value of Vin!

The following is the assembly code :

***************************************************
Org 0h
start:
mov A,P2 ; save ADC data to Accumulator
mov P3, A ; output data
sjmp start
end
**************************************************

What could be this problem?
I would indeed be very grateful for your input. Thanks in advance.
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,497
Hi Tamasco

Even if ADC is running continuously you still need an initializing pulse following power-up. The WR and INTR node should be momentarily forced to logic low following a power-up cycle to guarantee operation.
 

    Tamasco

    points: 2
    Helpful Answer Positive Rating

hbaocr

Full Member level 4
Joined
May 13, 2007
Messages
235
Helped
25
Reputation
48
Reaction score
5
Trophy points
1,298
Location
Hochiminh City university of technology (VietNam)
Activity points
2,777
here my code! Hope it help full to you
Code:
#include "REG52.H"
sbit INT = P3^3;
sbit RW  = P3^2;  //edge L->H (canh len) cho phep analog signal vao ADC _bat dau chuyen doi
sbit READ  = P3^1;//doc data tu ADC0804 edge H->L (tac dong canh xuong)
sbit CS  =  P3^0;

void delay(unsigned char i);
//+++++++++++++++++++++++++

void main(void)
{
IE=0x84;//cho phep ngat ngoai 1 o chan P3.3
IT0=1;//cho phep ngat canh xuong

P2=0xFF;
P3=0xFF;
//cho phep ADC hoat dong
CS=0;
//RW tac dong canh len => bat dau cuyen doi
//start covert
RW=0;
RW=1;


while(1);
}
//============interupt================
void ADC_READY(void) interrupt 2
{unsigned char temp;
EX1=0;//cam ngat ngoài 1
//Read tac dong canh xuong cho phep doc digital
READ=1;
READ=0;
EX1=1;//cho phep ngat
//bat dau chuyen doi
RW=0;
RW=1;
} 

// ==========sub================ 
void delay(unsigned char i)
{
while(i--)
{ unsigned char k=121;
while(k--);
}
}
//
[/quote]
 

    Tamasco

    points: 2
    Helpful Answer Positive Rating

Tamasco

Full Member level 3
Joined
Jun 27, 2006
Messages
155
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,298
Activity points
2,083
Thank you very much, Silvio and baocr!!
I'll reconfigure it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top