PSoC™ 6 Forum Discussions
Hello,
using PSoC Creator 4.3 with PDL v3 = 3.1.2 and PDL v2 = 2.1.0. The BLE Device is configured as Peripheral the connection settings are the following:
/* 8 x 1.25 = 10 ms */
#define MINIMUM_CONNECTION_INTERVAL (8u)
/* 8 x 1.25 = 10 ms */
#define MAXIMUM_CONNECTION_INTERVAL (8u)
/* 125 connection interval skips */
#define SLAVE_LATENCY 12
/* Supervision timeout of 3 second */
#define SUPERVISION_TIMEOUT (300u)
I use an BLE-Dongle as Central to activate Notifications. If they activated the Peripheral sends Notifications via BLE and than enter DeepSleep Mode. The WatchDogTimer is used to wakeup the System every 2 s. I recognized with an Poweranalyzer that the Powerconsumption is sometimes higher than I expected. It seems like the BLE device is running faulty in the background.
The sequence is:
trigger sensor measurement
enter DeepSleep
WatchDogTimer interrupt // after 25ms
read out sensor
send Notification
enter DeepSleep
WatchDogTimer interrupt // after 2 s
Bad:
Good:
Can someone explain what going with the BLE device? Why sometimes it work and why not?
regards,
Alex
Show LessI Have a question regarding the PSOC6 as central mode
What I want is to read the nerby devices but I can't find an example that works on psoc 6
I tried with 2 functions
Cy_BLE_GAPC_StartScan
and
Cy_BLE_GAPC_StartDiscovery
which one do I need to use?
I can't even trigger none of this events:
CY_BLE_EVT_GAPC_SCAN_PROGRESS_RESULT:
CY_BLE_EVT_GAPC_SCAN_START_STOP:
at first I thougth that StarScan trigger this two events
but reading Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.40
it says that the StartDiscovery function is the one that triggers this
so I'm not so sure right now which one is
I have no problem when working on perpheral and there are plenty of examples for this but for central I'm having a hard time to understand it
the device I'm using is CYBLE-416045-02 on a custom pcb that I design
Show LessI have a simple program for reading the JEDEC information from a serial flash chip using the low-level API.
static void SPI_FlashWriteByte(uint8_t byte)
{
SPI_ClearRxFifo();
SPI_Write(byte);
while (SPI_GetNumInRxFifo() == 0);
SPI_ClearRxFifo();
}
static uint8_t SPI_FlashReadByte()
{
SPI_ClearRxFifo();
SPI_Write(0xFF);
while (SPI_GetNumInRxFifo() == 0);
return SPI_Read();
}
static void SPI_FlashReadJEDEC_Info(uint8_t* mfgID, uint8_t* memoryType, uint8_t* capacityID)
{
CS_FlashEnable();
SPI_FlashWriteByte(0x9F);
*mfgID = SPI_FlashReadByte();
*memoryType = SPI_FlashReadByte();
*capacityID = SPI_FlashReadByte();
CS_FlashDisable();
}
int main(void)
{
__enable_irq(); /* Enable global interrupts. */
Cy_SCB_SPI_Init(SPI_HW, &SPI_config, NULL);
Cy_SCB_SPI_Enable(SPI_HW);
Trace_Init();
Trace_Log("\033[2J\033[H"); // Clear screen
Trace_Log("SPI Test\r\n");
for(;;)
{
uint8_t mfgID, memoryType, capacityID;
SPI_FlashReadJEDEC_Info(&mfgID, &memoryType, &capacityID);
Trace_Info("MfgID: 0x%02X, memoryType: 0x%02X, capacityID: 0x%02X", mfgID, memoryType, capacityID);
CyDelay(100);
}
}
Which produces the following signals.
D0 = chip select
D1 = SCLK
D2 = MOSI
D3 = MISO (the decoded data at the top is from MISO)
The problem is that each SPI_FlashReadByte() call returns the value that was in the FIFO from the SPI_FlashWriteByte() call.
I've tried using the high-level API with the same results.
Show LessI need to be absolutely certain of the following: My hardware engineer asked me to verify:
P10_0 can be configured A to D
P11_2 thru P11_6 can be configured to SDIO bus on MCU
P12_0 thru P12_3 can be configured to SDIO bus on MCU
P13_0 thru P13_2 can be configured to SPI bus on MCU
P4_0 thru P4_1 can be configured to I2C on MCU
I cannot find the SDIO in reference manual, datasheet, and trouble understanding 002-18449_002-18449_Alternate_Functions.xlsx and 002-23185-CY8C62x8_CY8C62xA_Pin_Functions_1_1.xlsx
Having trouble making certain without a doubt. Please direct me to documentation that will satisfy and prove to me that the above will work for his design.
Thank you.
William
Show LessI'm looking for ways to ease the chip from some combinatorial logic. I have 4 instances of a component that has a 4-input OR gate, and I'm tempted to remove that OR gate by moving it into a datapath. I'd use parallel in, and use the all-zero detector (inverted) to see if any bit is set - if that is feasible at all. Would that use less PLD resources than a 4-input OR gate? the number of signals (4 in, 1 out) is the same, but does it "free the way" for other parts of a larger design?
Also, could this be combined with a memory-to-hardware latch (D register to accumulator to parallel out)?
Show LessHello,
I am reading AN22875 ”DMA on PSoC 6 MCU”. So, I have a question about "Elements of a Transfer" in section 10.1 and Table 1.
Although it is written as 2 cycles in the explanation, it is 3 cycles in the table. Is this right?
The explanation:
A transfer can be split into multiple operations as shown in Table 1 with the corresponding cycles needed for their execution. Each transaction is initiated by a trigger, which goes through trigger synchronization circuit and takes up two cycles. These two cycles will be consumed whenever there is a trigger event being used.
Table 1:
Operation | Cycles (Slow Clock Cycles) |
---|---|
Trigger Synchronization and Priority decoding | 3 |
Start state machine and load channel config | 3 |
Load descriptors | 4 for single transfer 5 for 1D transfer 6 for 2D transfer |
Load next pointer 1 | 1 |
Moving data from source to destination | 3 |
Thanks,
Kenshow
Show LessHi
Is there a specific programming sequence for writing firware to CYBLE-416045-02 to program bluetooth? If so, where can I find it? Can it be programmed over the SWD interface in PSoC Programmer or Creator?
Thank you
Show LessI'm working with Mbed Studio 6.1 and CY8CPROTO-062-4343W on a project with MBed OS 6.2
Following the sample code of the HAL documentation I created the following functions:
#include "cyhal.h"
#include "displayThread.h"
bool timer_interrupt_flag = false;
cyhal_timer_t timer_obj;
static void isr_timer(void *callback_arg, cyhal_timer_event_t event)
{
(void) callback_arg;
(void) event;
/* Set the interrupt flag and process it from the application */
timer_interrupt_flag = true;
displaySendUpdateTime();
}
cy_rslt_t initPeriodicTimer()
{
cy_rslt_t rslt;
const cyhal_timer_cfg_t timer_cfg =
{
.compare_value = 0, /* Timer compare value, not used */
.period = 999, /* Defines the timer period */
.direction = CYHAL_TIMER_DIR_UP, /* Timer counts up */
.is_compare = false, /* Don't use compare mode */
.is_continuous = true, /* Run the timer indefinitely */
.value = 0 /* Initial value of counter */
};
/* Initialize the timer object. Does not use pin output ('pin' is NC) and
* does not use a pre-configured clock source ('clk' is NULL). */
rslt = cyhal_timer_init(&timer_obj, NC, NULL);
if ( rslt == CY_RSLT_SUCCESS)
{
/* Apply timer configuration such as period, count direction, run mode, etc. */
rslt = cyhal_timer_configure(&timer_obj, &timer_cfg);
if ( rslt == CY_RSLT_SUCCESS)
{
rslt = cyhal_timer_set_frequency(&timer_obj, 1000);
/* Start the timer with the configured settings */
if ( rslt == CY_RSLT_SUCCESS)
{
/* Assign the ISR to execute on timer interrupt */
cyhal_timer_register_callback(&timer_obj, isr_timer, NULL);
/* Set the event on which timer interrupt occurs and enable it */
cyhal_timer_enable_event(&timer_obj, CYHAL_TIMER_IRQ_TERMINAL_COUNT, 3, true);
rslt = cyhal_timer_start(&timer_obj);
}
}
}
return rslt;
}
When compiling the project I get the following 2 errors (timerISR.cpp is my function above):
[Error] @0,0: L6218E: Undefined symbol cyhal_tcpwm_enable_event(TCPWM_V1_Type*, cyhal_resource_inst_t*, unsigned, unsigned char, bool) (referred from BUILD/CY8CPROTO_062_4343W/ARMC6/timerISR.o).
[Error] @0,0: L6218E: Undefined symbol cyhal_tcpwm_register_callback(cyhal_resource_inst_t*, void(*)(), void*) (referred from BUILD/CY8CPROTO_062_4343W/ARMC6/timerISR.o).
but I can't find the ultimate ..internal() targets anywhere...
Hi,
I'm implementing a solution to KBA229335 where I replace cy_syspm.c in a pre-build instruction.
However, I'd like to remove this fix when the PDL is updated, thus I would add a precompiler check in cy_syspm.c for the PDL version.
Is there such a macro? Something like:
Show Less#define PDL_MAJOR (3)
#define PDL_MINOR (1)
#define PDL_MICRO (2)
Hello
I want to know if a special saving method is possible in PSoC6.
First, a header is created each time the data obtained from the sensor is recorded.Write multiple pieces of information there.
EX)
●header A ●header B
-Data A-1 -Data B-1
-Data A-2 -Data B-2
When reading, I want to collect these data collectively using the header as a mark.
I would like to know how if this is possible.
Header information
●Recording start date and time
●Setting infomation
Data Infomation
●Recording date and time
●Recorded sensor data
Best Regards
Hayato
Show Less