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.
Make Your PioneerKit Mobile by using an Android Phone
we have finally made the PioneerKit PsoC4 work with your Android (version 3.4+) phone!
The onboard PsoC5, which is used as a programmer and UART serial access with the PsoC4 silicion, must be reprogrammed to behave as standard profilic USB<->UART adapter, what is very easy since the PsoC5 features an USB bootloader.
Steps:
- Unplug the PionnerKit
- Keep holding the PioneerKit's reset (SW1) button, plug it back to your USB port, wait at least 1-2 seconds
- Run app: PSoC Creator select > Tools > Bootloader Host
- Click on button: Filter, and enter: VID as 0x04B4, PID as 0xF13B
- Load the usb2uart.cyacd file, by opening it by pressing the Open toolbar icon
- Press program device.
That's it.
You may use/access the PioneerKit board from your Android device immediately. To use it on Windows use the device drivers below.
DO NOT FORGET TO FIRST DOWNLOAD THE PsoC4 APPLICATION!
To be able to download your app to PsoC4 you must restore the PsoC5 firmware. To do that, follow again above steps and use the file KitProg.cyacd file attahed below as well.
Note: Since the latest version of the SNTerminal brings paragraphs (\n) besides the line-breaks (represened by \r character now) we have also updated the PsoC4 project. You may not need to update it, but there will be some more spacing between the lines, since \n is now treated as new paragraph.
PS: Please update to the latest Android version
Please also use the latest PSoC4 project attached below, with minor updates in the SNP messages.
I hope this example can help you out in your design.
Best, Tomi