- edited description
- attached 6f73c73c3cc02d7a6ec20d9a899c9bcc.mp4
MPR121 12channel Unable to work completely
The touch channels 8, 9, 10, and 11 are not responsive, and when touching channels 0, 1, 2, or 3, channels 8, 9, 10, and 11 are also triggered.Other channels are normal。
Comments (21)
-
reporter -
repo owner I've been using the Touch library with the MPR121 on the MakerPort board and it has been working well.
The MPR121 calibrates itself when it starts up. The calibration process takes less than one second. If you are touching any pins when during calibration, those pins may not respond to being touched later.
You can force re-calibration by clicking the "stop" button in MicroBlocks, then re-starting the MicroBlocks program. Make sure you are not touching any pins or even the MPR121 itself when the programs starts.
If re-calibrating does not fix the problem, then your MPR121 board may be defective. Do you have another one you can try?
-
repo owner - changed status to open
-
reporter Thank you for your reply.
Despite my efforts to stay away from it during initialization, the fault still persists.
I tested this module in the Arduino environment and it worked well.
I only bought one for testing, and I will buy a few more for testing when I have the chance.
I also noticed a strange phenomenon: in previous tests using the ESP32, when I connected the MPR121 module to the Pico2040, the Pico2040 failed to work and couldn't connect to the IDE. It's possible that this MPR121 is indeed faulty.
-
repo owner I tested this module in the Arduino environment and it worked well.
This makes me think that the hardware is working correctly. Did you do that test with the same microcontroller board where the MPR121 does not work with MicroBlocks?
Did you use this Arduino library:
https://github.com/adafruit/Adafruit_MPR121/blob/master/Adafruit_MPR121.cpp
What micrcontroller board(s) are you using to test?
when I connected the MPR121 module to the Pico2040, the Pico2040 failed to work and couldn't connect to the IDE. It's possible that this MPR121 is indeed faulty
A possible problem is that the MPR121 board lacks I2C pull-up resistors. That would explain why the Pico2040 would not work -- because it is waiting forever for the I2C SDA or SCL line to go high.
Some microcontroller boards have built-in I2C pullup resistors, others do not. Most I2C extension boards include I2C pullup resistors but some do not. If neither the microcontroller board nor the extension board has pullup resistors then not only does I2C not work, but the low-level I2C code can hang.
However, I see some resistors in the photo of your board so I'm guessing that it does have built-in pullup resistors.
Another possible issue could be different voltage levels. Be sure to power the MPR121 from a 3.3v pin, not a 5v pin.
There may also be a subtle bug in the MicroBlocks library that did not show up when testing with the MakerPort.
-
reporter Thank you for your reply。yes ,i use https://github.com/adafruit/Adafruit_MPR121/blob/master/Adafruit_MPR121.cpp,Using a sample program。
The first time I used a UNO board。Today, I burned the Arduino sample program using the ESP32 board and Pico2040 board respectively, and it can also run perfectly.
I used a multimeter to confirm that the SDA and SCL pins on my MPR121 board have pull-up resistors.
-
repo owner Thank you for doing those tests. This sounds more and more like a software bug.
It's funny that I haven't seen this problem in my recent work with a new board called the MakerPort, which has a built-in MPR121. I'll study the Arduino library code to see I if I've missed something.
-
repo owner Here is a test script:
You can download this image, then drop the .png file onto MicroBlocks to load the script.
I want to see if it helps to add a short delay between reading the high and low bits from the MPR121 chip.
-
reporter I see two identical numbers, and the last four channels are still unavailable.(by ESP32)
-
repo owner Thanks for doing that test. The numbers should be different if you are only touching one pin. I believe the low bits byte encodes pins 0-7 (as bits) and the low four bits of the high byte encodes pins 8-11.
Since the Arduino program works, I think MicroBlocks must be doing something wrong. I will try to figure it out.
-
repo owner The Adafruit library uses different settings from the MicroBlocks one. I made a version of the library that uses those settings:
https://microblocks.fun/mbtest/tmp3/Touch%20V2.ubl
Does that work better with your board?
-
reporter Thank you for your hard work. After testing, the new library has the same performance as before. Luckily, I found an internet friend who is willing to test this module with me. He has already placed an order, and we will provide you with the test results after receiving the goods in a few days.
-
repo owner Luckily, I found an internet friend who is willing to test this module with me. He has already placed an order, and we will provide you with the test results after receiving the goods in a few days.
Great! It will be helpful to see if your friend gets same results with different hardware.
-
reporter I just used ESP8266 to connect to mpr121, and it's amazing that this combination works perfectly
video:https://github.com/djzrs/picture/blob/picture/236dd36c7167ebeb6fb20cce996d8fd8.mp4
-
repo owner Glad that you got it working with the ESP8266 at least.
You could try reducing the I2C clock speed to 100 kHz. Most I2C devices are happy with "i2c fast mode" of 400 kHz, but there are some that prefer a lower speed. You can find the block to change the I2C speed in the "sensorPrims" library in the System folder in the Other category.
Switching the I2C to a lower speed will slow down interactions other I2C devices, especially OLED displays. Thus, if you need to use a lower I2C speed for your MPR121 it is a good idea to switch the speed to 100 kHz before interacting with the MPR121, then switch back to 400 kHz when it is finished. That will leave the I2C speed at 400 kHz for other devices that are happy at the higher speed.
Of course, that doesn't matter if the MPR121 is the only I2C device you are using.
-
reporter Thank you,i try reducing the I2C clock speed to 100 kHz.But this method doesn't seem to solve the bug。
-
repo owner Thanks for trying that. Sorry it didn't help.
I just got a MPR121 breakout board from Adafruit. I'm about to go on vacation but in January I will see if I can reproduce the problem with that board.
Has your friend gotten his board yet?
It's interesting that your board works with the ESP8266. That may be a clue if we could figure out what it means!
-
reporter My friend got the board and he also tested it, encountering the same problem as me.
Wishing you a pleasant vacation
Looking forward to you coming back to solve this problem -
repo owner José found the problem. It is fixed in the latest pilot release.
-
repo owner - changed status to resolved
-
reporter Thank you, John
Thank you, José
wow so happy
I've tried it, it's very useful
I made a numeric keyboard and will share it here once I have a demo done
- Log in to comment