mcinnes01's Content - Netduino Forums
   
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 26-April 23)


By content type

See this member's


Sort by                Order  

#56740 NeonMika.Webserver

Posted by mcinnes01 on 10 March 2014 - 07:12 PM in Project Showcase

Hi 

 

Just wondered if this could work with the MiP library in order to use it on N GO! and standard netduino 1?

 

Also would it be possible to use MQTT with it?

 

Many thanks

 

Andy




#52675 Ethernet Module Update

Posted by mcinnes01 on 09 September 2013 - 09:21 PM in Netduino Go

I often see books on amazon with a similar status? Still if 6 months is a realistic time scale for Go! Bus 1.5 it at least gives us a date to look forward to :)




#58416 Ethernet Module Update

Posted by mcinnes01 on 27 May 2014 - 08:54 AM in Netduino Go

Well that's up to you :) I know its frustrating waiting ages and comms could definitely been handled differently by secret labs, but this is the situation which I'm sure is fairly common when developing new transport protocols especially with netmf ever evolving and having to work around the bugs that are inherited with it.

The suggestion of mip + an enc28j60 is a good cheap alternative or at least stop gap. It is from what I understand the same chip on the ethernet board we are all waiting on. Plus it uses spi, so you only really lose 1 pin for chip select if you use other spi modules and the multi spi library, so not much of a sacrifice. I got it working sharing spi with a gpio expander so I actually gained pins as opposed to lost pins. Also in terms of plug and play, bar a resistor and not having a 10 pin connector or shield format, its not far off. At least this way you can move on with your code and project in the mean time, then when the ethernet module lands, fingers crossed this year, you can simply switch out the mip code for the native network code.

Hth

Andy



#58371 Ethernet Module Update

Posted by mcinnes01 on 23 May 2014 - 09:34 PM in Netduino Go

Sigh, why don't you just get a cheap ass ENC28J60 module off ebay for < £3 and use the mIP library?

 

At least this is something that WILL get ethernet to the GO without doubt.

 

Module: http://www.ebay.co.u...=item20d966b102

 

mIP: http://mip.codeplex.com/

 

I'm currently trying to get mIP working with M2Mqtt so I can get GO working with Mqtt, it would be cool to have a few other people helping explore this route :)




#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. :)




#56919 Netduino - WiFi

Posted by mcinnes01 on 19 March 2014 - 07:03 PM in Project Showcase

Hi,

 

Does anyone still have the code that was on this thread or any code to get the gainspan module working?

 

Many thanks

 

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 :)

 

 

 

 




#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




#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
 



#56823 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 15 March 2014 - 06:41 PM in Project Showcase

Hi,

 

I have done a little testing and my adjustments seem to work in terms of implementing the standard multi SPI class as per the netmf toolbox.

 

Please see amendments attached.

 

Next task is to create a wrapper to handle the scenario of creating cross chip groups that leverage the bus functionality where possible.

 

Many thanks,

 

Andy

 

http://1drv.ms/OlgfGw

Attached Files




#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);            }



#56819 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 15 March 2014 - 04:43 PM in Project Showcase

Hi Hanz,

 

No offence taken, I am taking your advice and investigating a little more before I repost. I have made a better test subject with a load of leds and am just reworking my changes to the code to get a proper test in. I should have some findings shortly so I will post back when I have something more substantial.

 

Many thanks,

 

Andy




#56592 Extensive driver for the MCP23S17 I/O expander

Posted by mcinnes01 on 02 March 2014 - 11:10 PM in Project Showcase

Carrying the multi SPI conversation on here...

 

Do you think it is possible to incorporate Steffan's multi spi mgr in to your MCP23S17 driver?

 

Thus making it possible to share with MIP without modifying MIP?

 

On another topic...

 

I was considering the use of the bus.

 

If I wanted to dynamically group pins/ports and abstract this further to allow me to create groups or "buses" across chips do you think this is possible.

 

Let me elaborate...

 

Am I correct in saying the use of a bus is to allow for multiple port changes to be made in one write, thus increasing speed and efficiency?

 

If this is correct, then I also understand that I can't make a bus spanning multiple chips, however if for example I wanted to change the state of 10 pins 5 on each chip, then I could create a class that identifies which pins are on which bus and perform 2 writes one for each bus?

 

This is obviously going to be more efficient than 10 separate writes and gives me the ability, for example to "turn off all lights" or "turn off everything".

 

Many thanks,

 

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




#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




#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




#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




#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




#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




#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




#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




#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




#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;                }            }        }    }




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.