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

Reusing pins


  • Please log in to reply
4 replies to this topic

#1 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 14 May 2011 - 07:17 AM

Ok, making some progress. Following great forum advice, I now know how to use a dual-color LED, and I finally got my LCD screen working.

As a next step, I tried combining the 2 programs, completely forgetting the hardware side of things - both programs were using the same pin (D12)!
Of course, I found it the hard way, getting an exception thrown somewhere in the MicroLiquidCrystal code. I'm using a bread board, and thought I could just plug in the LED to a row connected to the pin, but the pin is already in use by the LCD.

Clearly, I'm missing a key piece in electronics, or hardware programming. The LCD, as wired now, uses almost all of the digital pins (2-12 - see post for list). I want to move forward and start wiring sensors, some LEDs, maybe a button or two. But if I can only have one leg connected to one pin - I'm out.

What do I need to do to be able to use the LCD as it is wired right now, but continue to add components? Do I have to use the analog pins? And what happens when they run out?

Thanks,
Guy

#2 Nevyn

Nevyn

    Advanced Member

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

Posted 14 May 2011 - 07:48 AM

What do I need to do to be able to use the LCD as it is wired right now, but continue to add components? Do I have to use the analog pins? And what happens when they run out?

Using the analog pins would certainly get you going for now. If you are keeping the LCD in this configuration then you will need to start looking at multiplexing. This should allow you to add more digital outputs.

It may be worth looking at using 74595 shift registers to control the LCD as this will reduce the number of pins you require. Szymon Kobalczyk has a blog post with some code.

You could also use the shift registers to give you more digital outputs (see Stefan's project) or use dedicated multiplexing chips.

Regards,
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


#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 14 May 2011 - 08:47 AM

Hello Guy. Mark is absolutely right. Driving a LCD in a parallel fashion is a waste of pins, and they are precious indeed! That's not all: consider seriously the tip of using the 74HC595 shift-register. By using it, you will take advantage of the SPI interface, having a dramatic increase of speed. Cheers
Biggest fault of Netduino? It runs by electricity.

#4 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 14 May 2011 - 08:30 PM

Hello Guy.
Mark is absolutely right.
Driving a LCD in a parallel fashion is a waste of pins, and they are precious indeed!
That's not all: consider seriously the tip of using the 74HC595 shift-register. By using it, you will take advantage of the SPI interface, having a dramatic increase of speed.
Cheers

Thanks Mark and Mario - I'll start diving into the 74HC595 shift-register right away. Found t on SparkFun already. Any other component I need to get to use it, just off the top of your head?

#5 Nevyn

Nevyn

    Advanced Member

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

Posted 15 May 2011 - 06:46 AM

Any other component I need to get to use it, just off the top of your head?

Nothing else really needed to use them as multiplexing chips. The switches and LEDs Stefan used were to demonstrate the output from the Netduino. Szymon used a few other components to add some control for a backlight - the component list is in the blog entry.

Glad to be of help,
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





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.