PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
I have a very simple design (attached). I'm comparing implementing a shift register (as a delay line) vs a series of DFFs. The delay line runs off of a routed clock (asynchronous to HFCLK).
The issue I'm having is with shift register component (v2.30). Using the shift register from a routed clock gives the warning:
Warning: sta.M0021: Design01_timing.html: Warning-1350: Asynchronous path(s) exist from "CyRouted2" to "CyHFCLK". See the timing report for details. (File=<...>\Design01.cydsn\Design01_timing.html)
In addition, the shift register does not work as expected:
- When using the routed clock (as is in the attached project):
- The 2-bit shift register delays the data pulse by ONE clock period (NOT EXPECTED)
- The 2 DFFs delay the data pulse by TWO clock periods, as expected
- If I change the routed clock to a New Clock created from HFCLK (NOT as is in the attached project):
- The 2-bit shift register delays the data pulse by TWO clock periods, as expected
- The 2 DFFs delay the data pulse by TWO clock periods, as expected
My misunderstanding is in how the ShiftRegister component works. Specifically, why is it using the HFCLK at all?
Brian
Show LessDear all,
I want exchange message B BLE module between C BLE module, but the B BLE module smart phone connection and received C BLE module message at the same time, have any method ?
I'm asking in the PRoC forum as I culdn't get a definite answer on the PSoC forum. I am trying to run on WS2812B using a PRoC BLE. I've been successful with the FunWithLEDs library on the PSoC, but I can't use that component on the PRoC. I've used a bit of bit banging, but it won't give me consistent latching of the color, unless I'm running in debug and break after sending out the last byte. I've included some code.
Show Lesshi,
i have been making Temperature sensing product on psoc-4. Here i use in built SAR ADC for sensing.
There is a two type of sensing.
1) RTD
2) Thermocouple
i got accurate reading of RTD and thermocouple with different parameter of ADC like;
RTD:
1) SAMPLE MODE: HARDWARE TRIGGER
2) AVERAGING MODE : ACCUMULATE
THERMOCOUPLE:
1) SAMPLE MODE: FREE RUNNING
2) AVERAGING MODE : FIXED RESOLUTION
i cant changed this setting from code.
can i do this with code on run time whenever i needed??
Show LessI am trying to use the EZ_Serial BLE FW for communication using unacknowledged data using the UUID 65333333-A115-11E2-9E9A-0800200CA102.
Are there any specific UUID to be used in combination with the Configuration Descriptor 0x2902 to be able to enable notification for the BLE? (For another type of BLE I can insert the 0x2902 into the same UUID - sample: 00002902-0000-1000-8000-00805F9B34FB)
Hi,
I am new to this forum, and thought i would give it a go.
I have a problem with the Sar multiplexer on PSoC 4. The problem is that it doesnt log the actual values that i can meassure with a voltmeter. In addition, i am sampling on all 8 channels, and the offset from RealValues to SampledValues is different on each channel.
I think it might be problem with the setup of the SarMux.
Can anyone offer some insight? Something i havent thought about?
Note: The project is based on an SD-card example, and i have added an lcd-screen as well. Comments in code are in danish.
Purpose: The purpose of my prototype is to meassure the increase of resistance in a wire, after each bend. The PowerRelay bends the wire from side to side, and i sample each X'th cycle. I made a voltage divider to where i am meassuring the voltage after the wire i am testing, and before a 1K_ohm resistor. With Ohms law i should be able to determine the resistance of the wire by meassuring the voltage between the "two" resistors.
SampleValues:
Cycle: 0 Data: 4424, 4468, 4, 4468, 2240, 4071, 1405, 4468,
Cycle: 4 Data: 4457, 4466, 1161, 4466, 3126, 4426, 2515, 4463,
Cycle: 8 Data: 4457, 4466, 1191, 4466, 3176, 4428, 2544, 4463,
Cycle: 12 Data: 4455, 4466, 1193, 4466, 3130, 4426, 2504, 4463,
Cycle: 16 Data: 4457, 4466, 1025, 4466, 3246, 4428, 2511, 4461,
Cycle: 20 Data: 4457, 4466, 1178, 4466, 3109, 4424, 2526, 4463,
Cycle: 24 Data: 4457, 4466, 1047, 4466, 3248, 4428, 2493, 4461,
(samples in cycle 0 is the aim, and for this óne instance, was meassured correctly)
Show LessHello,
I have a kind of heretic question to "Cypressers". I'm actually developping a ble connection between a sensor and a master dongle.
(I'm unable to create this topic at one time so the following is on the next answer, sorry about that)
Show LessHi
I am using PSoC creater 3.3.
Default measuerement interval value is 1 second in sample project( BLE Cycling senser ).
How to change to more short the measurement interval value?
Best regards,
Yoshizu
Show LessHi,
I try to implement the following scenario:
boots -> process a task in ACTIVE mode for exectly 2 sec -> deep sleep for 5 sec -> task for 2 sec -> deep sleep 5 sec and so on.
This works great with WDT (wakeup from deep sleep after counting WDT intervals until 5 sec are reached) and a one shot timer (to time the 2 sec task duration).
But if I add BLE functionality into the design, something does not fit any more. I invested already two days into it, and read of course all the available PDFs (BLE getting started + Low-Power Modes and Power Reduction Techniques) , I analised the LPM example project but it uses the WDT differently then me.
I prepared a use case project (with oth) to analyse the problem, which uses LEDs and UART for logging.
So without BLE, where everything is fine, the following expected LED sequence can be observed:
GREEN (task) for 2 sec
BLUE (deep sleep) for 5 sec
during BLUE phase above 4 WHITE flashes every 1 sec (WDT interval ticks, reentering deep sleep)
end of BLUE phase above 1 WHITE double flash (wake up from deep sleep)
and so on...
UART logs the following sequence, (the single point after each WDT tick stays for reentering deep sleep mode).
Do something...
Try to sleep...WDT tick: 1
.
WDT tick: 2
.
WDT tick: 3
.
WDT tick: 4
.
WDT wakeup
Now if I enable BLE (un-comment #define ENABLE_BLE in main.h), I observe the following pattern
GREEN for 2 sec
GREEN for 2 sec
BLUE flickering for about 3 sec
during BLUE phase above 2 WHITE flashes every 1 sec (WDT interval ticks, reentering deep sleep)
end of BLUE phase above 1 WHITE double flash (wake up from deep sleep)and so on...
UART logs the following sequence
Do something...
Try to sleep...
Update GATT database...
Do something...
Try to sleep...WDT tick: 2
....................................................
WDT tick: 3
..............................................................................
WDT tick: 4
.............................................................................
WDT wakeup
One can see many single points between WDT ticks, so the program tries reentering deep sleep very often but stays there only for a short time. I suppose it is because of the BLE subsystems interrupts, which would be fine if the average power savings were OK which I did not measure now. Am I correct with this assumption? How can I tune the intervals here, I did not catch this in the docs.
But what really bothers me is the fact, that work phase (GREEN) occurs twice without any sleep phase between, and that the deep sleep phase itself is shorter as expected (something above 2 sec instead of 5).
Eventually the program crashes after some time sooner or later. I am not experienced enough yet to debug this 🙂
Why does BLE interfere with the WDT timer so radically? I would expect, that the WDT does it work in background without any distortions using LFCLK. Giving WDT higher interrupt priority than BLESS or changing the LFCLK source from WCO to ILO does not make any difference in the pattern.
Is there anything I can do to fix my design? I will appreciate any optimizations.
What can I do to better understand the BLE low power behavior?
My project is attached to this post.
Thx
Edit: I found a logical error, now the timings are OK but the connection from a GAP client (CySmart app) can not be established reliably, especially during sleep phase. I would say this is my actual problem now + the random crashes after long running times.
Show LessI want to be able to control the wake from deep sleep interval using the watchdog timer intrupt. But no matter what value I use for sleep_time, the interval always is about one second. Here is my code:
#define SLEEP_INTERVAL_500MS 500
#define SLEEP_INTERVAL_1000MS 1000
#define SLEEP_INTERVAL_2000MS 2000
#define ILO_FREQ 32000
/*******************************************************************************
* Function Name: InitWatchdog
********************************************************************************
* Summary:
* Initialize watchdog counter0 with specific sleep interval parameter
*
* Parameters:
* uint16 sleep_interval reset interval, in millisecond unit
*
* Return:
* void
*
*******************************************************************************/
void InitWatchdog(uint16 sleep_interval)
{
/*==============================================================================*/
/* configure counter 0 for wakeup interrupt */
/*==============================================================================*/
/* Counter 0 of Watchdog time generates peridically interrupt to wakeup system */
CySysWdtWriteMode(CY_SYS_WDT_COUNTER0, CY_SYS_WDT_MODE_INT);
/* Set interval as desired value */
CySysWdtWriteMatch(CY_SYS_WDT_COUNTER0, ((uint32)(sleep_interval * ILO_FREQ) / 1000));
/* clear counter on match event */
CySysWdtWriteClearOnMatch(CY_SYS_WDT_COUNTER0, 1u);
/*==============================================================================*/
/* enable watchdog */
/*==============================================================================*/
/* enable the counter 0 */
CySysWdtEnable(CY_SYS_WDT_COUNTER0_MASK);
/* check if counter 0 is enabled, otherwise keep looping here */
while(!CySysWdtReadEnabledStatus(CY_SYS_WDT_COUNTER0));
}
CY_ISR(isr_WDT)
{
/* clear interrupt flag to enable next interrupt */
Sensors_Power_Write(1);
ADC_Start(); /* Start up the ADC */
ADC_StartConvert(); /* Start ADC conversion */
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT); /* Wait for result to complete */
ADC_StopConvert(); /* Stop ADC conversions */
updateSensorData(); //read sensordata and alarm, compare update adData if needed(stop advert, update, start advert)
ADC_Sleep();
Sensors_Power_Write(0);
CySysWdtClearInterrupt(CY_SYS_WDT_COUNTER0_INT);
}
int main()
{
/*===========================================================================================
* this code piece initializes the watchdog function
*==========================================================================================*/
/* initialize watchdog */
InitWatchdog(SLEEP_INTERVAL_500MS);
/* connect ISR routine to Watchdog interrupt */
ISR_WDT_StartEx(isr_WDT);
/* set the highest priority to make ISR is executed in all condition */
ISR_WDT_SetPriority(0);
/* enable global interrupt */
CyGlobalIntEnable; /* Enable global interrupts. */
CyBle_Start(Stack_Handler);
//SetupWDT(ONE_SECOND_PERIOD);
for(;;)
{
if(sensor0Counts < alarmValue){
appendFlagToLocalName(0x20);
} else {
appendFlagToLocalName(0x2a);
}
CyBle_ProcessEvents();
/* clear watchdog counter before deep sleep */
CySysWdtResetCounters(CY_SYS_WDT_COUNTER0_RESET);
/* reset watchdog counter requires several LFCLK cycles to take effect */
CyDelayUs(200);
/* go to deep sleep mode */
if( CyBle_EnterLPM( CYBLE_BLESS_DEEPSLEEP ) == CYBLE_BLESS_DEEPSLEEP )
{
ADC_Sleep();
CySysPmDeepSleep();
}
}
}
/* [] END OF FILE *
Also, is there a way to cascade the two counters in the WDT to obtain a sleep interval of 5 or 10 seconds. I read somewhere that the maximum interval is 2048 ms.
Thanks
Show Less