PSoC™ 4 Forum Discussions
Hello,
I downloaded the "CE210292_WDT_P4S_Example" for PSoC4S.
I can see to be used "CySysClkIloStartMeasurement()" and "CySysClkIloCompensate()".
There is the "CySysClkIloCompensate()" API that effectively compensating for the ILO inaccuracy and allowing a
more accurate WDT interrupt generation.
It doesn't say how much it will improve the accuracy in characteristics.
Q1: What is the percentage within?
Certainly there is no description of compensating when looking at the AC Electrical Characteristics.
Please see the code below
Q2: I think that "CySysPmDeepSleep" API is an example.
So, it does not mean that ”CySysPmDeepSleep” API is absolutely necessary between "CySysClkIloStopMeasurement" and "CySysClkIloStartMeasurement".
Is this correct?
if(CYRET_SUCCESS == CySysClkIloCompensate(DESIRED_DELAY, &tempIloCounts))
{
iloMatchCounts = (uint32)tempIloCounts;
/* Once the counts are ready - stop the ILO measurement and put the device to deepsleep */
CySysClkIloStopMeasurement();
if(CLEAR == interruptFlag)
{
/* Device will wakeup through WDT ISR */
CySysPmDeepSleep();
}
/* Start the ILO measurement after wake up */
CySysClkIloStartMeasurement();
}
Best regards,
Yocchi
Show LessHi Cypress Community...
I want to use the CY8C4745 for one LinearSlider and a full 8bit Smart-I/O port for external control of attached circuit...while not losing the SWD capability.
How can I force (break/delete) the restriction of beginning MagSense sensors on Port2...as I need this full Smart-I/O port for external drive.
If we add more than 8 sensors...Port3 is free to use for additional sensors...where I can change/patch out the restriction for Port2 to add my LinearSlider to Port3 directly while I still can use SWD and have my own 8bit Smart-I/O settings free for use ?
Technically it is possible, as if I add DUMMY 8 sensors on Port2...LinearSlider on Port3 is working fine...
If I use my LinearSlider on Port2...I have to remove SWD to get an full 8bit Smart-I/O free for usage...that's make debuging nearly impossible.
As I need one Sensor only...It would perfect to use them in the upper nibble of Port3, still have SWD and use Port2 for own 8bit Smart-I/O configuration.
Please help before I have to go through all the API code to break Port2 starting MagSense restriction.
Many thanks and best regards.
Carsten
Show LessHi everybody,
i'm working on a project for reading ECG/BioZ from MAX30001. This sensor comunicates with the microcontroller via SPI. I wrote a code to write/ read command to the sensor and everything works well, i can change the settings of the sensor and it replaies correctly, but when I ask reading ECG_FIFO (register 0x21) i get 0x00003F( the ECG_FIFO is a 32 words x 24 bit each sample is made up of 23-6 bit of voltage information , 5-3 bit of ECG data tag and 2-0 Pace data tag. The tags give the information on received sample, in my case 3F mean that the ECG_FIFO and the PACE_FIFO are in overllow, and this happens when microcontroller doesen't read the ECG_FIFO.)
I try to reset the ECG_FIFO but it always gives me 0x00003F.
if anyone has worked with this sensor before, please help me.
I attached the project, with my code.
Show LessHi all,I want to set an output like below pic,the period of 100%(duty cycle) is 60 us another one(20%) is 120 us
but the result on oscilloscope is not what I want,how can I do?
thanks
Show Less
The BLE HID Keyboard example is software simulated keypresses. I want to add a physical button to a pin on a CY8CKIT - 042 - BLE A that when pressed sends a key such as, "a". I want the device to advertise as an HID KB to windows via BLE rather in order to avoid needing a 3rd party key remapper.
The BLE HID Keyboard example included w/ PSoC 4.2 sets, "SW2" to input a capsLockPress. I wondered if someone could help me change this to simply send an ASCII keyPress such as, "a" rather than caps lock. Specifically w/ the code, and various areas where code needs changed as well.
Any guidance is appreciated, however it would be extra helpful for specifics, if not a simple walk-through.
Here is code from BLE HID Keyboard example in PSoC:
void SimulateKeyboard(void)
{
static uint8 keyboard_data[KEYBOARD_DATA_SIZE]={0,0,0,0,0,0,0,0};
CYBLE_API_RESULT_T apiResult;
static uint32 keyboardTimer = KEYBOARD_TIMEOUT;
static uint8 simKey;
static uint8 capsLockPress = 0u;
uint8 i;
/* Scan SW2 key each connection interval */
if(0u == SW2_Read())
{
if(capsLockPress < KEYBOARD_JITTER_SIZE)
{
capsLockPress++;
}
else if(capsLockPress == KEYBOARD_JITTER_SIZE)
{
keyboard_data[2u] = CAPS_LOCK; /* Set up keyboard data */
keyboardTimer = 1u; /* Clear Simulation timer to send data */
capsLockPress++;
}
else /* Ignore long key pressing */
{
}
}
else
{
capsLockPress = 0u;
}
Show LessHello,
In case of the thread below, we can read uint8 array allocated in FLASH, we can get "test" variable that not used anywhere.
Placing uint32 array with compiler optimization "size"
volatile int32 g_vsin[360] __attribute__ ((section (".FlashData"))) = {}
volatile int32 test; // for debug
...
test = g_vsin[100]; // break point for debug
we would like to let the linker allocate the array to FLASH. So, we will use
"__attribute__ ((aligned(CY_FLASH_SIZEOF_ROW)))".
If we use like below, the array cannot be read in bytewize.
const int32 g_vsin[360] __attribute__ ((aligned(CY_FLASH_SIZEOF_ROW))) = {}
volatile int32 test; // for debug
...
test = g_vsin[100]; // break point for debug
And if we use like volatile, the array is allocated in RAM.
volatile int32 g_vsin[360] __attribute__ ((aligned(CY_FLASH_SIZEOF_ROW))) = {}
or
volatile const int32 g_vsin[360] __attribute__ ((aligned(CY_FLASH_SIZEOF_ROW))) = {}
Is it possible to read it allocated in FLASH in bytewize with compiler or linker option with GCC or something?
Best regards,
Yocchi
Show LessI have a project where one of the IC need 31.25kHz oscillation to operate.
Until now I used a crystal on that device and used 4200 micro as my host controller. For low power I put the controller to deep sleep and it was woken up by interrupt from the other device.
Because the crystal is getting harder to source I wanted to generate the 31.25kHz from the controller. Because 4200 I was using only had 2% accuracy due to RC operation, I changed model to 4200 L and connected 24MHz crystal.
Using a PWM output to pin, the 31.25Khz signal is generated and the circuit works. However, I need to put the micro into a deep sleep mode to increase battery run time.
How can I keep the 31.25kHz running while 4200L is deep sleep and also, how can I get it ti wake periodically (every 1 second) to perform some non-interrupt functions that need to be done?
Thanks
Show LessHi CY Friend,
As the title. I attach my code.
Thanks
sophie
Please give us recommended land information of CY8C4245AXI-473 for Board AW.
Regards,