The CYW954907AEVAL1F EVK enables customers to evaluate and develop single-chip Wi-Fi applications using CYW54907 devices. The CYW954907AEVAL1F EVK uses WICED Studio IDE to develop and debug your CYW54907 projects. In this code example, I have interfaced Infineon's precision pressure sensor DPS310 to the 54907 evaluation board and measured the temperature and pressure values of the surroundings via I2C. The required pins of the sensor are --> VDD(Supply Voltage 3.3V for analog blocks), VDDIO (Digital Supply Voltage 3.3V for digital blocks and I/O interface), GND, SDI and SCK. The application is implemented in WICED STUDIO IDE. The provided code example for DPS310 can be used for various IOT applications such as indoor navigation, health and sports, outdoor navigation, weather station etc.
Let's get started with the sensor's introduction!
The Infineon's DPS310 is a miniaturized Digital Barometric Air Pressure Sensor with a high accuracy and a low current consumption, capable of measuring both pressure and temperature. The pressure sensor element is based on a capacitive sensing principle which guarantees high precision during temperature changes. The small package makes the DPS310 ideal for mobile applications and wearable devices.
The internal signal processor converts the output from the pressure and temperature sensor elements to 24 bit results. Each unit is individually calibrated, the calibration coefficients calculated during this process are stored in the calibration registers. The coefficients are used in the application to convert the measurement results to high accuracy pressure and temperature values. The result FIFO can store up to 32 measurement results, allowing for a reduced host processor polling rate. Sensor measurements and calibration coefficients are available through the serial I2C or SPI interface. The measurement status is indicated by status bits or interrupts on the SDO pin.
For more features information and typical applications, refer to the DPS310 datasheet attached.
Temperature and Pressure Measurement
Calculation of Compensated Values
1. Read the pressure calibration coefficients (c00, c10, c20, c30, c01, c11, and c21) from the Calibration Coefficient register. Note: The coefficients read from the coefficient register are 2's complement numbers.
2. Choose scaling factors kT (for temperature) and kP (for pressure) based on the chosen precision rate. The scaling factors are listed in datasheet.
3. Read the pressure and temperature result from the registers or FIFO. Note: The measurements read from the result registers (or FIFO) are 24 bit 2´s complement numbers. Depending on the chosen measurement rates, the temperature may not have been measured since the last pressure measurement.
4. Calculate scaled measurement results.
5. Calculate compensated measurement results.
Known Issues
There could be a problem with temperature measurement of the DPS310. If your DPS310 indicates a temperature around 60 °C although you expect around room temperature, e.g. 20 °C, you have to update some registers with the specified values as given in the "DPS310_correct_temp_error" function in my code example and this will then provide the correct temperature value. As per Infineon, this can occur because of a fuse bit issue in some of the sensor's silicon. The function allows us to work around the issue.
For more information on this, please visit this link --> https://www.infineon.com/cms/en/product/sensor/pressure-sensors/pressure-sensors-for-iot/dps310/
PFA the code example and the snapshots for the same. Feel free to drop in your queries in the Cypress Developer Community.
Cheers!
Show LessThis blog post shows how to use macros in WICED to debug TLS (Transport Layer Security) data. The mbedTLS library provides debug macros MBEDTLS_DEBUG_C, MBEDTLS_SSL_DEBUG_ALL and MBEDTLS_DEBUG_LOG_LEVEL defined in /WICED/security/BESL/mbedtls_open/include/mbedtls/config.h and they are disabled by default. You can enable those macros and define MBEDTLS_DEBUG_LOG_LEVEL as per the level of debugging required. Higher the level, more details can be captured in the logs. The log levels are defined as shown below:
0 No debug
1 Error
2 State change
3 Informational
4 Verbose
In addition, you also need to enable WPRINT_ENABLE_SECURITY_DEBUG in /include/wiced_defaults.h. Please note that debug printing consumes a lot of memory so you need to allocate at least 4 kB to the stack of every thread that uses debug printing.
Show LessAttached to this post are three examples that are specific for CYW943907AEVAL1F EVK.
These examples are briefed in the CYW943907AEVAL1F EVK User Guide.
Please refer to "2.2 Install Software" section of the same User Guide on how to add them.
Chapter "5. Code Examples" briefs about the same examples in the User guide.
Show LessThe following table lists all applications that are supported within WICED Studio 5.0(or later) on the CYW943907AEVAL1F EVK .
Please refer to the CYW943907AEVAL1F EVK User Guide when compiling, downloading and debugging applications with this platform.
Sl.no | Location inside WICED Studio (. signifies next level path) | Description |
---|---|---|
1. | snip.gpio | Demonstrates how to use WICED GPIO API to toggle LEDs and read button states |
2. | snip.scan | This application snippet regularly scans (by default once in every 5 secs) for nearby Wi-Fi access points and prints information about the same. |
3. | snip.apsta | Demonstrates Wi-Fi client mode (to send a regular ICMP ping to an AP) and |
4. | snip.crypto | demonstrates how to use crypto functions available in the WICED crypto library |
5. | snip.custom_ie | This application snippet demonstrates how to add and remove custom (Information Elements) IEs in AP Beacons, using Wi-Fi softAP interface. |
6. | snip.dct_read_write | This application demonstrates how to use the WICED DCT (Device configuration Table) API to access the WICED DCT. |
7. | snip.ap_clients_rssi | This application snippet demonstrates how to retrieve a list of Wi-Fi clients associated to the WICED softAP and obtain the RSSI (signal strength) for each client. |
8. | snip.coap_app | This application snippet demonstrates how to react to COAP packet from network client and activate the services exported by Coap. |
9. | snip.config_mode | This application demonstrates how to use WICED Configuration Mode to automatically configure application parameters and Wi-Fi settings via a softAP and webserver |
10. | snip.wps_registrar | This application snippet demonstrates how to use the WPS Registrar on an existing softAP interface |
11. | snip.http_server_sent_events | This application snippet demonstrates how to send events from a HTTP server back to its clients. |
12. | snip.https_client | This application snippet demonstrates how to use the WICED DNS (Domain Name Service) & HTTPS API |
13. | snip.https_server | This app connects to a Wi-Fi network as a STA (client), then starts a secure web-server and waits for requests. It also starts a non-secure web-server which provides a redirect that redirects any non-secure requests to the secure webpages. |
14. | snip.led_example | This application demonstrates how to use daemons/led_service to turn LEDs on and off, display patterns. |
15. | snip.link_status | This application demonstrates how to asynchronously handle changes in the Wi-Fi link connection status. |
16. | snip.stdio | This application demonstrates how to use the UART for STDIO operations. |
17. | snip.tcp_client | This application snippet demonstrates how to connect to a Wi-Fi network and communicate with a TCP server |
18. | snip.tcp_server | This application snippet demonstrates how to used the WICED TCP API to implement a TCP server |
19. | snip.thread_monitor | This application demonstrates how to use the WICED System Monitor API to monitor the operation of the application thread. |
20. | snip.uart | This application demonstrates how to use the generic WICED UART API to send and receive characters on the UART. |
21. | snip.websocket_client | This application snippet demonstrates how to use a simple Websocket Client protocol. |
22. | snip.wps_enrollee | This application snippet demonstrates how to use the WPS Enrollee |
23. | test.console | This application demonstratest test console which can be used for a variety of commands including iperf, ping, etc. |
24. | demo.appliance | This application demonstrates how a simple web page can be used to send information to a UART when a button on the webpage is clicked. |
snip.wps_registrar
Show Less