Hello!
This project demonstrates the PioneerKit Plug and Play Sensor application for direct connection with SNTerminal running on Desktops and Mobiles giving full access to monitor and control the key status, capsense slider, internal temperature, and LED light parameters: color, brightness and contrast.
The key selects between the last three light control parameters, the color, brightness and contrast, which selected parameter is then controlled by sliding the capsense 5 segments. The state can be observed and modified with the SNTerminal app, which communicates with the board via UART interface and the compact Sensor Network Protocol.
Project schematic:
Firmware description:
Firmware is composed of main.c containing the application, and the sn_cfmsg.c/.h containing the SNP Compact Frame/Message Layers.
The ISOTEL SNP - Message Layer specifications provide a compact math enriched content description, making your device a 'web' like box. Message layer defines a two kind of messages:
- content description, the static part typically exchanged only once contains elements such as text formatting, data structures, variables, expressions with precision and accuracy calculation, ideal for sensor applications,
- dynamic part consisting of arguments exchanged in PSoC4 native format, and are exchanged on value change, either on PSoC4 side or user side. No conversion needs to be done on the PSoC4 side for either input or outpt, preserving maximum precision, accuracy, and releasing the CPU power requirements.
Regarding this project, the PSoC4 application needs to implement three functions only:
- sn_cfmsg_reqdesc: provides an app content description, which are send out only on request,
- sn_cfmsg_send: provides parameters,
- sn_cfmsg_recvargs: a handle that receives parameters from user input.
Hardware connections:
You will need to wire the UART TX and RX pins between the PSoC 4 and the PSoC 5LP on the pioneer kit (See picture below). There are no other hardware connections.
Test your project:
- You will need to download the SNTerminal software written in JAVA.
- Program PSoC 4 Pioneer Kit with attached PioneerPnPSensors project.
- Double Click on the SNTerminal-130624-1.jar software should start the application automatically if JAVA JRE is installed correctly. If serial device driver is properly installed it will be listed on the bottom line of the start page. Click on it, enter the COM settings below and click OK. If everything is okay the DeviceView dialog appears as shown in the picture below.
Please read SNTerminal User’s manual or watch the video for more details.
I hope this example can help you out in your design.
Best,
Tomi