Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.


Member Since 16 Jul 2012
Offline Last Active Nov 26 2017 01:02 PM

Topics I've Started

false interupt triggering

07 May 2013 - 09:04 AM

i cant understand what is going on here and was wondering if someone could help me.


I've setup 2 two inputs to interrupt on ports D0 & D1

BallTrigOdd = new InterruptPort(NPIO.BallTrigOdd, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);BallTrigOdd.OnInterrupt += new NativeEventHandler(BallTrigOdd_OnInterrupt);BallTrigOdd.EnableInterrupt();BallTrigEven = new InterruptPort(NPIO.BallTrigEven, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);BallTrigEven.OnInterrupt += new NativeEventHandler(BallTrigEven_OnInterrupt);BallTrigEven.EnableInterrupt();
        private void BallTrigEven_OnInterrupt(uint data1, uint data2, DateTime time)        {            BallTrigEven.DisableInterrupt();            UpdateStatus(id.odd);            Cycle(id.even);            ballData.Lanes[(int)id.even].Data = (int)TestScores.Seven;            BallTrigEven.EnableInterrupt();        }        private void BallTrigOdd_OnInterrupt(uint data1, uint data2, DateTime time)        {            BallTrigOdd.DisableInterrupt();            UpdateStatus(id.even);            Cycle(id.odd);            ballData.Lanes[(int)id.even].Data = (int)TestScores.Seven;            BallTrigOdd.EnableInterrupt();        }

but for some reason it just keeps triggering and gets stuck in a loop. Is there something I'm doing wrong?

detecting a AC voltage

03 April 2013 - 03:42 PM

I need to monitor a state of some 28VAC lines.


Hows the best way to do this?


I know i need a full bridge, some smoothing and a opto coupler but the bit inbetween the smoothing and opto im stuck on.

High Speed Cameras

28 March 2013 - 03:28 PM

Has anyone got any experience capturing images at high speed?


The current camera we are using can take an image heavily compressed @ 320 x 240 and transfer the image in about over a second via a TTL serial interface.


I need a camera at a resolution of at least 640 x 320 and the transfer rate of well under a second. Any help would be very much appreciated :)

MCP23017 Interrupts

25 March 2013 - 02:37 PM

I can do basic IO on this chip without any issues but can i get the interrupt to work, no. Been at it for a few days and im not making any progress, please help!!!!


Hardware setup:

NP2+, clk & data lines have pull up resistors, 2 leds on the output of the mcp chip. 2 simple switch for the input with pull up resistors which is shorted to ground when switched. INTA on the mcp has a direct connection to the NP2+ to DIO0.


private void SetupPort(Port port){byte IODIA = IODIRA;byte IOCONAddress = IOCON;byte GPINTENAddress = GPINTENA;byte INTCONAddress = INTCONA;byte INTCAPAddress = INTCAPA;byte DEFVALAddress = DEFVALA;if (port == Port.PortB){IODIA = IODIRB;GPINTENAddress = GPINTENB;INTCONAddress = INTCONB;INTCAPAddress = INTCAPB;DEFVALAddress = DEFVALB;}// I/O expander configuration 1010 0000this.device.Write(new byte[] { IOCONAddress, 0xA0 });// Interrupt on change pin 00001111 first 4 are enabled only cus they are inputsthis.device.Write(new byte[] { GPINTENAddress, 0x0F });// default value to compare before the interrupt hitsthis.device.Write(new byte[] { DEFVALAddress, 0x0F });// Interrupt on change control reg, interrupts on default valuethis.device.Write(new byte[] { INTCONAddress, 0x0F });// clear the interupt capture regbyte[] ReadBuffer = new byte[] { INTCAPAddress };this.device.Read(ReadBuffer);// Direction register 11110000 first 4 are outputs and the rest are inputsthis.device.Write(new byte[] { IODIA, 0xF0 });// set outputs to 0//SetIOPort(port, 0);}


basicaly the setup is the first 4 bits to be inputs (interrupt driven) and the next 4 bits as outputs.


ive configured to only go high when it receives a high level from the input.


Its not working at all.

Creating Log Files.

06 March 2013 - 02:51 PM

I've a log file which i append to every so often. (Thats the easy bit)


What i want to do is if its gets above a certain size then delete the old 1 st line before add the latest line to the bottom of the file.


Is there a way of doing this? i cant exactly read the whole file as i will run out memory :(

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.