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.
Photo

Upgrading from N+1 to N+2


  • Please log in to reply
11 replies to this topic

#1 Rik P.

Rik P.

    Member

  • Members
  • PipPip
  • 18 posts

Posted 08 February 2014 - 11:23 AM

Hello all

 

Having spent a few hours reading through the forums this morning, I can see that I don't appear to be the only one who has issues trying to upgrade from N+1 to N+2. My project also uses I2C, which seems to be causing some people issues, too.

 

For me, simply swapping from the N+1 board to the N+2, targeting MF SDK 4.2 caused I2C to quit working.

 

Can someone please clarify what version of the N+2 firmware correctly supports I2C, and what references they have in their solution? I've read a few conflicting posts and now my brain (and my project) are just fried. All I want my shiny new N+2 board to do is ... work :)

 

Thanks,

Rik.


---
Twitter: @rikp


#2 Rik P.

Rik P.

    Member

  • Members
  • PipPip
  • 18 posts

Posted 08 February 2014 - 11:56 AM

Just to add as well, I don't have access to any advanced diagnostic equipment to be able to check the state of the I2C lines. I have already moved to the SD/SC pins on N+2, vs. A4/A5 on N+1.

---
Twitter: @rikp


#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 February 2014 - 04:47 AM

Hi Rik, Hmm, sorry for the troubles. If you plug your I2C devices into SDA/SCL (adding the appropriate pull-ups externally) then your code and project should "just work." We had some I2C glitches in very, very early versions of the Netduino gen2 firmware back in 2012--but don't have any repros in our system now for I2C-related bugs. If there's another glitch out there though, we're here to fix it. For your project...can you please verify that you moved the pull-up resistors as well as the data pins? And that SDA/SCL aren't connected backwards? If all of that is correct, I would try creating a simple I2C solution and diagnosing from something simple first. Our goal with Netduino gen2 is to have as-close-to-100%-compatibility with gen1 projects as possible. With the I2C move on the Arduino R3 pinout that does complicate things a tiny bit--but it also helps keep things consistent for shields moving forward. Chris

#4 korbai

korbai

    Member

  • Members
  • PipPip
  • 17 posts

Posted 09 February 2014 - 09:00 AM

Hello,

 

Some I2C chip works for me with N+2, but for example PCF8574 does not work.

I tried newer and newer firmware but exactly the same. So I gave up.

N1 and N+1 works well but those was too restricted for me,

so I changed to Raspberry PI, and it works well, too.

 

Regards,

Zoltan



#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 February 2014 - 04:04 PM

Hi Zoltan, If you have more details about your PCF8574 project (schematics, code, etc.) we'd love to dig into it with you. We're using I2C extensively here, mostly on new Cortex-based boards. I2C is pretty standard but if we can repro an issue we can help identify the problem. [And if there is a bug in the firmware, we can patch it.] Chris

#6 korbai

korbai

    Member

  • Members
  • PipPip
  • 17 posts

Posted 09 February 2014 - 06:00 PM

Hi Chris,

 

I sent a repro for you in this thread:

http://forums.netdui...ge-3#entry42435

 

But I dit not get any response. After that I test some newer firmwares,

but I got the very same results.

Again it works under Netduino 1 and Plus 1.

 

(I used Netduino 1 for my home heating control, 

it worked two years without any problem in 24/7.

So I am rather sure my software is good.

But I cannot use with Netduino Plus 2).

 

Regards,

Zoltan



#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 February 2014 - 12:32 AM

Hi Zoltan, Hmm, very interesting. Based on your finding that 5V pull-ups worked but 3.3V pull-ups only work when you're under the debugger, I'm guessing that there's a timing issue related to the pull-ups. Did you try lowering the value on the 3.3V pull-ups? I wish we had extra logic analyzers we could lend out...or that you had a schematic for and photo of the project. We're here to help, and we can help best when we can consistently reproduce the issue. If you have time to circle back to the project, please start a thread on it and we'll see what we can do to guide you through to a resolution. Chris

#8 korbai

korbai

    Member

  • Members
  • PipPip
  • 17 posts

Posted 10 February 2014 - 07:23 AM

Hi Chris,

 

I did test not only my project but on a simple breadboard with a PCF8574.

I cannot beleive, too, I changed a lot N1 and N2, but it was consistent.

 

Regards,

Zoltan



#9 Rik P.

Rik P.

    Member

  • Members
  • PipPip
  • 18 posts

Posted 10 February 2014 - 08:10 AM

Hi Chris,

 

Thanks for your reply. Just to confirm, I have the data lines the correct way around, but you have asked about "moving the pull up resistors as well", but I can't find any docs that state where/why they need to move? Can you be more specific?

 

Also, I've actually got a very small test project to repro this based on a SparkFun I2C sensor board...

 

Thanks,

Rik.


---
Twitter: @rikp


#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 February 2014 - 10:07 AM

Hi Rik,

Thanks for your reply. Just to confirm, I have the data lines the correct way around, but you have asked about "moving the pull up resistors as well", but I can't find any docs that state where/why they need to move? Can you be more specific?

I2C works by driving voltage low on a data line. So you need pull-up resistors on the SDA and SCL line which are sized for the voltage you choose for I2C (5V or 3.3V), length of I2C bus lines and number of devices on the bus. Typically a value like 2.2K pulled up to 3.3V should work. So if you move the data lines from A4/A5, you'll want to make sure to move the I2C pull-ups as well.

Also, I've actually got a very small test project to repro this based on a SparkFun I2C sensor board...

I love repros :) With repros, we can dig in, analyze and make things better. Out of curiosity...which sensor board? Chris

#11 Rik P.

Rik P.

    Member

  • Members
  • PipPip
  • 18 posts

Posted 14 February 2014 - 03:14 PM

Hi Chris,

 

I had actually swapped the pins and moved the pull ups, however previously on N+1 I used pull ups to 5V.

 

To get this working on N+2, I had to change from 5V pull ups to 3V3, though maybe this is to do with my resistor values - which I've kept the same, at 12KOhm.

 

Would you recommend different resistors?

 

Thanks,

Richard.


---
Twitter: @rikp


#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 February 2014 - 12:13 AM

Hi Richard,  

I had actually swapped the pins and moved the pull ups, however previously on N+1 I used pull ups to 5V.   To get this working on N+2, I had to change from 5V pull ups to 3V3, though maybe this is to do with my resistor values - which I've kept the same, at 12KOhm.   Would you recommend different resistors?

12K (kilohm) is pretty weak as far as I2C resistors go. And you'll want different values when using 3.3V vs. 5V. I would recommend trying 2.2 kilohm resistors; that's a pretty common resistor value for 3.3V I2C. Chris P.S. You can get away with slower I2C on weaker resistors. The faster the communication required, the stronger (lower ohm value) you need for pull-up resistors. The stronger pull-up resistors return the signal to high faster; with weaker pull-ups you can get false low values when the signal voltage hasn't yet returned to high.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.