Pages: [1]   Go Down
Author Topic: I2C fails Using UNO and LTC6904 module  (Read 1218 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This problem occurs with the Arduino UNO and a oscillator module I2C-OSC. I2C is used to send a two-byte count to the oscillator module. The count controls the output frequency. At times the count does not seem to get to the module.

The included program sends the maximum count to the module, then delays for several seconds, and then sends the minimum count to the module. The max count is often set successfully, but the min count is not. I have to power the module down and up and then push the UNO reset button to change from the max count. Sometimes the oscillator output is shutdown altogether.

Wire.endTransmission() returns: 2=NACK on address transmission, 3=NACK on data transmission, and 4=Other Error, with the NACK on data transmission being more frequent. With the 2 changes, the results are in pairs: sometimes 4 and 2, and 2 and 3. Sometimes 2 is the only error response.
How does one diagnose this?

On the other hand, The 2nd attached programs (I2C_OSCDecimalFreqSetter.ino) never shows an I2C error

Documentation:
See http://www.gravitech.us/i2c1kto68pro.html
and find the User Manual and data sheet for the LTC6904 chip on which the module is based.
The data format is described in the data sheet.
I have attached the Arduino program that I'm using to test the set-up, and the schematic for the module itself.
I'm using the Arduino 1.0.1 IDE.
I have an oscilloscope.

* I2CSendTest3.ino (1.74 KB - downloaded 20 times.)
* I2C-OSC_Schematic.pdf (25.73 KB - downloaded 26 times.)
* I2CStopsHyperTermOutput.txt (0.15 KB - downloaded 20 times.)
* I2C_OSCDecimalFreqSetter.ino (0.99 KB - downloaded 17 times.)
« Last Edit: February 13, 2013, 05:30:29 pm by louarnold » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the debugging output from the sketch that works?
Logged


Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Power Supply Bypass

In order to obtain the accuracies represented in this datasheet, it is necessary to provide excellent bypass on the power supply. Adequate bypass is a 1μF capacitor in parallel with a 0.01μF capacitor connected within a few millimeters of the power supply leads.

Do you have those components installed?
Logged


Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are the pull-ups on the I2C-OSC module enabled (they have switches in the schematics).
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Nick Gammon
The debug output from the I2C_OSCDecimalFreqSetter.ino sketch is:
18.0490
42
88
The first is the frequency to set and the next two are the high (first) and low (second) bytes sent to the module. The frequency is set in the program, and the two bytes are calculated from that frequency. The scope measures a frequency of 18.0053 KHz. Once the program is the UNO, you can press the reset button any time and you won't get an error output from the program.

The module gets its power from the UNO board. The filtering shown on the schematic exists on the module's PCB. I think the problem is more with I2C than hardware. I have problems changing the frequency, but once set the frequency is stable and accurate.

@pylon:
I bought the board already assembled. The schematic shows switches but they are, in fact, soldered:
- OE Enabled.
- Pull-up resistors as on the schematic.
- ADR=GND => I2C address is 0x2E.
- Green power-on LED enabled.

« Last Edit: February 14, 2013, 05:56:25 pm by louarnold » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm just wondering if 0xFF and 0xFE (from your other debugging) is out of range for the device.
Logged


Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm just wondering if 0xFF and 0xFE (from your other debugging) is out of range for the device.
I tried a slightly modified "I2C_OSCDecimalFreqSetter" sketch that sends out only FF and FE, the count for 68MHz. When all went well, the scope showed a frequency of 67.3MHz. When it failed, it gave a Wire.endTransmission() error of 3 or 4.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So the frequency is influencing the results?
Logged


Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the frequency is influencing the results?
Hmmmm. You chose wording that implies that the oscillator frequency affects the success of I2C; that the frequency interferes with the I2C communication. I don't know how to respond to that.

I guess I can freq hop to see at what point the interference starts, but once achieved, how does one shield the low-freq side from the hi-side. The board is quite small and so those two sides are in close proximity. Is the solution to connect the output to coax? The output will handle only a 15 pf capacitive load.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The original (working) sketch does one frequency change. Yours does two. The working sketch seems to select a different frequency to the problem sketch.

I am hypothesizing that either the second change, or the different frequency, is causing problems.
Logged


Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The original (working) sketch does one frequency change. Yours does two. The working sketch seems to select a different frequency to the problem sketch.

I am hypothesizing that either the second change, or the different frequency, is causing problems.
The problem sketch is only the attached one now. It sets one frequency - 68MHz - and then generates errors when trying to set the same frequency thereafter. Although I thought the problem was only with I2C, we have now enlarged the problem to include RF interference, but have yet to definitively prove its cause. How do I do that?

Another trial: I had the attached program send out 00 00. The frequency changed to 63MHz without an error, and repeated settings to the same count caused Error 2. The frequency remained at 63MHz.

BTW: the ".ino" files can be opened by a text editor; one doesn't need the Arduino IDE.

* I2C_OSCDecimalFreqSetter2.ino (0.77 KB - downloaded 13 times.)
« Last Edit: February 16, 2013, 02:07:03 am by louarnold » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 129
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well..I still don't know what to do with these problems. How do I prove which is causing the problem?
Logged

Pages: [1]   Go Up
Jump to: