We no longer sell products directly from the GHI Electronics website, click here for more details. Please find a Distributor to complete your online order. If you have any questions regarding this notice please contact us at support@ghielectronics.com.

MaxO Module

Last modified August 20, 2014

MaxO Module

Required

Tutorials: First NETMF Project, Namespaces

Introduction

This module contains four shift registers that can drive a total of 32 outputs. Each output is connected to a 330 ohm resistor and can drive up to 10mA, allowing easy connections to a LED or transistor. Additionally, multiple MaxOs can be chained together to provide even more outputs.

How to connect this module

This module supports chaining multiple MaxO modules together on the same socket. While this may look like Daisylink, it isn't. In the designer, we will add only one of these modules per socket that will have a chain.

For example, if we want to connect 4 MaxO modules to socket 6 on the FEZ Spider, we will only add one module in the designer and connect it to socket 6. If we want 4 MaxO modules on socket 6 and 4 modules on socket 9, we will add two to the designer, connecting one to socket 6 and one to socket 9.

Before you send any data to the module you must set the Boards property equal to the number of modules connected in that chain.

How it works

Once we have told the driver how many modules we have connected, we are free to start sending data to the module.

First, we create a byte array that will represent the pins on the module. Each module represents 4 bytes of data ( 8 pins at 1 bit per pin, with 4 sections of 8 pins).

Since we are currently using one module, we will need 4 bytes. The below example shows writing these four bytes out to the module. We choose 0xAA because it has the convienent bit pattern of 1010 1010 so the pins will alternate on and off.

namespace your_namespace
{
    public partial class Program
    {
        private void ProgramStarted()
        {
            this.maxO.Boards = 1;

            this.maxO.Write(new byte[] { 0xAA, 0xAA, 0xAA, 0xAA });
        }
    }
}

Now, if we check the result on the module, either with a voltmeter or an led (make sure to ground the led) we will see that every other pin is high, with the opposite pins being low. The following image shows how each pins corresponds to a byte and bit.

Writing specific pins

If you only want to write a value to a single pin and not the array, the WritePin function enables you do to that as seen in the example below that sets the first pin on the first board to on. Board numbers start at 1 and pin numbers start at 0.

namespace your_namespace
{
    public partial class Program
    {
        private void ProgramStarted()
        {
            this.maxO.Boards = 1;

            this.maxO.SetPin(1, 0, true);
        }
    }
}
Leave feedback about this document.
Let us know if the information presented here was accurate, helpful and if you have any suggestions.
Leave feedback about this document.
Let us know if the information presented here was accurate, helpful and if you have any suggestions.

* Indicates required fields.
This form is only for feedback not support.
Review our how to find information guide on locating helpful resources.