MCP23017

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
sleepingalex24
 
Posts: 2
Joined: Sun Mar 28, 2021 10:39 am

MCP23017

Post by sleepingalex24 »

Hi,

I have one of your MCP23017 i2c expansion boards and am attempting to use it with an HX711 loadcell board. This board requires very fast reads and writes and I believe it's not working with the MCP23017 because of how slow the mcp.digitalRead and mcp.digitalWrite methods are. I have attached a demonstration of how much slower they are below:

Code: Select all

float j;
mcp.begin_I2C();
pinMode(3, OUTPUT);	
mcp.pinMode(4,OUTPUT);
	
Wire.setClock(400000);
mcp.digitalWrite(4, LOW);
digitalWrite(3, LOW);
delay(5000);
	
j = micros();
mcp.digitalWrite(4, HIGH);
j = micros() - j;
Serial.print("TOTAL TIME1: ");
Serial.println(j);

j = micros();
digitalWrite(3, HIGH);
j = micros() - j;
Serial.print("TOTAL TIME2: ");
Serial.println(j);
The output is as follow:

Code: Select all

TOTAL TIME1: 276.00
TOTAL TIME2: 8.00
Is there any way to speed up the reads and writes of the MCP23017 board or is this just a limitation of the hardware?

Thank you!

Alex

User avatar
adafruit_support_carter
 
Posts: 29151
Joined: Tue Nov 29, 2016 2:45 pm

Re: MCP23017

Post by adafruit_support_carter »

Speeding up the clock speed is about the only thing that might work. But in general, doubt this is achievable. Same issue as here:
viewtopic.php?p=954642

Checkout the NAU7802:
https://www.adafruit.com/product/4538

User avatar
sleepingalex24
 
Posts: 2
Joined: Sun Mar 28, 2021 10:39 am

Re: MCP23017

Post by sleepingalex24 »

Ah got it, thank you! Gonna have to approach this differently.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”