Hi,
Is there have any example code for the capacitive touch?
I have try to run the CTSU examples function but it is not working well
Hello Ambrose,
Which code examples did you try?
In the RL78/G16 page there are several code examples which you can try:
https://www.renesas.com/us/en/document/scd/rl78g16-capacitive-touch-evaluation-system-sample-code-rev100?r=25428046
https://www.renesas.com/us/en/document/scd/rl78-family-touch-module-software-integration-system-rev140-sample-code?r=25428046
https://www.renesas.com/us/en/document/scd/rl78-family-using-qe-standalone-ver-develop-touch-applications-fpb-board-rev100?r=25428046
https://www.renesas.com/us/en/document/scd/rl78-family-ctsu-module-software-integration-system-rev140-sample-code?r=25428046
Kind regards,
Sergey
If this response, or one provided by another user, answers your question, please verify the answer. Thank you!
Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/
Hi thanks for you reply. I am talking the code on https://www.renesas.com/us/en/document/scd/rl78-family-ctsu-module-software-integration-system-rev140-sample-code?r=25428046 doc file.
I have try to run the code
#include "r_smc_entry.h"#include "r_ctsu_api.h"int main (void);
#include "r_ctsu.h"
int main(void){ fsp_err_t err; uint16_t dummy; /* Open Diagnosis function */ R_CTSU_Open(g_qe_ctsu_instance_diagnosis.p_ctrl, g_qe_ctsu_instance_diagnosis.p_cfg); /* Scan Diagnosis function */ R_CTSU_ScanStart(g_qe_ctsu_instance_diagnosis.p_ctrl); while (0 == g_qe_touch_flag) {} g_qe_touch_flag = 0; err = R_CTSU_DataGet(g_qe_ctsu_instance_diagnosis.p_ctrl,&dummy); if (FSP_SUCCESS == err) { err = R_CTSU_Diagnosis(g_qe_ctsu_instance_diagnosis.p_ctrl); if ( FSP_SUCCESS == err ) { PIN_WRITE(LED2) = ~PIN_READ(LED2); } /* Diagnosis was succssed. */ }
return 0;}
And there got 3 errors
../src/test.c(37):E0520020:Identifier "g_qe_ctsu_instance_diagnosis" is undefined
../src/test.c(41):E0520020:Identifier "g_qe_touch_flag" is undefined
../src/test.c(42):E0520020:Identifier "g_qe_touch_flag" is undefined
I am using the FPB RL78/G16 board. I only want to test is the touch button on CAP1 and CAP2 is working. In addition, if there have a example code for CAP3-5 that will be great.
Hello,
Have you used the QE for Capacitive Touch ?
I don't found any driver spell QE
The QE is a tool for tuning and monitor of CTSU.
Please watch the videos on how to use it:
www.renesas.com/.../qe-capacitive-touch-development-assistance-tool-capacitive-touch-sensors
I have try to follow the setting. It said the capicitive touch required a UART setting. So what UART I need to use for FPB-RL78/G16?
Also for the Renesas QE from the FPB-RL78/G16 only show there have Measuring Current only
The CTSU applications are supported from QE for Capacitive touch, as shown on the videos I shared.
However you have not yet installed this tool. Go to Renesas Views->Renesas Software Installer and select Renesas QE. There you will find all available QE tools, select the one for Capacitive Touch and use it according to the videos
Thanks for your reply. Now I can see some of the cap touch from Renesas QE. However I cannot find any function call Cap touch main(QE)