justinbobo - Viewing Profile: Posts - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

justinbobo

Member Since 26 Feb 2013
Offline Last Active Aug 04 2017 11:23 PM
-----

Posts I've Made

In Topic: N+2 I2C clock doesn't run

05 February 2015 - 11:26 PM

I tried the bitshifting thing--and it worked! But now I have a new problem.

 

If I bitshift the four addresses (for read/write and command/data) given, I get this:

 

0x78 = 0111 1000 >> 0011 1100 = 0x3C

0x79 = 0111 1001 >> 0011 1100 = 0x3C

0x7A = 0111 1010 >> 0011 1101 = 0x3D

0x7B = 0111 1011 >> 0011 1101 = 0x3D

 

The display does acknowledge when I send to 0x3C and 0x3D...but I need four addresses, not two.

 

I wrote a loop to cycle through every possible I2C address. Those are the only two addresses that acknowledge.

 

I emailed the company, and this was the response I got:

 

"your compiler seems to do things automatically. The last bis is for write and read operation (pelase compare with I²C bus sepcification, done by Philips)"

 

Not sure what to make of that. But it seems apparent that the display is ignoring the first address bit. Is there some simple way to tell the Netduino to throw in an extra bit at the beginning?

 

It also seems apparent that this is an issue with the display. The expander is supposed to be addressed at 0x20, and it acknowledges at that address while on the same bus running the same program. Why would the display's address require a bit-shift but the expander's wouldn't? Seems like it's a problem with the display.

 

I've attached two screen shots from my scope, both named by the address used in the program. You can see that Attached File  0x78.bmp   219.43KB   0 downloads doesn't acknowledge and thus transmission is canceled. Attached File  0x3c.bmp   219.43KB   0 downloads does acknowledge and so another byte is transmitted.

 

But when I look at the scope readings, 0x3C looks like 0x78 to me. My understanding of I2C is that the master pulls the data line low to signify START, then the clock starts. The data line is read when the clock line is high. When I'm using the address 0x3C in code, the first high clock pulse has the data line at low, and the next 4 clock cycles, it's high. That sounds like 0111... to me, not 0011...

 

But I'm obviously missing something. If you look at attached file Attached File  0x20.bmp   219.43KB   2 downloads, that's the same setup trying to talk to the MCP23008 expander, whose address is 0x20, or 0010 0000. Same deal--that one looks an awful lot like 0100... rather than 0010... But it is acknowledging anyway.

 

I'm totally stumped here. Anyone have any ideas?


In Topic: N+2 I2C clock doesn't run

02 February 2015 - 04:01 PM

Oh and one more thing. Browsing through these threads, I wasn't certain which firmware versions I2C works on. So for anyone out there with the same question, my code works fine on both 4.2.2.2 and 4.3.1.0. I don't need to jumper to A4/A5 for either firmware version.


In Topic: N+2 I2C clock doesn't run

02 February 2015 - 03:57 PM

Well, that problem is fixed...sort of. The problem was really stupid, but I figure I should mention it here in case it happens to anyone else.

 

The problem? Bad jumper wire between my Netduino and my breadboard. I figured it out when I tried to disconnect/reconnect it from the Netduino while the program was running. Just putting a slight amount of pressure on it as I was grabbing it made the clock line show up on my scope right away. Swapped the jumper wire and everything is good.

 

I still don't understand how it was able to pull the line low when I deliberately wrote that to the OutputPort, but not when it was trying to do I2C comm. That's why I never bothered to check my connections.

 

The display still doesn't work, but it's the display's problem, not the Netduino's. I figured out it's not throwing SDA high for the Acknowledge bit. I did dig up my MCP23008 and hooked that into the breadboard on the same bus as the display. Using the same code, but just changing the address to 0x20, it does acknowledge. So I know my I2C bus setup is fine, e.g., pullup sizes, hi/lo voltages, etc.

 

I emailed the company (EA) to ask if they had any ideas. I just got an email back. The only possibly helpful suggestion he had was to try bitshifting the address from 0x78 = 0111 1000 to 0x3C = 0011 1100.

 

(His other advice was to make sure I was running at 100 kHz and to make sure my bus levels were H > 0.85 VDD and L < 0.15 VDD, which they are.)

 

I'll try that out when I get to work and let you all know if it works.

 

Also, when (if?) I get this working on I2C, I'll post the class I wrote for the DOGXL160. Nothing fancy, but it does include all 36 functions from the UC1610 datasheet. Probably save a couple hours of coding if you wanted to do the same thing.

 

Justin


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.