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

Getting Exception Using MicroLiquid Crystal Library


  • Please log in to reply
5 replies to this topic

#1 cjc

cjc

    New Member

  • Members
  • Pip
  • 6 posts

Posted 28 June 2011 - 02:21 PM

I wired up an LCD to my Netduino just like Szymon's great example here and everything was good. Of course this is just the start of a larger project, and I like my pinouts all neat and logical so rather than hook it up to pin 10, 11 and 13, I wanted to use 11, 12, 13.

No dice - the library throws general system exception when trying to create the output port. Then I thought it had something to do with the type of pin - so I tried a number of others: 9, 5 and 2 all work.

Any obvious problems here?

Fails:
var lcdProvider = new Shifter74Hc595LiquidCrystalTransferProvider(SPI_Devices.SPI1,
SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D12);

Works:
var lcdProvider = new Shifter74Hc595LiquidCrystalTransferProvider(SPI_Devices.SPI1,
SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D10);

var lcdProvider = new Shifter74Hc595LiquidCrystalTransferProvider(SPI_Devices.SPI1,
SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D9);

var lcdProvider = new Shifter74Hc595LiquidCrystalTransferProvider(SPI_Devices.SPI1,
SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D5;

var lcdProvider = new Shifter74Hc595LiquidCrystalTransferProvider(SPI_Devices.SPI1,
SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D2;

Thanks,
Corey

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 28 June 2011 - 02:58 PM

If I remember well the D12 is used as SPI input, thus cannot be used as general purpose pin. That when you're using the SPI, however. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 cjc

cjc

    New Member

  • Members
  • Pip
  • 6 posts

Posted 28 June 2011 - 04:00 PM

If I remember well the D12 is used as SPI input, thus cannot be used as general purpose pin. That when you're using the SPI, however.
Cheers


Thanks Mario - I suspected that might be the case but I haven't run across any documentation that indicates that is how things work. (is this also the case for the other special purpose pins??? when does it happen?) Hoping that someone can explain the behavior definitively. I thought that because Pin 12 isn't actually declared for use in the app, you could use it for general purpose...

Cheers,
Corey

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 28 June 2011 - 04:29 PM

Hi cjc, There are several pins with multiple features. Actually pin 4 is the only one which hasn't got special features (yet!). For a complete list, see http://www.netduino....duino/specs.htm SPI is also explained a bit at http://wiki.netduino.com/SPI.ashx
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 cjc

cjc

    New Member

  • Members
  • Pip
  • 6 posts

Posted 28 June 2011 - 05:03 PM

Hi cjc,

There are several pins with multiple features. Actually pin 4 is the only one which hasn't got special features (yet!). For a complete list, see http://www.netduino....duino/specs.htm

SPI is also explained a bit at http://wiki.netduino.com/SPI.ashx


Thanks Stefan - now it makes sense. I was reading "SPI_Devices.SPI1" as a single pin (hadn't decided if it meant 11 or 13...), but now I get that it is the 3-pin "set" of 11, 12, 13 - thus declaring pin 12 as "used". I imagine that using UART1 or UART2 or I2C devices will have a similar behavior.

Cheers,
Corey

#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 28 June 2011 - 08:03 PM

I imagine that using UART1 or UART2 or I2C devices will have a similar behavior.

That's correct!
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs




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.