Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 10 months ago.
I can´t get my cap touch to work
I cant get my cap touch to work on my 5" RA8875 display. I have read somewhere that the I2C cabels must be kept really short and mine are like 20cm.
Can this be the reason for my problems with the cap touch? The display seem to work fine but no touch.
I have checked my wiring and found no errors, i will re-check again to be sure.
Update: My SPI signals looks strange:
I´m new to measuring with a scope so im happy i managed to get this pic. Ch1 Yellow is I2C clock SCL Ch2 Lightbule Is data SDA Ch3 Magenta is CTS interrupt
It show the I2C runs at 367,6kHz that seems wrong. And no data on the interrupt pin so i dont get notified when i touch the screen. Also the signals doesn´t look good, just like if the speed was to high. Maybe i just measured wrong.
I must try find a older firmware for the LPC1678.
Question relating to:
1 Answer
5 years, 10 months ago.
hi Mattias,
Are you using the same pin assignment as shown on the RA8875 page?
I2C, as a shared-IO bus, uses open-drain technology to permit multiple devices to share the interface. So, you may need to add pull-up resistors to the SDA and SCL pins. These Rs might be on the RA8875 display PCB, or perhaps not. If you have a pair of resistors somewhere between 2.7K and 27K, connect one side to SDA and the other side to the Vdd of your display. Do the same with SCL. The value isn't too critical, except that you have them.
Hi
Yes, i use the exact connections shown in the picture with the 7" RA8875 display with cap touch on the RA8875 page. I can try add some pullup resistors and see if it helps.
Thanks, I post the results when i have tried it.
posted by 18 Feb 2019There was no pullup resistors on the SDA & SCL pins, i checked. So i added 15K on both SDA & SCL but it didn´t help. I have checked the jumper settings on the display pcb and all seems correct according to the manual. I also checked my wireing and it´s also correct.
I have hard time believing the display isn´t working correctly, but i see nothing wrong in the connections so maybe it´s a bad one. I hope i can find the problem. Maybe i check if the CTP interrupt signal comes when i touch on the display.
posted by 20 Feb 2019I'm sorry to hear it isn't yet working - trying to think what else might be a cause...
- OS version. Virtually all of my work has been with OS 2, and even then I have found that not all versions work well. My memory tells me that between about release 118 and 128 that most of my IO needs were functioning (display, USB, and micro SD), and outside of that range it was unlikely to work - even if my code/libraries didn't change. I have done some limited testing with OS 5, and I think the display works - but had to introduce a few changes to callback interfaces - so even then it was a bit sensitive to version.
- SDA and SCL pins swapped? Not everybody has a scope to verify the signals, so these would be the next possibility to consider.
- Power and Ground - my diagram shows a lot of connections to power and ground, and I'm sure they are not all required, but the more closely you can match that diagram, the fewer things there are to rule out.
- 7 inch v. 5 inch display. I can't really imagine that there is a difference in the 5 inch display, but perhaps there is - pinout would be most likely if it has a different display board.
- Test code - if you don't have a scope, maybe you could create a new project just to configure the I2C pins as DigitalOut, then set and clear them very slowly and measure the voltages with a meter that they are going high (above 2.8V) and low (below 0.8V).
I remember i do have a scope so i can look at the signals and see if SCL is on the right pin. I will also see if i can download an older OS2 firmware. I have connected all power and ground pins so that cant be the cause of CTP not working.
Look at the signals with a scope was a good idea, i try do that.
posted by 21 Feb 2019I try find the firmware you suggested (118 to 128) but i only find these ones on the firmwate page for LPC1768:
rev 141212 (current one)
rev 21164 very old rev 16457 very old
I tried with firmeware rev 21164 (very old) and cap touch didnt work but display do work. Can i DL LPC1768 firmware versions 118 to 128 somewhere? I havent had time to measure with my scope but i will do it later today.
posted by 23 Feb 2019Oh, sorry, a small confusion. For the magic-chip firmware, the 141212 should be just fine, and the older ones as well.
I was talking about the mbed library itself - I've used OS 2, not OS 5, and then within that a release version in that range. You should be able to import the Touch Program into your environment and build it directly.
Edit: I just noticed that my Touch Program is using OS 5. I don't recall performing that upgrade, and I hope that is not what's causing you trouble. For my "Pub_" libraries, I test that exact version before I publish, so I'm reasonably certain that is a combination that works - but I'm not near my mbed module right now to verify. I can verify that it works on the 7" screen in a couple hours. If you do take that version, you can delete mbed-os, and then import mbed, and then check the revision version of mbed and switch it to 122.
posted by 23 Feb 2019I rebuilt the Touch Program and ran it on my 7 in display - it works as I expected. I then updated to the latest libraries (both RA8875 and MBED OS 5), and applied some other more minor changes for clarity, and it works as expected.
For your scope traces - thanks for that! [And it looks like you have a good scope. I have a slightly older Rigol - 2 channel it also has the logic analyzer channels.] Here's a few more comments -
- It would be easier to read if you moved the traces apart. Touch the button for your data channel, and then adjust the onscreen position with the adjacent control. Repeat that with channel 2 to move them apart. [One of the controls changes the vertical scaling, the other the offset]
- I2C generally has a recommended maximum speed of 400 Khz, but it is a synchronous protocol, so it can go slower, and some peripherals can go faster. The 367 kHz is of no concern.
I've never actually scoped my own controllers I2C - I should do that - but that might not happen today.
- Waveforms - the leading edge is a bit slower than I had imagined seeing, but the data signal is fully stable when the clock signal rises, so it should be just fine. To make it look a little sharper, you could reduce the value of the pullup resistors.
- Interrupt pin - another one I should look into. I integrated the touch-driver from another mbedder, and it worked, so I haven't dug deeper.
I will read the manual of the cap touch chip on the display. Its strange no interrupt signals comes when i touch the display. Maybe i have new type of chip, it´s GLS1680.
I uploaded a better pic with the signals separated. The scope is nice, i just have to learn to use it better.
posted by 23 Feb 2019I think i found the reason the capacitive touch isn´t working with my display.
My display, the "ER-TFTM050A2-3-3661" use a different chip for the cap touch. When searching the code i saw reference to a chip named FT5206. The cap touch controller on my display is GSL1680. Maybe it´s possible to change the code to make it work with GSL1680, there is some example code at the buydisplay webpage for my display ER-TFTM050A2-3-3661.
posted by 23 Feb 2019Root Cause Identified
The "ER-TFTM050A2-3-3661" display uses a GSL1680 cap touch controller, not the currently supported FT5206 controller.
I visited the BuyDisplay.com site, started with the 5 inch panel, and it led me down the same path Mattias likely took - to a "newer" model, which has the GSL1680 controller.
It looks like an interesting upgrade:
- 5 or 10-finger tracking (depending on the firmware in the GSL1680), and
- Finger pressure-sensing capability (but no examples of this have been found).
This controller comes with some risk:
- The GSL1680 has a 32-bit micro, which is bootstrapped on power-up to install a program. This is of no real concern, but -
- Documentation on this part is not readily available. There are "op-code" [byte-stream] level programs that can be found, usually with very little details about it's capability.
I'm willing to work on a successful integration of this controller, and recommended to move the ongoing work to private email to let this thread close-down. While a solution would have been a better outcome, I suggested marking this as solved, which Mattias did.
Update
I have created very preliminary support for the GSL1680 Touch Controller that is on some of the RA8875-based displays. If you have such a display, please contact me via PM. Since I don't have one of these displays, I would appreciate some development support. I created a separate RA8875 library with this integration for ongoing development and testing, and will merge it into the main code-base once a stable version is proven. (And feel free to contact me via PM if you want to send me one of these displays ;)
posted by 23 Feb 2019