EmbDev.net

Forum: µC & Digital Electronics Interface of external ADC with Arduino UNO(avr atmega328)./ (ADC's TWI adress not found)


von Matt (Guest)


Attached files:

Rate this post
useful
not useful
Hello,

The usecase is the measurment of 2  voltagea of max -+10. I use Arduino 
UNO (Atmega328) and two ADC components  (AD7893ANZ-10), datasheet 
available on 
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7893.pdf 
, trying to make this run I faced  two challenges which  was not 
solvable by my resaerches on it, why I hope for help here.
The issues are following:

1. The TWI adress of the ADC component is not avialable in Datasheet. I 
tried three I2C device scanners, which I foundnon forumnof Arduino, but 
no I2C device couldnt be found.  One of scanners is posted below and the 
scheme of the circuit(with pull up resistors etc.) is attached. on the 
circuit scheme the pin "convst" is not connetcted but I also tried it 
with convst pin being pulsed with T=12µs and D=50% according to 
datasheet.
1
#include <Wire.h>
2
3
void setup()
4
  { 
5
  int count = 0;       
6
 
7
  Serial.begin (9600);
8
  Wire.begin();
9
  Serial.println ("I2C-Bus-Scanner");
10
11
  Wire.setClock(100000L);
12
  Serial.println("Scan mit 100 kHz");
13
  scan();
14
  Wire.setClock(400000L);
15
  Serial.println("Scan mit 400 kHz");
16
  scan();
17
  }
18
 
19
void scan(void)
20
  {
21
  int count = 0;
22
23
  for (int i = 0; i < 128; i++)
24
    {
25
    Wire.beginTransmission(i);
26
   
27
    if (Wire.endTransmission () == 0)
28
      { /* gefunden */
29
      Serial.print ("ID = ");
30
      Serial.print (" 0x");     
31
      Serial.println(i, HEX);
32
      count++;   
33
      }
34
    delay (20);
35
    }
36
  Serial.print (count);
37
  Serial.println (" Devices gefunden\n");   
38
  }
39
 
40
void loop()
41
  {
42
 
43
  }

2. I considered also to use the SPI interface. But there are no CS and 
no pin to connect MOSI on the ADC (see datasheet page9). The alternative 
solution for CS pin is explained in data sheet as following: " To chip 
select the AD7893 in systems where more than one device is connected to 
the 68HC11's serial port, a port bit, configured as an output from one 
of the 68HC11's parallel ports, can be used to gate on or off the serial 
clock to the AD7893. A simple AND function on this port bit and the 
serial clock from the 68HC11 will provide this function. The port bit 
should be high to select the AD7893 and low when it is not selected. "; 
I tried to figure out how to realize the AND function but its not even 
clear for me if this is related to HW or SW yet.

I hope the problem is formulated detailed enough, if its not the case 
pls let me know. every hint is appreciated :)

von stefanus (Guest)


Rate this post
useful
not useful
Matt wrote:
> The TWI adress of the ADC component is not avialable in Datasheet.

This ADC does not have a TWI (I²C) interface!

According to Figure 3 and the explanations above, you need to start the 
conversation by a third wire (CONVST), then wait a while before reading 
out the data. To read out the data you need to send 16 clock pulses and 
read in the data bits (while the clock is low).

von stefanus (Guest)


Rate this post
useful
not useful
> I considered also to use the SPI interface.

To think this is possible by sending out 2 bytes via an unused MOSI 
wire.

Connect MISO and SCK to the ADC and also connect another general purpose 
write to CONVST. However due to the timing requirements I assume that 
using the SPI peripheral does not provide any benefit compared to 
bit-banging by a small 16-step for-loop.

von Mathias M. (matt4)


Rate this post
useful
not useful
Hi, thanks a lot for the hints.

This part in datasheet did let me belive it works with twi: "The AD7893 
provides a two-wire serial interface that can be used for connection to 
the serial ports of DSP processors and microcontrollers."

For spi , do you have a hint how to choose the ADCs by µC, thus there is 
no cs pin and there are 2 ADCS.

yours,

: Edited by User
von Roman (Guest)


Rate this post
useful
not useful
Добрый день.
Можно поинтересоваться, получилось у Вас выполнить подключение и извлечь 
правильные данные.
Можете поделится готовы скетчем?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.