- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the CY8CKIT-149 PSoC® 4100S Plus Prototyping Kit, what view the touchpad serial data in a terminal emulator? Reading serial data is a very important design consideration in my application.
Solved! Go to Solution.
- Labels:
-
ispn:40045:1:0
-
l1:314:1:0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JoJo_4453281,
You can use UART block to read and write serial data. You can refer to this code example CE224406 - PSoC 4 UART which prints data on the serial terminal application. You can refer to UART Component datasheet for more information regarding UART block.
Please let me know if you have any further queries.
Thanks and Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JoJo_4453281,
You can use UART block to read and write serial data. You can refer to this code example CE224406 - PSoC 4 UART which prints data on the serial terminal application. You can refer to UART Component datasheet for more information regarding UART block.
Please let me know if you have any further queries.
Thanks and Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I made a simple sample using both UART and CapSense Tuner.
You can enable/disable uart schematic or ezi2c schematic.
If you disable both uart schematic and ezi2c schematic,
the project just works as CapSense -> LED sample
If you enable uart schematic, button state will be written to the serial output
Tera Term Log
If you disable uart schematic, and ezi2c schamtic is enabled.
You can use CapSense Tuner.
To use CapSense Tuner please note
(1) Build and Write the Project into CY8CKIT-149
(2) Make sure no serial terminal program is connected
(3) Program is working (i.e. If you touch the button(4.5), the LED12 lights)
(4) Then from the schematic of capsense
Right Click the CapSense component and select "Launch Tuner"
(5) When Sense Tuner Started, select "Connect" button
(6) When Connected, Select "Start" button
Note: I always forget this...
(7) Then when you touch the CapSense Button, the level is graphically displayed
when I touch the button
Schematic
Note: I created 3 pages
1. capsense page
2. uart page
3. ezi2c page
Pins
main.c
==================
#include "project.h"
#include "stdbool.h"
#include "stdio.h"
#if !uart__DISABLED
#define USE_UART
#define METHOD USE_UART
#define STR_LEN 32
char str[STR_LEN+1] ;
void print(char *str)
{
UART_UartPutString(str) ;
}
void cls(void)
{
print("\033c") ; /* reset */
CyDelay(20) ;
print("\033[2J") ; /* clear screen */
CyDelay(20) ;
}
void splash(char *prog_name)
{
cls() ;
if (prog_name && *prog_name) {
print(prog_name) ;
}
print(" (") ;
print(__DATE__) ;
print(" ") ;
print(__TIME__) ;
print(")\n") ;
}
#endif /* !uart__DISABLED */
#if !ezi2c__DISABLED
#ifndef USE_UART
#define USE_TUNER
#endif /* ifndef USE_UART */
#endif /* !ez_i2c__DISABLED */
#define LED_ON (0u)
#define LED_OFF (1u)
void init_hardware(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
#ifdef USE_UART
UART_Start() ;
splash("CY8CKIT-149 CapSense Test") ;
#endif
#ifdef USE_TUNER
EZI2C_Start() ;
EZI2C_EzI2CSetBuffer1(sizeof(CapSense_dsRam),
sizeof(CapSense_dsRam),
(uint8 *)&CapSense_dsRam
);
#endif
}
int main(void)
{
bool buttonState = false;
init_hardware() ;
CapSense_Start() ;
CapSense_ScanAllWidgets() ;
for(;;)
{
if (CapSense_NOT_BUSY == CapSense_IsBusy()) {
CapSense_ProcessAllWidgets() ;
buttonState = CapSense_IsSensorActive(
CapSense_BUTTON0_WDGT_ID,
CapSense_BUTTON0_SNS0_ID
);
#ifdef USE_UART
snprintf(str, STR_LEN, "%d\n\r", buttonState) ;
print(str) ;
CyDelay(10) ;
#endif
#ifdef USE_TUNER
CapSense_RunTuner() ;
#endif
if (buttonState) {
LED12_Write(LED_ON) ;
} else {
LED12_Write(LED_OFF) ;
}
CapSense_ScanAllWidgets() ;
}
CyDelay(20) ;
}
}
==================
moto