Netduino home hardware projects downloads community

Jump to content


Photo

Extensive driver for the MCP23S17 I/O expander


  • Please log in to reply
43 replies to this topic

#41 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 02 March 2014 - 11:10 PM

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



#42 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 03 March 2014 - 08:58 AM

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?

Yes but can this really be achieved with mIP 100% unchanged?

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?

Both correct and the best way to do this is probably for you to wrap the driver in another class of your own.

#43 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 15 March 2014 - 04:43 PM

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



#44 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 15 March 2014 - 06:41 PM

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






1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Bing (1)
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.