Hi,
I have the exact problem with spi communication that is answered here: http://e2e.ti.com/support/data_converters/precision_data_converters/f/73/t/157512.aspx
With the exeption that Bellinger's problem went away when he trided with a fresh chip. I'm at number 3 and I get the sam scope output as he did over and over again. With the exeption that my DIN does not go tristate. I also measure straight from the pins.
It does not matter wheather I got the DIN connected or not, as long I connect the SCLK I get the same output.
Please help me out .
Kind regards
Peter
Hi Peter,
Welcome to the e2e Forum! I'm sorry to hear that you are having trouble with the ADS1118... Can you tell us if you are using one of our ADS1118EVMs or are you using your own hardware? If it is your own board, could you post a schematic and perhaps grab some screen shots like Bellinger did?
Regards,
Tom
Hello Tom. Thank you for your response. I will try to explain my setup.
I am working with my own design as a substrate for the ads1118, which I made for prototyping reasons. It is shown int the figure below. I am using a atmel avr328p to communicate with the chip.(I'm using the popular Arduino board)
I have the vcc and gnd connected to the regulated 5V (linear regulator) and GND of the Arduino. I've got the AVR running at 16MHz. The CLK, !CS, DI and DO pins are connected to the corresponding pins of the avr that offer hardware support for such communication. I have the spi clock to 16MHz/16 for the purpose of this mail, but I tried higher and lower speeds as well.Acording to the datasheet all below 4MHz should work.
I'm using cca 8cm long wires to connect my pcb to the microcontroler's.
I am cheating and using the arudino SPI library, which is just a wrapper for the avr-libc support for SPI communication. Anyways the signals I'm sending look ok on the scope, I got all the pins soldered seemingly well enough (no shorts at the DIP pins in my design, and all connections form the chip pins to the DIP pins are closed and all the signals look the same weather measured from the 1118's pins or the DIP pins of my breakout board). As I said I made 3 trials (three chips) with same results:
Here are the schematics and scope printouts:
WFN10 -> DIP package PCB, nothing remarkable here I hope.
Here
I'm here sending msb,lsb,msb,lsb where msb=0b10000001 and lsb=0b11111010; I tried many different combinatios of OS bits, conversion rates, operation modes...
I tried reading analog inputs (connected to gnd, 3.3V or 5V) as well as temperature readings. I always get the below bit pattern. Even if I disconect the DIN...which I gues goes low. LEGEND: clock yellow, DIN green
The result I always get; clock yellow, DOUT green
Only dout for clarity
I first thought this was a chip failure and bought two more but judging from the repeatibility of the symtoms I gues it must be sth more systematic.
Regards and thanks in advance. Please let me know if I need to provide more info.
Peter,
You need to make sure that your data in to the ADS1118 is stable on the negative going side of SCLK, as that is where the data gets latched. Review Figure 1 of the datasheet. Adjust your SPI polarity so data transitions on positive going edge of SCLK and remains stable on negative going edge. One other thing that may not be obvious is CS must remain low throughout the entire communication transaction.
Best regards,
Bob B
Thank you Bob. I forgot to mention that I have the CS tied to GND all the time. I belive I tried both polarities at some point but I will do that tommorow to be sure.
Kind regards and thanks for the very prompt help!
Yes, changing the polarity did the trick. I tried both polarities with the library I was using, but now I noticed that calling the function had no effect. I now changed the SPI control register of the atmega manually and it works! I wish I'd been more systematic in error elimination.
Thank you very much for helping me!