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.

No signal of finished conversion while using AD7731

Status
Not open for further replies.

Mickey_2006

Newbie level 3
Joined
Oct 29, 2003
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
31
ad7731

Im' using AD7731 converter with T89C51AC2 microcontroller and I get no RDY pulled down (signal that conversion is finished):

This is the code I use:
(POL pin is tied HIGH)
any ideas why?
Does anyone have code for driving AD7731?

fnSendByteAD7731 (0x02); // Next write to MODE register
fnWait1ms ();
fnSendByteAD7731 (0x50); // First 8 bits of MODE register
fnWait1ms ();
fnSendByteAD7731 (0x70 + (channel & 0x07)); // Last 8 bits of MODE register
fnWait1ms ();

while (AD7731_RDY) _nop_(); // Wait for conversion to end


void fnSendByteAD7731 (unsigned char byte) {
unsigned char cnt;

for (cnt = 0; cnt < 8; cnt++) {
AD7731_DATA = (byte & 0x80) == 0x80;
AD7731_SCLK = 0; fnWait1ms ();
AD7731_SCLK = 1; fnWait1ms ();
byte = byte << 1;
}
}
 

Re: 8051 and AD7731

Hi

Connect a scop or a logic analyzer and verifay the signals acording to the data sheet


All the best


Bobi
 

Re: 8051 and AD7731

Did you check MCLK OUT?
If there is a bug in the code, you should post function implementation in order to get help.
 

Re: 8051 and AD7731

Here are the functions:

void fnSendByteAD7731 (unsigned char byte) {
unsigned char cnt;

for (cnt = 0; cnt < 8; cnt++) {
AD7731_DATA = (byte & 0x80) == 0x80;
AD7731_SCLK = 0; fnWait1ms ();
AD7731_SCLK = 1; fnWait1ms ();
byte = byte << 1;
}

AD7731_DATA = 1;
}


unsigned char fnReadByteAD7731 () {
unsigned char cnt;
unsigned char result = 0;

for (cnt = 0; cnt < 8; cnt++) {
AD7731_SCLK = 0; fnWait1ms ();
result |= (0x01 & AD7731_DATA);
AD7731_SCLK = 1; fnWait1ms ();
result = result << 1;
}

return result;
}


Do you have any idea what is wrong?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top