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.

Matteo Defanti

Member Since 01 Feb 2011
Offline Last Active Jul 22 2011 10:18 AM
-----

Topics I've Started

I2c problems interfacing TPIC2810 Led Driver

19 July 2011 - 09:05 PM

Posted Image

Hello everybody
I'm trying to interface my Netduino standard to a Texas Instrument TPIC as shown up in the image!

That's the code:

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace i2cMaster2._0
{
    public class Program
    {
         
        static OutputPort Gneg = new OutputPort(Pins.GPIO_PIN_D0, true);
         
        public static void Main()
        {
            OutputPort SDA = new OutputPort(Pins.GPIO_PIN_A4, false); // read in the forum to reset the 2 ports
            OutputPort SCK = new OutputPort(Pins.GPIO_PIN_A5, false);
            SDA.Dispose();
            SCK.Dispose();

            I2CDevice.Configuration cnf = new I2CDevice.Configuration(0x60, 400);

            I2CDevice TPIC2810 = new I2CDevice(cnf);

            byte[] outBuffer = new byte[] { 0x44, 0x64 }; 

            I2CDevice.I2CWriteTransaction writeTransaction = I2CDevice.CreateWriteTransaction(outBuffer);
            

            I2CDevice.I2CTransaction[] transactions = new I2CDevice.I2CTransaction[] 
                                                               {
                                                                    writeTransaction
                                                               };
            while (true)
            {
               
                TPIC2810.Execute(transactions,  100);
            }
             
        }

    }
}

and that's the sequence to send to the device in order to have 0x64 in the 8 leds.

Posted Image



I couldn't get it works so I have tried to test SDA and SCK with the oscilloscope and i just see a +5volts continue line without signals...

Where am i making mistakes? Has anyone got the same problem?

Thank you! :)

Here is the link of the TPIC2810 datasheet Click Here

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.