Hello again @xreef,
thank you for providing this library.
I’m just trying to get the PCF8574 library working with Seeed Wio Terminal, but it doesn’t work ( doesn’t return from pcf8574.begin() ).
I have tried other I2C devices on the Wio Terminal and everything works. https://github.com/RoSchmi/PlatformIO/tree/master/Proj/Wio_Terminal_M5Stack_ENV_Hat_Test
So I think that I have used the correct pins.
I have also set up your example code on an Arduino Nano and it works.
So I think that I have used the correct address for my PCF8574.
Before trying to set up oscilloscope and logic analyzer I wand to ask if you already know a reason why it doesn’t work.
Here is the example code I’m using:
#include "Arduino.h"
#include "PCF8574.h"
// Set i2c address
//PCF8574 pcf8574(0x39); // For PCF8574A
PCF8574 pcf8574(0x20); // For PCF8574
void setup()
{
Serial.begin(9600);
while(!Serial);
delay(1000);
Serial.println("Starting...");
// Set pinMode to OUTPUT
pcf8574.pinMode(P0, OUTPUT);
pcf8574.pinMode(P1, INPUT);
Serial.print("Init pcf8574...");
if (pcf8574.begin()){
Serial.println("OK");
}else{
Serial.println("KO");
}
}
void loop()
{
pcf8574.digitalWrite(P0, HIGH);
delay(1000);
pcf8574.digitalWrite(P0, LOW);
delay(1000);
}
Hi, I doublechecked the SDA and SCL pins (are o.k.)
When I enable debug messages I get:
Starting…
Set pin 0 as 1
W: 1 R ALL: 0 R Down: 0R Up: 0
Set pin 1 as 0
W: 1 R ALL: 10 R Down: 10R Up: 0
Init pcf8574…Set write mode
resetInitial pin 11
Start end trasmission if stop here check pullup resistor.
When I set breakpoints in the driver code it reaches:
this->transmissionStatus = _wire->endTransmission();
when I set breakpoints in the return statements of TwoWire::enttransmission none of the three posible returns is reached.
I had 4.7 k pullups, didn’t work and I removed the pullups, didn’t work
Hi RoSchmi,
I have not yet tested the device with the i2c, I am completing the article with a small application that gives the status of the FTP server.
But seems a connection problem, have you tried making an i2c scanner?
I try to test as soon as possible, but this week It’s full, I do my best.
I finally found the reason. It was a bad soldering junction at the pullup resistor for SDA (so that it didn’t pull up). Apparently the sensor which I used at this same socket had its own pullup so that it worked and I didn’t notice it.
It’s like always, the true reason for something that doesn’t work is always the last thing you try. It took my many hours to find out.
I’m looking forward to try it on the Wio Terminal. Is it ready to be tested. Some years ago I created an ftp like file transfer program using bluetooth from PC to NETMF boards:https://www.youtube.com/watch?v=8tauo8kqe6w
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.