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

mcp 23017 help


Best Answer Paul Newton, 05 April 2013 - 02:28 PM

Hi Cory, Welcome to the forums! You said that you have a Netduino plus "v2". On the V2's the I2C pins have been moved, they are no longer A4 & A5. In your diagram you show the old v1 A4 & A5 in use. Hopefully that's the problem (because its a simple one!) Paul Go to the full post


  • Please log in to reply
5 replies to this topic

#1 corythompson

corythompson

    New Member

  • Members
  • Pip
  • 6 posts

Posted 04 April 2013 - 10:48 PM

Hi all.

 

I'm new to netduino's I have a Netduino Plus 2 and wanted to expand the I/O ports.

I have wired the mcp23017 up like the image and have this simple code to test it bu only the on board led flashes and not the one on pin 7 of the mcp23017. where am I going wrong?

 

Thanks.

 

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using Toolbox.NETMF.Hardware;

namespace NetduinoApplication6
{
  public class Program
  {
  public static void Main()
  {
  Mcp23017 Mux = new Mcp23017();
  OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);

  while (true)
  {
  Mux.Pins[7].Write(true);
  Thread.Sleep(250);
  Mux.Pins[7].Write(false);
  Thread.Sleep(250);
  led.Write(true);
  Thread.Sleep(250);
  led.Write(false);
  Thread.Sleep(250);
  }
  }
  }
}

Posted Image



#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 05 April 2013 - 10:07 AM

where did you specify its address?



#3 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 05 April 2013 - 10:11 AM

ah i looked closer at the source from toolbox.

http://netmftoolbox....ailable classes

thats how you hook it up, seems correct.

 

you than have to specify its pin as outputs with: PinMode([color=rgb(0,0,255);]int[/color] Pin, [color=rgb(0,0,255);]bool[/color] Output)

than you can use: SetPin([color=rgb(0,0,255);]int[/color] Pin, [color=rgb(0,0,255);]bool[/color] Value)

 

http://netmftoolbox....ew/23314#354279



#4 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 05 April 2013 - 02:28 PM   Best Answer

Hi Cory, Welcome to the forums! You said that you have a Netduino plus "v2". On the V2's the I2C pins have been moved, they are no longer A4 & A5. In your diagram you show the old v1 A4 & A5 in use. Hopefully that's the problem (because its a simple one!) Paul

#5 corythompson

corythompson

    New Member

  • Members
  • Pip
  • 6 posts

Posted 05 April 2013 - 05:12 PM

Hi Cory, Welcome to the forums! You said that you have a Netduino plus "v2". On the V2's the I2C pins have been moved, they are no longer A4 & A5. In your diagram you show the old v1 A4 & A5 in use. Hopefully that's the problem (because its a simple one!) Paul

Thanks Paul.

 

Got it working



#6 corythompson

corythompson

    New Member

  • Members
  • Pip
  • 6 posts

Posted 06 April 2013 - 05:08 PM

I'm looking for ways to connecet multiple mcp23017's but google isn't helping much today.

How would I specify the second 23017 in code? I have 2 wired up but obviously a command to 1 will send the command to both.

 

Thanks






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.