Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Problem with MCP23017 IO Expander

Status
Not open for further replies.
Is your dsPIC I2C Code working fine with eeprom ?

Remove this

Code:
IdleI2C();

which is after StopI2C();

Have you provided pull up resistors on the I2C lines. It should be pulled to VDD of dsPIC.
 

Yeah its working with eeprom and SCL and SDA lines connected through pull up resistors.I tried by removing IdleI2c() but the result is same.
 
Last edited:

My hardware connections are like this
Controller IO Expander
----------- ----------------
SCL SCL
SDA SDA
INT0 RESET
 

RESET of Port Expander should connect to digital output pin of dsPIC. INT0 pin of dsPIC configured as input ?
 

Then why is RESET pin of Port Expander connected to INT0 ? It should be connected to digital Output pin for resetting Port Expander.
 

I connected to output pin ,but the result is same.Can u show the interfacing io expander with available pic controller in proteus.
 

Hi,
I am using MCP23017 with I2C to ON & OFF driver IC ULN2803 pins.It means to high and low pins of ULN2803.As per my applicatioin its working, but it regulaty reseting.So,what is the problem.My code is in below.

Code:
void IOex()
{
	MCP23017_Write(IODIRA, 0x00);		// Declaring A port as output
	MCP23017_Write(IODIRB, 0x00);		// Declaring B port as output
	printf("IOEx\n");
 }

void MCP23017_Write(unsigned char address, unsigned char value) 
{
	WaitI2C(1000);           //10000
	 IdleI2C();
	StartI2C();
	IdleI2C();
	MasterWriteI2C(MCP23017_ADDRESS);
	IdleI2C();
	while(I2CSTATbits.ACKSTAT);
	MasterWriteI2C(address);
	while(I2CSTATbits.ACKSTAT);
	IdleI2C();
	MasterWriteI2C(value);
	IdleI2C();
	while(I2CSTATbits.ACKSTAT);
	IdleI2C();
	StopI2C();
	IdleI2C();	
	
}
 

The RESET pin may be floating or driven low inadvertently. Why not connecting it to +5V permanently?

Or you have electrical interferences on the Vdd line that triggers the internal power-on reset. Use bypass capacitors.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top