PSoC™ 4 Forum Discussions
Hi, I am using CY8C4045AZI-S413 for my project. In IDLE state machine, the code simply wakes up every 500ms and checks for proximity widget. The wired part is if I turn off the sleep feature, system state machine will transfer smoothly to Touched_State. If I turn sleep function on. It will take a long time to transfer state machine.
static SUB_STATE main_idle_state(void){
SUB_STATE sub_state = S_NONE;
CAP_OUT_Write(1);
VDD_LED_CTRL_Write(0);
memset(WORK_BUFFER, 0, WORK_BUFFER_LENGTH);
bool is_btn_processed = true;
while(sub_state == S_NONE){
/* Scan all widgets */
if(CapSense_NOT_BUSY == CapSense_IsBusy() && is_btn_processed == true){
CapSense_SetupWidget(CapSense_PROXIMITY0_WDGT_ID);
CapSense_Scan();
is_btn_processed = false;
}
/* If a wakeup command received from master... */
if(WORK_BUFFER[0] == 0x5A){
g_fast_scan_delay_counter = FAST_SCAN_DELAY;
g_watchdog_match_value = WDT_TIMEOUT_FAST_SCAN;
sub_state = S_MASTER_EVT;
break;
}
if(CapSense_NOT_BUSY == CapSense_IsBusy() && is_btn_processed == false){
CapSense_UpdateWidgetBaseline(CapSense_PROXIMITY0_WDGT_ID);
CapSense_ProcessWidget(CapSense_PROXIMITY0_WDGT_ID);
//if(CapSense_IsWidgetActive(CapSense_PROXIMITY0_WDGT_ID)){
if(CapSense_IsProximitySensorActive(CapSense_PROXIMITY0_WDGT_ID,0)){
/* Initialize fast scan delay counter */
g_fast_scan_delay_counter = FAST_SCAN_DELAY;
g_watchdog_match_value = WDT_TIMEOUT_FAST_SCAN;
CAP_OUT_Write(0);
sub_state = S_TOUCH_EVT;
break;
}
is_btn_processed = true;
}
/* Put CPU to sleep. When the WDT interrupt occurs, CPU will wakeup
and perform the next scan */
#if (POWER_SAVE_MODE != 0)
if(sub_state == S_NONE){
//CySysPmSleep();
GotoSleep();
}
#endif
}/*while(sub_state == S_NONE)*/
return sub_state;
}
Show LessI have written basic code for reading x,y and z axis data from ADXL362 accelerometer using SPI protocol.Following are the problems I am facing while using SPI protocol with PSOC4 BLE ki(CY8C4247LQI-BL483):
1.when SPI is used in Byte mode with Rx buffer size set more than 16, then SPI won't work and data is not received from ADXL362. If Rx buffer size is less than or equal to sixteen than program works and data is received.
2.If I change pin configuration as mentioned below in the same program then SPI won't work even if the Rx buffer size is less than or equal to 16.
P4.0=SCB1_SPI_MOSI[0]
P4.1=SCB1_SPI_MISO[0]
P5.0=SCB1_SPI_SS0[0]
P5.1=SCB1_SPI_SCLK[0]
I have attached code below please help.
Show LessHello All,
I recently started working as a teaching assistant for an embedded electronics program. We use the CY8CKIT-042-BLE as well as a few others, but I have an issue with a few of BLE Kits. When I go to program the kit the select debug target window appears and all I see is the KitProg/Serial number and no chip attached to it. All of these kits seem to have the CY8C4247LQI-BL483 attached to it. I've updated the kitprog firmware to the most recent (2.18) using psoc programmer and im using psoc creator 4.1. Anyone have an idea what my next steps should be to try and troubleshoot these?
Show LessI'm using a CY8CKIT-042 in my design. ALL my I/O is used for other purposes (LCD, SPI, LEDs and the such). How can I detect the voltage of VDD with only internal resources? This is to allow me to set the contract % for the LCD.
Show LessHello,
I am using CYBLE-212019 and am scanning i-beacons the least strength of the beacon I can detect is -79 dBm. I have never saw an RSSI level weaker than this. Is this the least it can detect?
Thank you
Dheeraj
Show LessHello,
I am interested to use the PRoC module for indoor navigation system. I recently get to know about RTLS features which can help to build the BLE accurate localization system. Question if the PRoC or any BLE module from Cypress can support this feature and if yes if there is any manual how to implement it.
Thank you so much in advance
Jacek
Show LessI have two BLE devices, one as central and one as peripheral. For the central device, I have the box checked to generate the mac address from the die. I have a need to read the full mac address of the central device within its firmware. Where do I find the mac address within all of the header and source file generated in the BLE library.
Secondly in the peripheral, I assigned an advertising name through the design block of the BLE module. I would like to change that name within the peripheral code so I can either add to the existing name or change it completely. Basically have a default advertising name then change to something else once some settings are established. I thought I found the data for this but everytime I build the code, it defaults back to original data in design block. How can I change the adversting name within the firmware?
Lastly, are there any good references or examples how to set up pin usage between an app and the peripheral device. I have a different project that requires usage of a pin and not sure how to implement.
Show LessHi,
I got a problem with my Psoc. I have CY8CKIT-049-42XX Prototyping Kit. I recent have started programming and I was watching the classes in Cypress's Youtube Channel to learn more about it. I did all lessons and everything it was ok until there.
But, last wesdnesday I put my psoc in computer and tryed program via bootloader and I coudn't do this. It doesn't enter in "program mode" anymore when I press the switch buttom before connect in my computer. I searched in internet, but i didn't see anything about it. I check wih a multimeter and switch button it's ok, the voltage levels it's ok too. I don't know what more do and how I can solve this. Pls, help me.
Show Less