Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Blogs

icon

Blogs

thumbnail
Grow in your community journey, as you contribute.
thumbnail
The dream: Secure, reliable connectivity & universal interoperability in my ...
thumbnail
Welcome to our Memory Solutions blog space! We’ll be posting here on a weekly o...
thumbnail
OverviewThis project demonstrates how to interface the Infineon 3D Magnetic sensor with Cypress’ PSoC 6 wireless device and showcase an automotive use case example of knob control with TFT display.Project Technology FocusesPSoC 6 MCU3D Magnetic SensoremWin GraphicsFreeRTOSProject RequirementsHardwarePSoC 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WiFi-BT)TFT Display Shield Board (CY8CKIT-028-TFT)Infineon 3D Magnetic Sensor (TLE493D-A2B6 MS2GO)Rotate Knob (Rotate Knob 3D 2 Go Kit)​Wires and Double TapeSoftwareModusToolbox™ Software Environment 2.1Tera TermProject DescriptionThe objective of this project is to read the 3D magnetic sensor data and display it on the TFT display. It mimics the use case of knobs for automotive and industrial application. The Infineon sensor TLE493D-A2B6 is a 3-dimensional magnetic sensor with I2C interface. The evaluation kit and Knob can be ordered from Infineon or distributor website.Project SetupTo interface with Cypress PSoC 6 WiFi-BT Pioneer Kit, we need to break the sensor part from the Infineon evaluation board. The separated sensor part will have the following pin connections.This separated board is interfaced with the PSoC 6 WiFi-BT Pioneer Kit using fly wires.The sensor board and Knob are separated by 3 to 5 mm air-gap and taped with the board using some double-sided tape.Pin DetailsInfineon 3D Magnetic SensorPSoc 6 WiFi-BT Pioneer KitSCLP6_0SDAP6_1VDDP6_2GNDGNDThe 3D Magnetic sensor is powered through the PSoC 6 MCU pin P6_2 (3.3v). PWM is used on pin P1_5 to control the brightness of the LED8. The PsoC 6 WiFi-BT Pioneer Kit is powered via Type C USB cable.DisplayThe CY8CKIT-028-TFT display shield board has a 2.4 inch TFT screen which is mounted on Arduino compatible pin headers of PSoC 6 WiFi-BT Pioneer Kit. The values obtained from the sensor is updated in TFT screen with the help of emWin graphics library.Code Flow​Configure the SensorIn this project we put the sensor in master controlled / power down mode and INT is disabled. Trigger option is used to start the ADC conversion in the 3D magnetic sensor. Refer the sensor datasheet for more details.Two key registers must be configured to disable interrupt and enable trigger mode as shown below, CONFIG (0x10) MOD1 (0x11)PSoC 6 I2C master clock is configured at 400 KHz. The sensor values are read with 20 ms interval. To obtain the angle of rotation refer to the application notes. Running the DemoTo run this demo, Download the project files attached with this post (ccm01_source.zip) and Import into ModusToolbox IDE. Open the CLI terminal and resolve the library dependencies by executing the 'make getlibs' command. Refer the user manual for importing existing projects into ModusToolbox IDE.Rotating the Knob updates the fill bar and knob graphics in the display. Pushing the knob switches the control between the fill bars and highlights it.The sensor values are sent to the UART console. Take a look at the demo in this video here
thumbnail
In this blog, we will discuss about the Protected Update process of an object fo...
thumbnail
Discover it with automated lifetime estimation in IPOSIM
thumbnail
Professor Steve Leeb of MIT tells us how he and his students kept learning durin...
thumbnail
Having a GUI makes developing applications more intuitive. The visual feedback and ease of use are really helpful. But, sometimes, I like to use the command line to learn what is happening in the background. So, this blog will be focusing on what happens when you create projects using the Command Line Interface. I’ll show you things you would never usually think about, to give you a different perspective so that you can learn something new. We are going to look into the project-creator-cli tool. But before that, there are some things you need to know about ModusToolbox. It uses Cygwin under the hood and all tools are verified to be compatible with *NIX terminal environments. Based on the OS you are using, you need to keep this in mind:All Linux terminal applications are compatible.All macOS terminal applications (including the Apple-provided Terminal App) are compatible.On Windows, you need to run the “Cygwin.bat” script available inside the “tools_2.0\modus-shell” directory. The Windows “Command Prompt” and “Power Shell” aren’t tested/supported/known to be compatible.Okay, now we are all set. The project-creator-cli tool comes packaged with ModusToolbox and as the name suggests it creates a project. This is the first step you will take while creating any ModusToolbox application. Every command-line tool comes with a “--help” (dash dash help) option to provide information on what it can do. I like playing with my toys first and then looking at the user manual. You can refer to the docs folder for usage documentation but I do that only when I get stuck. So, type in “project-creator-cli.exe --help” to get the list of options. Before I can pass in all the arguments, I need information on what kind of values I can provide. As the help info suggests, I can list the boards and applications using the “--list-boards” and “--list-apps <board>” and I’m going to do just that. Okay great. Now that I have all the information I need, I can pass in the arguments. I’m going to ignore the optional arguments. >> ./project-creator-cli.exe --board-id CY8CPROTO-062-4343W --app-id mtb-example-psoc6-empty-appThe project will be created in the user profile directory by default as shown in the figure above. The project folder will have the same name as the application name. Here is an assignment for you to try over the weekend - Try out the “-d” and “-n” options to create the application in your target directory and to specify the application names respectively. When you create a new application using the Eclipse IDE, this is exactly what happens in the background. Based on the target and application template selected, it passes them as arguments to the backend process that creates the project. That’s the beauty of the command line. It is hard work, but you understand how things flow. I hope this gave you a new perspective and you learned something new today. Stay tuned for more such content!PS: This was my first blog. You will see more from me in the coming few weeks. I am planning to write about building and programming an application all from the command line next. Let me know if you would like to add something else as well.
thumbnail
In this project, we will be integrating the onboard thermistor with the AnyCloud TCP Client project in the Modus Toolbox. We will be using thermistor libraries and their respective APIs to work with the onboard thermistor. Hardware setupPSoC 6 Wi-Fi BT Prototyping Kit (CY8CPROTO-062-4343W)The thermistor is connected to PSoC 6 pin 10.1 and 10.2, as shown on the board. Software setupWe will start by creating the AnyCloud TCP Client project in the MODUS Toolbox. We can create the project by clicking on New Application in Quick Panel. Select the BSP as CY8CPROTO-062-4343W Kit. Select the AnyCloud TCP Client, you can rename the project if needed. Click on Create.Now as we have created the TCP Client project, we need to add the libraries which will be required for this project. In this project, we will be requiring a thermistor library and to do that, click on Library Manager under Tools in the Quick Panel and select thermistor (under Board Utils) as shown.After successfully adding the library, we need to include the library in the project i.e. #include “mtb_thermistor_ntc_gpio.h”. DescriptionThe project contains three major source files - main.ctcp_client.ctcp_client.h In tcp_client.h we are adding few marcros, which are:#define THERM_GND P10_0#define THERM_VDD P10_3#define THERM_OUT P10_2 NOTE: For CY8CPROTO-62-4343W Kit, we need to swap the GND and VCC pin macros as there is a slight error in the hardware. Hence, the macros for the PROTO kit would look like:#define THERM_GND P10_3#define THERM_VDD P10_0#define THERM_OUT P10_2 In tcp_client.c we are adding the following code:The thermistor used in this kit is NCP18XH103F03RB. It follows negative temperature coefficient (NTC) characteristics i.e. the resistance decreases with an increase in temperature.The software flow is as follows:1. After adding the include files, we need to create few structures for the thermistor as: mtb_thermistor_ntc_gpio_t mtb_thermistor_obj; cyhal_adc_t adc_obj; /* Refer thermistor datasheet for the values */mtb_thermistor_ntc_gpio_cfg_t therm_gpio_cfg= { .b_const = (float)(3380), // Refers to beta constant.r_infinity = (float)(0.1192855), //Refers to resistance at infinity /**Resistance of the thermistor is 10K at 25 degrees C (from datasheet). Therefore R0 = 10000 Ohm, and T0 = 298.15 Kelvin, which gives R_INFINITY = R0 e^(-B_CONSTANT / T0) = 0.1192855 **/ .r_ref = (float)(10000) // Refers to reference resistance }; All the above structures will be used in the thermistor APIs for temperature calculations. Ideally, we initialize them as global. 2. Next, we will initialize the thermistor using the pre-defined APIs as:result = cyhal_adc_init (&adc_obj, THERM_OUT, NULL); result = mtb_thermistor_ntc_gpio_init (&mtb_thermistor_obj, &adc_obj, THERM_GND, THERM_VDD, THERM_OUT, &therm_gpio_cfg); We need to first initialize ADC, and for that, we are using the HAL API of the ADC i.e. cyhal_adc_init () as shown. It takes three arguments, reference to ADC structure, ADC pin (THERM_OUT), and clock. Three GPIO pins of the PSoC are being used here, which are: THERM_OUTAs shown on the board, this is an analog pin 10.1 or 10.2, where the thermistor is connected THERM_VDDThis is a GPIO pin which will be pulled high acting as VDD for thermistor. THERM_GNDThis is a GPIO pin which will be pulled low acting as ground for thermistor. All these GPIO initialization are done in terms of MACROS in tcp_client.h file. After ADC initialization, we initialize thermistor GPIO i.e. mtb_thermistor_ntc_gpio_init (). It takes six arguments, reference to thermistor structure, reference to ADC structure, VDD pin, GND pin, Output/ADC pin, and reference to thermistor configuration structure. 3. We are done with the initialization and we shall use the temperature API, which accepts the readings got from ADC and converts them into temperature (degree centigrade).value = mtb_thermistor_ntc_gpio_get_temp(&mtb_thermistor_obj); The above API takes one argument as reference to thermistor object and the API returns the floating-point value which is the actual measured temperature in degree centigrade. 4. After getting the values, we simply pass the values into the tcp_client_recv_handler() function, which will simply print the values on UART (i.e. TCP Client) w.r.t. the command received from the TCP Server. 5. If in TCP server, the command sent is “1” then the TCP Client will print the value of thermistor on UART and will acknowledge the TCP Server by sending the same value to it and simultaneously will turn the LED and ADC On. Similarly, if the command is “0”, TCP Client will not send the readings and will turn the LED and ADC OFF as shown in the below figures. Figure: TCP Client (UART) Figure: TCP Server (Python) Note: Please update the WIFI_SSID, WIFI_PASSWORD, and TCP_SERVER_IP_ADDRESS macros in tcp_client.h.Hope you all like it. Here is the thing you can try –Try porting the code in PSoC 6 WiFi BT Pioneer kit (CY8CKIT-062-WiFi BT) using EPD libraries.
thumbnail
In this blog, we will discuss about structure of Metadata and its associated fie...
thumbnail
In this blog, we will learn about hardware security, its importance and will bri...
thumbnail
The digital signature is a scheme to validate the privacy of a conversation, int...