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.

mcinnes01's Content

There have been 82 items by mcinnes01 (Search limited from 28-April 23)


By content type

See this member's


Sort by                Order  

#54169 Home Automation

Posted by mcinnes01 on 19 November 2013 - 10:10 AM in General Discussion

Yes all the automation will be hardwired back to my 2 main distribution boards. It uses a fair amount more cable than usual but just provides a much more maintainable approach when its all in. Sadly my once nicely plastered walls which I was hoping to not need to do, now all need replastering. That being said I wouldn't recommend this approach unless you are building a house from scratch or are doing a full on refurb.

 

On top of all the electrical cable I am also running a kilometre of network cable in. Again I have 2 racks, one by each distribution board that will house a 96 bay patch panel each and a 48 port POE switch. The plan is to run CAT5 every where for sensors and any distributed intelligence. For example some of the CAT5 although terminated to the patch panel will then split off to my own control boards to carry signals from sensors like PIRs, temperature sensors and perhaps even carry control voltages for things like actuators. One idea I've had is to either get electronic Radiator valves that I can retro fit or the slightly more invasive approach which is to fit valves inline with each radiator. This way I can use ternperature sensors and motion detectors as well as my own granular time patterns to control my central heating. 

 

What I am doing is running a lot of CAT5 everywhere, some in the ceilings some in the floors etc, a lot will be unterminated but there for when I want to use it. Also I have 2 gang RJ45 faceplates everywhere as I will be using CAT5 for phones, web connections etc etc.




#54270 Netduino Go! 4.3 firmware

Posted by mcinnes01 on 24 November 2013 - 02:50 PM in Beta Firmware and Drivers

Hi,

 

Is there any news on the Netduino Go! 4.3 firmware?

 

Many thanks,

 

Andy




#54278 Netduino Go! 4.3 firmware

Posted by mcinnes01 on 24 November 2013 - 09:17 PM in Beta Firmware and Drivers

Can we work with Netduino Go! in VS2012 or VS2013 currently?

 

Could you just go through what is required in terms of install, from the point of view of just having VS2012/13 installed and no NETMF or netduino sdk installed?

 

Can we still use 4.3 for standard netduino 1 with vs2012/13?

 

Many thanks,

 

Andy




#54468 Ethernet Module Update

Posted by mcinnes01 on 04 December 2013 - 07:56 PM in Netduino Go

Hi,

 

Chris is there a planned release date for 4.3QFE1?

 

Are there fixes in this next release of netmf that are holding the next release of Go! Bus up?

 

Many thanks,

 

Andy

 

PS Roll on the new modules :)




#54494 Ethernet Module Update

Posted by mcinnes01 on 05 December 2013 - 07:42 PM in Netduino Go

I have a lot of confidence in the Go! range again, although we haven't seen many gizmo's and do-dads in the last year, in recent months various releases for shield base have come out. Also thanks to Chris for taking the feedback of the community (the good and the less compliment).

 

I think he has done a great job being patient and sympathetic to community frustration, whilst I'm sure secret labs have some of their own, waiting on netmf updates.

 

Whilst I too have been disappointed from time to time, the netduino products are great and other community members must be excited by the imminent prospect of new modules too! Plus QFE1 at the longest will be 3 months at a guess, so I think we have A LOT to be excited for in the not so distant future. :)




#56177 Out of pins. Need advice on how to expand

Posted by mcinnes01 on 18 February 2014 - 09:05 PM in Netduino 2 (and Netduino 1)

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




#56185 Out of pins. Need advice on how to expand

Posted by mcinnes01 on 18 February 2014 - 11:38 PM in Netduino 2 (and Netduino 1)

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




#56209 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 19 February 2014 - 10:27 PM in Project Showcase

Thanks Hanzibal!

 

I have a dual board I bought on ebay, I will let you know how I get on.

 

Thanks again, fantastic work.

 

Andy




#56213 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 19 February 2014 - 11:30 PM in Project Showcase

Out of interest, like the netmf toolbox for the 595s, there is a "chain" method, that allows you to chain multiple 595s; is there a similar function in your fantastic library?

 

Also on pin assignment, I am using a standard netduino 1, I am using the SPI pins (D11,12,13) and D10 as CS. Would I be right in saying D12 should be the IRQ in my situation?

 

Also as the board I have has 2 MCP23S17 chips on it and seemingly no options to add additional CS, can I use just the 1 CS?

 

The boards have (MOSI, MISO, SCK, CS, VCC, GND)

 

Thanks again,

 

Andy




#56228 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 20 February 2014 - 04:40 PM in Project Showcase

Hi

 

I have this board by majenko http://cgi.ebay.ie/w...em=191068114141

 

They have an arduino library here https://github.com/m...kotech/MCP23S17

 

I have also emailed them to find out if they have any details on the pins as requested.

 

I will let you know as soon as I do, do you think I can get the board working for the first chip with your code for testing until I have the details re pins 1,2,3 and whilst you work your bug out?

 

In terms of the examples they all included the irq pin, do just put a "null" in when the irq pin is not needed? 

 

Many thanks

 

Andy




#56233 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 20 February 2014 - 08:07 PM in Project Showcase

Hi,

 

I've heard back, waiting on the IRQ pins information and maybe a schematic but got this about the chaining. There are basically 2 little solder pads that can be bridged to get the different values.

 

"[color=rgb(0,0,0);font-family:arial, sans-serif;font-size:13px;]On the left-hand chip (Bank 0) A0 is pulled to ground through 10K?. On the right hand chip (Bank 1) A0 is pulled up to Vcc.[/color]

[color=rgb(0,0,0);font-family:arial, sans-serif;font-size:13px;]On both chips A1 and A2 are both pulled down to ground through 10K?, and the two solder jumpers BA0 and BA1 can be shorted to link A1 and A2 to Vcc respectively.[/color]

[color=rgb(0,0,0);font-family:arial, sans-serif;font-size:13px;]So, by default, the left chip is 0b000 and the right chip is 0b001. Shorting BA0 yields the two addresses 0b010 and 0b011, etc. The 4 combinations of BA0/BA1 (00, 01, 10 and 11) give you the addresses for 4 boards (BA = Board Address)."[/color]

 

No worries on the driver, I'm really grateful for the hard work you have put in to it so far. I will have a go with it as it is a let you know how I get on in the mean time and hopefully you will find a way around the chaining issue. I'm no real C++ developer, but I wonder if the majenko driver for arduino offers any ideas?

 

Thanks again,

 

Andy




#56235 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 20 February 2014 - 08:24 PM in Project Showcase

Will do thanks again. :)




#56247 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 21 February 2014 - 10:48 AM in Project Showcase

Hi Hanz,

 

The board is sounding like a fantastic design as I slowly eke out more details about it.

 

The board has 6 pins either side.

 

VCC                                        I0A (IRQ pin A on chip 1)

GND                                        I0B (IRQ pin B on chip 1)

CS                                           I1A (IRQ pin A on chip 2)

SCK                                        I1B (IRQ pin B on chip 2)

MOSI                                       BA1 (used for altering the address of chip 2)

MISO                                       BA0 (used for altering the address of chip 1)

 

$_1.JPG

 

I will let you know my results :)

 

Andy




#56248 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 21 February 2014 - 11:35 AM in Project Showcase

Hi Hanz,

 

I think I am doing something wrong?

 

With the board I have attached the pins to directly to a standard netduino 1 as follows:

 

Vcc = 3.3v

Gnd = Gnd

CS = D10

SCK = D13

MISO = D12

MOSI = D11

 

// UPDATED code corrected power of 2

    public class Program    {        // Number of registers        private static uint icCnt = 1;        // Pins per register        private static uint icPins = 16;        //Total pins        private static uint pinCnt = icCnt * icPins;        // Sleep        private static int sleep = 200;        public static MCP23S17.OutputPort[] Outs = new MCP23S17.OutputPort[pinCnt];        public static MCP23S17[] chip = new MCP23S17[icCnt];        public static void Main()        {            // create a new instance of the driver class using pin 17 for !CS and pin 18 for IRQ            for (byte ic = 0; ic < icCnt; ic++)            {                chip[ic] = new MCP23S17(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, Pins.GPIO_NONE, ic, 7000);            }                        // Define all outputs            uint i = 0;            for (uint Counter = 0; Counter < pinCnt; ++Counter)            {                if (Counter / 16 == i + 1) { i = i + 1; }                int iPin = 1 << (int)(Counter-(i*icPins));                Outs[Counter] = chip[i].CreateOutputPort((MCP23S17.Pins)iPin, false);            }            while(true)            {                foreach (MCP23S17.OutputPort o in Outs)                {                    o.Value = true;                    Debug.Print(o.Name.ToString() + " is ON");                    Thread.Sleep(sleep);                    o.Value = false;                    Debug.Print(o.Name.ToString() + " is OFF");                }            }        }

I noticed that there were a few pins that were just sat high on chip 2 when I turned GPIO_Pin1 on chip 1 on, on its own (i.e. without any loop)

 

 

Thanks again,

 

Andy




#56309 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 23 February 2014 - 08:19 PM in Project Showcase

Hi Hanz,

 

I realized that right after I posted, I have updated my code which I hope allows for multiple MCP23S17s to be defined and will produce outputs in a continuous array. Do you think the amended code looks correct or can you suggest some improvements?

 

I will try out your suggest with D12 and report back.

 

Thanks again,

 

Andy




#56311 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 23 February 2014 - 08:54 PM in Project Showcase

Hi Hanz,

 

Am I doing something wrong or is this where the bug lies with multiple chips?

 

I get an error on the line:

            _spi = new SPI(new SPI.Configuration(xcsPin, false, 0, 0, false, true, spiSpeedkHz, spiModule));

From this bit of the driver:

       /// <summary>        /// Create a new instance of the MCP23S17 driver        /// </summary>        /// <param name="spiModule">SPI module to use</param>        /// <param name="xcsPin">Chip select pin for SPI bus</param>        /// <param name="irqPin">Interrupt pin</param>        /// <param name="hwAddr">Chip hardware address</param>        /// <param name="spiSpeedkHz">SPI clock speed in kHz</param>        public MCP23S17(SPI.SPI_module spiModule, Cpu.Pin xcsPin, Cpu.Pin irqPin, byte hwAddr, uint spiSpeedkHz)        {            _spi = new SPI(new SPI.Configuration(xcsPin, false, 0, 0, false, true, spiSpeedkHz, spiModule));

The error I get is:

    #### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####    #### Message:     #### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] ####    #### Microsoft.SPOT.Hardware.SPI::.ctor [IP: 0022] ####    #### MCP23S17Lib.MCP23S17::.ctor [IP: 0022] ####    #### Testspi1.Program::Main [IP: 0023] ####A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dllAn unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll

Any ideas?

 

Cheers,

 

Andy




#56328 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 07:51 AM in Project Showcase

Hi Hanz,

 

That is much clearer, thanks and I welcome any constructive criticism :)

 

I am getting this error:

A first chance exception of type 'MCP23S17Lib.MCP23S17.MCP23S17Exception' occurred in Testspi1.exeAn unhandled exception of type 'MCP23S17Lib.MCP23S17.MCP23S17Exception' occurred in Testspi1.exeAdditional information: MCP23S17: Pin already in use: Port0000 Uncaught exception 

On the throw exception in the code:

        private void _RegisterPort(_Port pin)        {            int idx = (int)pin.Pin;            if (_pins.Contains(idx))                throw new MCP23S17Exception("Pin already in use: " + pin.Name);            // store it            _pins[idx] = pin;        }

Not sure what I am missing?

 

Also I don't seem to be getting any output on the board? I can see there is power there, but in all my tests so far I have not lit an LED. The LED is connected to one of the digital pins on chip 1 and is then connected to the ground on the board. My first test to define and switch one port on constantly resulted in no output on chip one on any pin and there was out put on a few pins on chip 2. I will see if I can recreate that scenario.

 

I wonder if there hardware address isn't set correctly in my code?

 

Does this need to be a hex value and where would I set it?

 

Many thanks

 

Andy




#56340 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 06:32 PM in Project Showcase

Hi Hanz,

 

Firstly thanks for taking the time to help :)

 

I have updated to your latest code and still get the problem with the same pin being in use. I was a little unsure on what I needed to do in terms of pin number (point 1). Also I'm not sure what I need to do with the hardware address, does this need to be 0 for the creation of both MCP23S17s?

The thread '<No Name>' (0x2) has exited with code 0 (0x0).A first chance exception of type 'MCP23S17Lib.MCP23S17.MCP23S17Exception' occurred in Testspi1.exeAn unhandled exception of type 'MCP23S17Lib.MCP23S17.MCP23S17Exception' occurred in Testspi1.exeAdditional information: MCP23S17: Pin already in use: Pin_0x0

Many thanks,

 

Here is my current code:

using System.Threading;using SecretLabs.NETMF.Hardware.Netduino;using MCP23S17Lib;namespace Testspi1{    public class Program    {        // Number of registers        private static uint icCnt = 2;        // Pins per register        private static uint icPins = 16;        //Total pins        private static uint pinCnt = icCnt * icPins;        // Sleep        private static int sleep = 200;        public static MCP23S17.OutputPort[] Outs = new MCP23S17.OutputPort[pinCnt];        public static MCP23S17[] chip = new MCP23S17[icCnt];        public static void Main()        {            // create a new instance of the driver class using pin 17 for !CS and pin 18 for IRQ            for (int ic = 0; ic < icCnt; ic++)            {                chip[ic] = new MCP23S17(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, Pins.GPIO_NONE, (byte)ic, 7000);                // Define all outputs                for (int pin = 0; pin < pinCnt; pin++)                    Outs[16 * ic + pin] = chip[ic].CreateOutputPort((MCP23S17.Pins)(1 << pin), false);            }            while(true)            {                foreach (MCP23S17.OutputPort o in Outs)                {                    o.Value = true;                    Thread.Sleep(sleep);                    o.Value = false;                }            }        }    }



#56342 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 07:12 PM in Project Showcase

I should have spotted that, my bad.

 

I updated the code but get a new error on the AddSPI:

The thread '<No Name>' (0x2) has exited with code 0 (0x0).A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dllAn unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dllAdditional information: key exists

It occur on the line _cfg.Add(key, cfg);

            public void AddSPI(int key, SPI.Configuration cfg)            {                lock (_cfg)                    _cfg.Add(key, cfg);            }



#56345 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 07:38 PM in Project Showcase

Ok will do, I will give it a spin now.

 

Cheers,

 

Andy




#56347 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 08:12 PM in Project Showcase

Success on 1 chip :)

 

 

 

 




#56350 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 24 February 2014 - 10:01 PM in Project Showcase

Yes and multi spi works too. Slight issue to work out with my code. The idea of a continuous array of output ports span multiple ics is great, but I'm not sure how I would access the relevant pins for example:

 

(Left power 2 value, right array position)

 

1 - 1
2 - 2
4 - 3
8 - 4
16 - 5
32 - 6
64 - 7
128 - 8
256 - 9
512 - 10
1024 - 11
2048 - 12
4096 - 13
8192 - 14
16384 - 15
32768 - 16
1 - 17
2 - 18
4 - 19
8 - 20
16 - 21
32 - 22
64 - 23
128 - 24
256 - 25
512 - 26
1024 - 27
2048 - 28
4096 - 29
8192 - 30
16384 - 31
32768 - 32
 



#56407 OutputExpander - How to Make a Netduino GO! Module

Posted by mcinnes01 on 25 February 2014 - 08:46 PM in Netduino Go

Hi Mark,

 

Just a thought, you may have seen the recent library hanzibal made for the MCP23S17. I was wondering if you have looked at the STM8L range?

 

These chips have 2 SPI buses.

 

This is a little beyond me, but I would love a dual MCP23S17 GO bus module.

 

What are your thoughts on the STM8L and is it possible to use both SPI buses, one for GO bus and the other for the MCP23S17s?

 

Many thanks

 

 

andy




#56410 New: Netduino 4.3.1 SDK and VS2012+ support

Posted by mcinnes01 on 25 February 2014 - 10:24 PM in General Discussion

Hi Chris,

 

Is there any release for the netduino 1?

 

Also any news on one-wire for the netduino 1?

 

Many thanks,

 

Andy




#56414 MIP tcp/ip stack running on Netduino mini !!

Posted by mcinnes01 on 25 February 2014 - 11:44 PM in Project Showcase

Hi,

 

I wonder if you can help, I am trying to get mip up and working on my standard netduino 1 with 4.2 running on it.

 

First of all what pins do I need to connect to the nic?

 

Also do I need to add another interface profile enum for the netduino 1?

 

Many thanks,

 

Andy





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.