Hi,
Does somebody successfully used socket 5 on FEZ Hydra to connect with the I2C IO Expander PCF8574AP from NXP.
The chip is on my breadborad with the folowing Pinout
FEZ Hydra Socket 5 PCF8574AP
pin 2 pin 16
pin 8 pin 15
pin 9 pin 14
pin 10 pin 8
Nothing more, nothing less. Just these 4 pins connected together, no additionnal component.
If you look at the following document, you will see that the 7 bit address should be 0x38
http://www.nxp.com/documents/data_sheet/PCF8574.pdf
I’m starting with “clean” new FEZ Hydra Gadgeteer project, and I write the following code. I run it and unfortunately, no pin came to 0V as espected
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.Seeed;
using GTI = Gadgeteer.Interfaces;
namespace HyperionGadgeteer
{
public partial class Program
{
GTI.I2CBus MyI2C;
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
Debug.Print("Program Started");
ushort PHILLIPS_PFC8574A_ADDRESS = 0x38;
int PHILLIPS_PFC8574A_CLOCK_IN_kHz = 100;
GT.Socket socket = GT.Socket.GetSocket(5, true, null, null);
MyI2C = new GTI.I2CBus(socket, PHILLIPS_PFC8574A_ADDRESS, PHILLIPS_PFC8574A_CLOCK_IN_kHz, null);
byte[] ByteToWrite = new byte[1] { 0x00 };
MyI2C.Write(ByteToWrite, 1000);
}
}
}