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

Out of pins. Need advice on how to expand


  • Please log in to reply
10 replies to this topic

#1 jlever

jlever

    New Member

  • Members
  • Pip
  • 4 posts

Posted 12 February 2014 - 09:41 PM

I am working on a project that has exhausted most of the pins on my Netduino 1. I only have D2 and D12 now available. I would now like to drive several 7-segment LEDs. I realize that there are drivers out there that can accomplish this, but all that I have found require a 4-wire SPI. My question is this: What options are available to me to add an additional 'duino board (wether that be another Netduino, or Arduino), using only those digital pins that I have left? If I can hand off control of the LEDs to an additional microcontroller, that would be perfectly acceptable. I basically just need to pass a single digit to each of 8 7-segment displays.

 

Ideas are welcome. Thank you.



#2 jlever

jlever

    New Member

  • Members
  • Pip
  • 4 posts

Posted 13 February 2014 - 02:26 AM

Looks like one possibility (and perhaps the easiest) is to upgrade to the N2 so I have separate i2c pins and use a pair of i2c 7 segment drivers such ashttp://mbed.org/user...ent-led-driver/ That should do the trick nicely, though I have to admit to having never coded with i2c before.

#3 mjd

mjd

    New Member

  • Members
  • Pip
  • 7 posts

Posted 13 February 2014 - 02:37 AM

consider http://www.picaxe.com/ - easy to configure devices and program, interface via i2c or other serial if you can free up appropriate n/d pins



#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 13 February 2014 - 06:40 AM

If you are looking at outputs then a few forum members here use 74HC595's.

 

There is a relatively cheap chip with 16 I/Os: MCP23S17.  I've got one of these but not tried using it yet.  You can also get an I2C version of this chip.

 

You would need to consider moving some of your I/Os to these chips to free up enough pins for SPI/serial comms but they should both allow you to do that.

 

Hope this helps,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#5 jlever

jlever

    New Member

  • Members
  • Pip
  • 4 posts

Posted 13 February 2014 - 01:30 PM

Am I able to use D2 as an interrupt port if I'm using D3 as a UART TX? And can I use D12 (MISO) as an interrupt port as well? I seem to recall trying this already and couldn't make it work. If I could, that would free up A4 and A5 for i2c on the N1.



#6 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 18 February 2014 - 09:04 PM

If you are driving a bunch of 7 seg displays, one option to look at is using multiple MAX7219 chips. I have a project where I am running (6) 8x8 led matrix using only 3 pins on the Netduino 1 board. (pins 13, 11, and 8). I am using a MAX7219 per 8x8 matrix, but one MAX will control (8) 7 segment LEDs per chip. It uses 3 wire SPI to control the chips. Now the down side, if you need high speed updating, I am still trying to get that worked out. For slow speed updates (and I mean SLOW like 1 second or greater) I have the code on how to make it work and can share it with you.

#7 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 18 February 2014 - 09:05 PM

Hi,

 

I have a 32 port expander using 2 MCP23S17, I wonder if anyone has any examples of how to work with these chips and if anyone could confirm which netduino pins are associated with the following?

 

MOSI

MISO

SCK

CS

 

Many thanks,

 

Andy



#8 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 18 February 2014 - 09:25 PM

If memory serves, I have commented below the pin assignments. I am going off my SPI configuration I did for some MAX chips, and 13 is my data out, 11 is my clock, and 8 is my chip select. 12 I don't use since I don't have any data coming in.

MOSI = 13 MISO = 12 SCK = 11 CS = selectable



#9 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 18 February 2014 - 11:38 PM

Thanks that's great, would you power off the 5v or 3.3v rail? I am creating another stage after this of UL2803 to control some relays.

 

Out of interest, like the 595s are the MCPs prone to errors? For example with the help of Mario I used a stage to buffer the output of the 595s for long enough to reload the chip in case of errors, without affecting the output.

 

Many thanks

 

Andy



#10 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 19 February 2014 - 10:57 AM

I think this MCP23S17 driver class should interest you:

 

http://forums.netdui...17-io-expander/



#11 jlever

jlever

    New Member

  • Members
  • Pip
  • 4 posts

Posted 23 February 2014 - 02:53 PM

I've found a working solution. What I ended up doing was moving my project to an unused N2 that I had laying around. This gave me the dedicated SDA/SCL i2c pins to drive 8 Sparkfun OpenSegment displays. It's working rather beautifully in fact. I can update all 4 digits on all 8 displays in a fraction of a second. The update process is visible to the naked eye, but that's understandable considering the displays are driven off of an ATMEGA328 running Arduino bootloaders. I'm using phantomtypist's i2cbus class to build an array of OpenSegment objects, which I can then 'for' loop through in order to update them.






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.