2023-06-03 11:13 AM
Hi,
I tried the following program:
#include <Wire.h>
void setup()
{
Wire.begin(); //creates a Wire object
// set I/O pins to outputs
Wire.beginTransmission(0x20); // MCP 23008 Port Expander
Wire.write(0x00); //selects the IODIRA register
Wire.write(0x00); //this sets all port A pins to outputs
Wire.endTransmission(); //stops talking to device
}
void loop()
{
Wire.beginTransmission(0x20);
Wire.write(0x09); //selects the GPIO pins
Wire.write(0xFF); // turns on pins 0 and 1 of GPIOA
Wire.endTransmission(); //ends communication with the device
}
I use D15 (SCL) ans D14 (SDA) with a Microchip PKSerial-I2C1 demoboard. Program does not work.
Can somebody please help?
Dear Peter
Solved! Go to Solution.
2023-06-05 09:18 AM
Thanks for your help. I found the solution. The Nucleo RET152 Board has 3.3V outputs. The demoboard needs 5 V.
Dear Peter
2023-06-05 08:08 AM
Hi,
what do you mean exactly? it mean's you get error? if yes what kind of error do you have?
2023-06-05 08:44 AM
Not sure why it's writing the same register repeatedly in the loop
You seem to ignore all error or status returns from the functions.
Perhaps instead of "does not work" you can expand a little on what does and does not happen.
Perhaps look at signals at a bus level, and what errors/failures the functions are reporting.
You have suitable pull-ups on the pins?
Can you output information to Serial?
2023-06-05 09:18 AM
Thanks for your help. I found the solution. The Nucleo RET152 Board has 3.3V outputs. The demoboard needs 5 V.
Dear Peter