PSoC™ 6 Forum Discussions
Hello,
Question 1:Where can I configure the generated .map file (memory map)?
Question 2:I want to count the size of ROM and RAM occupied by each file. How to set Modus Toolbox 2.3?
Question 3:How to configure Modus Toolbox 2.3 like the .map file generated by Keil ?
Best wishes,
JCD
Show LessHello everyone,
I am new to PSoC and embedded systems in general. I am using a CY8CPROTO-063-BLE PSoC 6 PROTOTYPING KIT. I am trying to generate a signal of 45 kHz over 1 second, where it pulses for 10 ms of the entire second and the rest is a flat line. I have been attempting to replicate this small project for a long time, and I am really frustrated (Sorry I am a newbie and don't know nor understand much about PSoC).
This is basically similar to an example provided by the company itself, but they did not include any code with it. I guess the idea here is to use a timer counter (OneSecTImer in the pic) to time the other timer counter (Counter in the pic) to work every second, whereas the PWM (FreqGen in the pic) is what generates a signal for the Counter to capture. I am not sure if I am supposed to use a UART or not, but I included it and have been using printf() function to print the desired outputs to PuTTY program. The clocks of the FreqGen and Counter are at 1 MHz, whereas the clock for the OneSecTimer is at 1 kHz (I am not sure if these values are acceptable).
This picture is the settings for the OneSecTimer (also I am not sure if I am choosing the correct period, but I am aware that the count starts from 0 hence why I used 999u).
These are the settings for the PWM FreqGen. I am sure I had done the period wrong, as I had assumed that the period is supposed to be related to the desired 45 kHz output. And I had read on some other post that the compare should be half of the period (In the code I used one of the PDL commands to rewrite the period and compare).
These are the settings for the Counter, with the count input mode as rising edge. I am not sure if my settings will lead me to me to my desired goal.
This is the code I am using in the CM4, and nothing on CM0 other than the default generated code.
#include "project.h"
#include <stdio.h>
//----NOT SURE IF THESE ARE NECESSARY AND WHAT IS THEIR ROLE EXACTLY----//
#define PWM_FreqGen (PWM_FreqGen_HW)
#define OneSecTimer (OneSecTimer_HW)
#define Counter (Counter_HW)
#define MY_Counter_CNT_NUM (0UL)
#define MY_Counter_CNT_MASK (1UL << MY_Counter_CNT_NUM)
#define MY_TCPWM_FreqGen_NUM (0UL)
//----------------------------------------------------------------------//
void Counter_Int_Handler() //Counter interrupt handler
{
NVIC_ClearPendingIRQ(Counter_Int_cfg.intrSrc);
}
int main(void)
{
__enable_irq(); //Enabling global interrupts
UART_Start();
OneSecTimer_Start();
FreqGen_Start();
Counter_Start();
Cy_SysInt_Init(&Counter_Int_cfg,Counter_Int_Handler); //Calling the interrupt but what for?
NVIC_EnableIRQ(Counter_Int_cfg.intrSrc);
float period = 25;
float compare = period/2;
printf ("\ec"); //Clearing previous PuTTY outputs
printf("Link successful\r\n");
for(;;)
{
Cy_TCPWM_PWM_SetPeriod0(FreqGen_HW,FreqGen_CNT_NUM,period);
Cy_TCPWM_PWM_SetCompare0(FreqGen_HW, FreqGen_CNT_NUM,compare);
//-----------------------------TESTING BLOCK-----------------------------//
float status = Cy_TCPWM_PWM_GetStatus(Counter_HW,Counter_CNT_NUM);
float compare0 = Cy_TCPWM_PWM_GetCompare0(Counter_HW,Counter_CNT_NUM);
float compare1 = Cy_TCPWM_PWM_GetCompare1(Counter_HW,Counter_CNT_NUM);
float period0 = Cy_TCPWM_PWM_GetPeriod0(Counter_HW,Counter_CNT_NUM);
float period1 = Cy_TCPWM_PWM_GetPeriod1(Counter_HW,Counter_CNT_NUM);
float statusmask = Cy_TCPWM_PWM_GetStatus(Counter_HW,Counter_CNT_MASK);
float compare0mask = Cy_TCPWM_PWM_GetCompare0(Counter_HW,Counter_CNT_MASK);
float compare1mask = Cy_TCPWM_PWM_GetCompare1(Counter_HW,Counter_CNT_MASK);
float period0mask = Cy_TCPWM_PWM_GetPeriod0(Counter_HW,Counter_CNT_MASK);
float period1mask = Cy_TCPWM_PWM_GetPeriod1(Counter_HW,Counter_CNT_MASK);
//-----------------------------------------------------------------------//
if(status >= 45000){ //What I actually want this condition to be is to acces this statement when frequency is 45 kHz or greater
printf("First condition loop executed.\r\n");
printf("status: %f",status); printf("\n\r");
printf("compare0: %f",compare0);printf("\n\r");
printf("compare1: %f",compare1); printf("\n\r");
printf("period0: %f",period0); printf("\n\r");
printf("period1: %f",period1); printf("\n\r");
float GeneratedSignal = Cy_GPIO_Read(GeneratedSignal_PORT,GeneratedSignal_NUM);
printf("GeneratedSignal: %f",GeneratedSignal); printf("\n\r");
printf("Using mask:\r\n");
printf("statusmask: %f",statusmask); printf("\n\r");
printf("compare0mask: %f",compare0mask);printf("\n\r");
printf("compare1mask: %f",compare1mask); printf("\n\r");
printf("period0mask: %f",period0mask); printf("\n\r");
printf("period1mask: %f",period1mask); printf("\n\r");
Cy_GPIO_Write(RED_PORT,RED_NUM,!Cy_GPIO_Read(RED_PORT,RED_NUM));
CyDelay(500);
Cy_GPIO_Write(RED_PORT,RED_NUM,!Cy_GPIO_Read(RED_PORT,RED_NUM));
CyDelay(500);
}
else { //Ignore the else statement
//printf("Signal out of desired range!\r\nCurrent Signal value of Status = %f",status); printf(" Hz\r\n");
//printf("Compared to a signal of %f",capture); printf(" Hz\r\n");
printf("First condition loop executed.\r\n");
printf("status: %f",status); printf("\n\r");
printf("compare0: %f",compare0);printf("\n\r");
printf("compare1: %f",compare1); printf("\n\r");
printf("period0: %f",period0); printf("\n\r");
printf("period1: %f",period1); printf("\n\r");
float GeneratedSignal = Cy_GPIO_Read(GeneratedSignal_PORT,GeneratedSignal_NUM);
printf("GeneratedSignal: %f",GeneratedSignal); printf("\n\r");
for (int i = 9; i >= 0; i--){
Cy_GPIO_Write(RED_PORT,RED_NUM,!Cy_GPIO_Read(RED_PORT,RED_NUM));
CyDelay(100);
}
}
printf("Next cycle~\r\n");
CyDelay(1000);
//Cy_TCPWM_PWM_Disable(FreqGen_HW, FreqGen_CNT_NUM); Do I need to disable and enable this?
}
}
I had tried many different readable parameters as an attempt to find the generated signal, but I am left with so many question. Before the questions, here is the picture of the output on PuTTY. Another note, retarget I/O is ticked.
I have no idea what most of these numbers output actually mean as the numbers seem like gibberish right now.
For my questions:
1) Is the logic of the build correct and what are the settings that I need to change.
2)If all the settings are now correct, would the attached code output the actual generated signal by the PWM?
3)How do I modify the code or correct so it pulses the 45 kHz signal over 10 ms out of a whole second.
4)Why does the PWM interrupt cause the loop to execute only once when the interrupt is called in void main in the first place?
5)When I do comment out the interrupt, the entire loop keeps on looping correctly with the LEDs blinking as I had written in the code. On the other hand, when I do include the interrupt, only the printf() functions execute and then it feels like the rest of the loop is frozen and not executing.
6)Do I need to add an ADC in order to actually be able to read and generate a signal or is the logic build provided sufficient?
I know this is very long, and thank you to everyone who will help or just tag a long in the journey of learning PSoC and solving this small project.
Best regards,
Issa Hoballah.
Show LessI am using the CY8C6116BZI-F54 PSoC 6 in a design and I am utilizing the internal SegLCD peripheral driver to drive a 3.3 V COG LCD with 46 SEGs and 6 COMs. I am having an issue where the when I command certain segments to turn off, it disables all of the segments on the same common line. It seems like the Device Configurator is generating code that is allowing this problem to occur. For example, in cycfg_routing.h, here are the defined terms for the COMs:
#define LCD0_DRIVE0_COM0 15
#define LCD0_DRIVE0_COM1 16
#define LCD0_DRIVE0_COM2 17
#define LCD0_DRIVE0_COM3 18
#define LCD0_DRIVE0_COM4 19
#define LCD0_DRIVE0_COM5 14
And here are the defined terms for the SEGs that I am seeing the problem occur with:
#define LCD0_DRIVE0_SEG9 15
#define LCD0_DRIVE0_SEG15 16
#define LCD0_DRIVE0_SEG16 17
#define LCD0_DRIVE0_SEG17 18
#define LCD0_DRIVE0_SEG18 19
I noticed there doesn't seem to be any LCD0_DRIVE0_SEGXY terms that happen to match LCD0_DRIVE0_COM5's value of 14. This creates a problem when calling the Cy_SegLCD_ClrPixel() function to clear the segment on each common with the same defined value. Let me explain. Considering the defined terms above in cycfg_routing.h, if I call the following functions in my application after initializing the LCD peripheral with all of the segments ON:
Cy_SegLCD_ClrPixel(LCD0, CY_SEGLCD_PIXEL(LCD0_DRIVE0_SEG_9, 0UL));
Cy_SegLCD_ClrPixel(LCD0, CY_SEGLCD_PIXEL(LCD0_DRIVE0_SEG_15, 1UL));
Cy_SegLCD_ClrPixel(LCD0, CY_SEGLCD_PIXEL(LCD0_DRIVE0_SEG_16, 2UL));
Cy_SegLCD_ClrPixel(LCD0, CY_SEGLCD_PIXEL(LCD0_DRIVE0_SEG_17, 3UL));
Cy_SegLCD_ClrPixel(LCD0, CY_SEGLCD_PIXEL(LCD0_DRIVE0_SEG_18, 4UL));
It will disable all of the segments on COMs 0 - 4, even though I only intend to clear a single segment with each function call. Upon further inspection of the CY_SEGLCD_PIXEL() macro, it seems like all of the LCD0_DRIVE0_SEGXY terms should be unique and different from all of the LCD0_DRIVE0_COMXY terms.
So my question is, why is the Device Configurator and SegLCD Configurator tools generating these defined terms with matching values between the COMs and some of the SEGs? Am I missing something, or is there a bug with the configuration tool(s)? I checked the HSIOM routing for the pins assigned to each of the aforementioned SEGs and COMs and they are all using different HSIOM routing, so I don't believe this would be a hardware issue where the SEG signals are clashing with the COM signals on those pins.
I have verified that all of my pin assignments and segment mapping in the configuration tools are correct and all physical connections to my LCD are correct as well.
I have included the BSP with the generated source files for the project I am referring to to aid in the discussion. Please let me know if I should include any application code, or if I am missing something, or if there may be an issue in the configuration tool(s).
Show LessAccording to an earlier on Oct 12, 2020 post the following was the response:
"PSoC 64 devices are under study for FIPS 140-2. Devices are listed on NIST website as targets under review. 2M and 512K options will be available. We are expecting FIPS 140-2 L1 approval by NIST summer 2021. But do understand the timeframe in actual can vary."
Is the PSoC64 fully currently fully FIPS 140-2 or FIPS 140-3 certified?
If the answer is "yes" can you either send me a link to the certification or the actual certification?
Thanks
Show Less
Hello everyone, I am trying to send heart rate measurements from MAX30101 sensor to CySmart app using psoc-062 ble pioneer kit. I am using CE217639 code example. I managed to connect with mobile and enable notifications:
Terminal output:
Notifications are enabled when Heart Rate measurement tab is opened in an app.
After that programm is simulating HeartRate and sending notification with: HrssSendHeartRateNtf(connhandle) function.
In which following statement (cccd == CY_BLE_CCCD_NOTIFICATION) is never true and measurements cannot be send via BLE:
cccd = 0 every time.
I also tried with sending just sensor location changing Cy_BLE_HRS_HRM to Cy_BLE_HRS_BSL, but that also didn't help.
Am I missing something in configuration of ble connection?
I would appreciate any kind of help. Example is working fine
Michal
Show Less
What parts of my PSoC Creator based PSoC 63 design can be used for a PSoC 64 design in ModusToolbox?
I like the concept of adding a security enclave to my PSoC 6 BLE interface.
PSoC 64 seems to be the right option with a footprint identical component.
I'm upgrading from a CY8C6347BZI-BLD53 to a CYB06447BZI-BLD53.
Greg
Show LessHello,
I have been working on a project that involves sending and receiving MQTT messages to and from AWS IOT Core to the CY8CKIT-064S0S2-4343W (AWS Pioneer) board. I wanted some help or possibly some references to help figure out the process of using cypress libraries (or any other) to send out JSON formatted messages with MQTT.
I did try looking into the AWS Shadow example given in the demo project, but it seems to be too complicated to get started. If possible, do let me know a good approach or resource that would be easier for a simple MQTT send and receive operation.
I wish to also understand what function is exactly called when send() is invoked in the file iot_mqtt_operation.c as shown below (this is a part of the Shadow demo project).
Regards,
Pikamaps
Show LessI'm developing a system including usb mass storage. I tested the USB_Mass_Storage_Logger sample with CY8CPROTO-062-4343W Prototyping kit and it worked good.
Then I modified the same source for my developing board, with CY8C6347FMI-BUD53 MCU. I introduced custom BSP as follow.
bsp TARGET_GEN=myBSP DEVICE_GEN=CY8C6347FMI-BUD53
BSP build and board programming was succeeded and temporarily operated. But the operation of the board was not good. When I connected the board to Windows 10 PC, drive was recognized, file list could be seen, and the each file could open and see the contents of the files. But in high probability the files couldn't open and then drive couldn't never be accessed till the board disconnected or powered off.
I suspect that the CY8C6347FMI-BUD53 BSP operation around usb msc is unstable.
Tested environment is the Modus Toolbox 2.2, 2.3.1 both. For 2.3.1, all the libraries are updated to latest versions.
Please let me know how to solve the problem, or hints to solve.
Regards,
Show LessHi,
FreeRTOS now supports multicore, is it possible to use the same for PSOC6 to use both cores ?
Do we have a example port/setup utilizing the same.
Freertos link on SMP support -
BR,
Sunny
Show Less