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.

AD7730 Implementation

Status
Not open for further replies.

ossroosh

Newbie level 4
Joined
Jun 1, 2007
Messages
7
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Activity points
1,393
ad7730 bascom

Hi,

In a weigh scale project, I've encountered a strange problem. I've employed AD7730BNZ, ATmega32 and RS-232 serial interface to construst a logging system. In search on the net I found that somone else have had excactly my problem with AD7730 implementation. Here it is:
"I am using an AD7730BN and a strain-gauge with sensitivity 2mV/V, so the input voltage range is -0..10mV with 5V excitation. Active channel: IN1+AIN1-;

After setting up DAC and FILTER regs, applying full-scale int. calibration, the content of the gain register is insignificantly changed, but after 0-scale int. calibration, the content of the offset register is 800000 - as before calibration. After that the part is set in continuous convertion mode. After each falling edge of RDY, the data register is read, but it always is FFFFFF, independently of the input range, chop/nonchop mode or any other settings. The contents of DATA reg is FFFFFF even on the beginning - after raising edge on RESET.
Does it seem the part is demaged or is there something, that I shall take care of? I suspected that the data register was latched-up due to the power sequencing (DVDD and the system digital circuitry is powered up before AVDD), however, I used 47ohm resistors in serial with all digital inputs/outputs to avoid excessive currents. Maybe it is not enough?"
There was an suggest but unsufficint:
"AD7730 AVDD can be turned on after DVDD. In my design AVDD (5V) is turned-off in power-minimizing mode and turned-on again, when key is pressed(VDD=3.6V). All IO wires are trough 470 Ohms passed. In my oldest design no resistors are used (but AVDD is tied to DVDD=5V). In oldest design
i have one (i cannot remember what exectly) problem with ADC and decision was : DATALINEtoADC was drived to low, even
when data is readed ( trough otrher dataline). I do not why,
but in default design this code is not nessesary.
Another thing - in weighscale , which we produce, selfcalibrating of ADC is not used ( i can't remember why).
Latching (and preheating ) of chip i have see , when AGND is
not tied to DGND."

What would you suggest?Is there anybody, who would help me?
 

ad7730

hi,

when i was developing this weighing scale project at first i was also getting FFFF, but after some checking in software it seems that ad7730 was working but i was unable to get data via software: it was a softwire problem......


may be you check the software......................................



arnab/vu2bpw
 
  • Like
Reactions: wsurferw

    ossroosh

    Points: 2
    Helpful Answer Positive Rating

    wsurferw

    Points: 2
    Helpful Answer Positive Rating
$regfile = m32def.dat +ad7730

Arnab, thank you very much for your reply!

I think you're right. In the last few days I've been working on the firmware. As a solution that resulted in a better performance and less latch-up, I removed the CALIBRATION codes (I don't know whether it's a good work or not, but anyway necessary!). I then added watchdog related instructions to it, instead. I also imparted some lines to reset the ADC when getting FFFF. Now, it seems to work somehow satisfactorily!

But, I don't know yet if the latch-up of AD7730s is a natural problem that must be anyway considered in the firmware or something else?!! Can a bad instruction cause this latch-up? I am sure, as you said, it's not a hardware problem.

Here's the program I've written in BASCOM-AVR:

$regfile = "M32def.dat"
' Define used crystal
$crystal = 4915200 ' 4.915200 MHz
$baud = 9600

Config Serialin = Buffered , Size = 25
Config Serialout = Buffered , Size = 25

' Configure the SPI hardware SPCR register
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 1 , Noss = 1 , Clockrate = 128
' Init the SPI pins directly after the CONFIG SPI statement
Spiinit
' Configure Watchdog
Config Watchdog = 1024
' Configure RDY as Input
Config Pinb.0 = Input ' RDY line

Dim Msb As Byte
Dim Lsb As Byte
Dim Weight As Word
Dim X As Byte

Start Watchdog ' Start Watchdog
' Set-Up AD7730 for Continuous Conversion and Continuous Read Operation
Initad7730:
' Write 32 ones with DIN High will reset the AD7730 to the default state
Set Portb.5 ' Set DIN Line of AD7730 High
' Write 32 serial clock cycles with DIN high to return the AD7730 to the default state by resetting the part
X = &HFF
Spiout X , 1 '
Spiout X , 1 '
Spiout X , 1 '
Spiout X , 1 '

' Write to Communication Register Setting Next Operation as write to Filter Register
X = &H03
Spiout X , 1 '
X = &B10000000
Spiout X , 1 ' Writes to Filter Register Setting a 50 Hz Output Rate , CHOP Mode Disabled, FASTStep Mode Enabled
X = &B00000001
Spiout X , 1 '
X = &B00000000
Spiout X , 1 '

' Write to Communications Register Setting Next Operation as write to DAC Register
X = &H04
Spiout X , 1
X = &B00000000
Spiout X , 1 ' Write to Mode Register for adding 0mV to the analog input



Ffffff:
' Write to Communications Register Setting Next Operation as write to Mode Register
X = &H02
Spiout X , 1
X = &B00110000
Spiout X , 1 ' Write to mode register starting continuous conversion for 0mV to +10mV input range, Unipolar, 16 bit data word and 2.5V reference, Channel 1
X = &B00000000
Spiout X , 1



' Write to Communications Register Setting Next Operation as Continuous Read From Data Register
X = &H21
Spiout X , 1

Reset Portb.5 ' Set DIN Line of AD7730 Low (Ensures Part is not Reset While in Continuous Read Mode)

Read_data:
Waitms 200 ' Make a delay time as 200ms
If Pinb.0 = 1 Then Goto Read_data ' Wait for RDY Low (Wait for RDY pin to go low to Indicate Output Update)
Reset Watchdog

' Read 16-Bit Data From Serial Port (Read Conversion Result from AD7730's Data Register)
Spiin Msb , 1
Spiin Lsb , 1
Weight = Makeint(lsb , Msb)


If Weight > 60000 Then
Goto Initad7730 ' Check For Latching-up
End If


' Send 16-Bit Data to PC
Print " A" ; Weight;

Goto Read_data

End
 
bascom ad7730

give me ur email id, i may send u my code..........................

also mension that wher u live????(country)


arnab/vu2bpw
 

    ossroosh

    Points: 2
    Helpful Answer Positive Rating
ad7730 spi

Can you put codes here please?
I'm using ad7738 i think they are similar devices.
 
ad7730 full scale

i get 40 mv output when i connetc an0 to gnd.Do i need to calibrate AD7738? and how can i do it?
 

ad7730 implementation

Hi dear friends
I'm working on ad7730BN
But i have a problem , and thats , the RDY line never goes low . . .
What the problem is supposed to be ???
Thanks
 

ad7730 filtri

ossroosh said:
Hi,

In a weigh scale project, I've encountered a strange problem. I've employed AD7730BNZ, ATmega32 and RS-232 serial interface to construst a logging system. In search on the net I found that somone else have had excactly my problem with AD7730 implementation. Here it is:
"I am using an AD7730BN and a strain-gauge with sensitivity 2mV/V, so the input voltage range is -0..10mV with 5V excitation. Active channel: IN1+AIN1-;

After setting up DAC and FILTER regs, applying full-scale int. calibration, the content of the gain register is insignificantly changed, but after 0-scale int. calibration, the content of the offset register is 800000 - as before calibration. After that the part is set in continuous convertion mode. After each falling edge of RDY, the data register is read, but it always is FFFFFF, independently of the input range, chop/nonchop mode or any other settings. The contents of DATA reg is FFFFFF even on the beginning - after raising edge on RESET.
Does it seem the part is demaged or is there something, that I shall take care of? I suspected that the data register was latched-up due to the power sequencing (DVDD and the system digital circuitry is powered up before AVDD), however, I used 47ohm resistors in serial with all digital inputs/outputs to avoid excessive currents. Maybe it is not enough?"
There was an suggest but unsufficint:
"AD7730 AVDD can be turned on after DVDD. In my design AVDD (5V) is turned-off in power-minimizing mode and turned-on again, when key is pressed(VDD=3.6V). All IO wires are trough 470 Ohms passed. In my oldest design no resistors are used (but AVDD is tied to DVDD=5V). In oldest design
i have one (i cannot remember what exectly) problem with ADC and decision was : DATALINEtoADC was drived to low, even
when data is readed ( trough otrher dataline). I do not why,
but in default design this code is not nessesary.
Another thing - in weighscale , which we produce, selfcalibrating of ADC is not used ( i can't remember why).
Latching (and preheating ) of chip i have see , when AGND is
not tied to DGND."

What would you suggest?Is there anybody, who would help me?

Hi,
I am also thinking that is a software problem! I encountered the same problem some times ago, and the SPI routines doesn't work properly! For this project i used atmega8535 and the spi feature of the controller, which didn't worked fine! That's why i implemented by hand the spi routine and everything worked fine after that!

Aurelian
 

Hi
I want config AD7730 in 1.2KHz.
Ho do my want?
 

Hello,
i am working with AD7730 and i got 15 bits noise free resolution
but i have problem with the repeat ability
some times i get 5000 kg and after some changes the same 5000 will be 5005 and maybe 50010 so what the problem with than you think ?
i am using ina118 as signal amp and put the ad7730 at 80 mV input
CAN u put your bascom code here ?
thanks
 

Re: bascom ad7730

give me ur email id, i may send u my code..........................

also mension that wher u live????(country)


arnab/vu2bpw

hi dear friend ,
i'm trying to make system for waightening system .
i'm using AVR atmega16 and AD7730 But i have some problem with this part is spi mode.
i'm recieving FFFF all time inattentive the the singnal in analoge input .
i'm using bascom for programming language .
can you help me in this issue .
i can use it in my project as a pilot .
thanks in advance ,

Nima ,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top