Getting Exception Using MicroLiquid Crystal Library
#1
Posted 28 June 2011 - 02:21 PM
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
Posted 28 June 2011 - 02:58 PM
#3
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
Posted 28 June 2011 - 04:29 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#5
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
Posted 28 June 2011 - 08:03 PM
That's correct!I imagine that using UART1 or UART2 or I2C devices will have a similar behavior.
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users