PSoC™ 4 Forum Discussions
As stated in this discussion, in the specification of PSOC 4, it stated:
"UART Mode: This is a full-feature UART operating at up to 1 Mbps. It supports automotive single-wire interface (LIN), infrared interface (IrDA), and SmartCard (ISO7816) protocols...."
However the Creator does not have LIN bus component, I would like to ask if there is any example or library that implement the LIN bus in PSOC4 ?
I am actually using PSOC 4 BLE.
Thank you.
Show LessHi sir i am interfacing cyble 22001 with Thermocouple ic USING SPI.But while reading data i am getting only 0xff.
my code is here.
uint8 MAX31856_Read_Data(uint8 Reg_Addr)
{
uint8_t ReadData = 0;
uint8_t dummy = 0;
SPIM_SpiUartClearRxBuffer();
SPIM_SpiUartWriteTxData(Reg_Addr);
while (!SPIM_SpiUartGetRxBufferSize());
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(0xFF);//writing Dummy Data
while (!SPIM_SpiUartGetRxBufferSize());
ReadData = SPIM_SpiUartReadRxData(); // Read Data
return ReadData;
}
if i am using this while(!(SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)); compiler unable to find SPIM_ReadTxStatus() and SPIM_STS_SPI_DONE)
generates error. please help me to solve the issue.Thanks in advance..
Show LessHi,
I know how to set the custom characteristics of a custom service using following code -
CYBLE_GATT_HANDLE_VALUE_PAIR_T tempHandle;
tempHandle.attrHandle = CYBLE_CUSTOMSERVICE_NAME_CHAR_HANDLE;
tempHandle.value.val = data;
tempHandle.value.len = sizeof(data);
CyBle_GattsWriteAttributeValue(&tempHandle, 0, &CYBLE_CUSTOMSERVICE_NAME_CHAR_HANDLE, CYBLE_GATT_DB_LOCALLY_INITIATED);
But now I want to set characteristics of Device Information service programatically (i.e Serial Number String). These services are standard services. Is there any example which I can use to set standard characteristics? If I try the above code to set it, it doesn't work. I can see the constant value set using the BLE settings.
Please help. Thanks in advance.
Kind Regards,
Jitender
Show LessHow do I get to this event CYBLE_BLESS_STATE_EVENT_CLOSE ?
I need to use it for CyBle_GapUpdateAdvData( ) function.
What will force that event?
Is it
CySysPmSleep(); ?
CySysPmDeepSleep(); ?
CySysPmHibernate();?
I will make this for the Peripheral.
Also if it hibernates, sleep, deep sleep ... will i ever connect to it ? via Central.
Message was edited by: Cyrus Nikko Pante
Show LessHi, I'm using a '042-BLE' kit here and it's working fine. But I can't get a timer interrupt to work. Here is the main code:
* ========================================
*/
#include <project.h>
uint16 ms_count = 0;
CY_ISR(MY_ISR)
{
ms_count++;
if(ms_count == 1000)
{ // 1 second
LED_2_Write(!LED_2_Read()); // Toggle LED
ms_count = 0; // reset ms counter
}
}
int main()
{
Timer_Start(); // Configure and enable timer
Timer_ISR_StartEx(MY_ISR); // Point to MY_ISR to carry out the interrupt sub-routine
CyGlobalIntEnable; // Enable global interrupts
for(;;)
{
// Infinite loop for timer/interrupt to keep executing
}
}
The pin output is square running at 900us, not 1 second I had hoped for. Changing the clock frequency makes no difference.
This is going to be such a silly problem, I'm already embarrassed, but I've at this for some time and I can't see what is wrong.
Project is attached.
Show LessHow can I change an advertisement packet...
I followed this tutorial...
and made my own version for my application.. I'm currently debugging it.
I set my Service Data to 0.
I need it to switch it from 0 to 1, and vice versa.
CYBLE_GAPP_DISC_MODE_INFO_T discoveryReport;
int main(void)
{
CYBLE_API_RESULT_T apiResult;
CyGlobalIntEnable; /* Enable global interrupts. */
apiResult = CyBle_Start(StackEventHandler);
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
for(;;)
{
CyBle_ProcessEvents();
DynamicADVPayloadUpdate();
}
}
void DynamicADVPayloadUpdate(void)
{
if(CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE)
{
discoveryReport.advData->advData[14u] = 0x01;
CyBle_GapUpdateAdvData(discoveryReport.advData, discoveryReport.scanRspData);
}
}
void StackEventHandler(uint32 event, void *eventParam)
{
switch(event)
{
/* Mandatory events to be handled by Find Me Target design */
case CYBLE_EVT_STACK_ON:
case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:
/* Start BLE advertisement for 30 seconds and update link
* status on LEDs */
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
break;
case CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP:
if(CyBle_GetState() == CYBLE_STATE_DISCONNECTED)
{
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
}
break;
default:
break;
}
}
Message was edited by: Cyrus Nikko Pante
Show LessHello. It is not obviouse the description and behavior of the left align ff pwm.
First question is swap. Is it just shadow register or it is individual register ?
In case of COMPARE_BUF is shadow register my expecting is :
1. write in COMPARE_BUF will replace the value in COMPARE_BUF. Value in COMPARE will remain the same.
2. every SWAP on TC will copy value from COMPARE_BUF into COMPARE. At this moment we will have the same value in COMPARE and COMPARE_BUF
So DMA can write data into COMPARE_BUF and TC event will copy value from COMPARE_BUF into COMPARE and pwm will use COMPARE (every time copied from COMARE_BUF)
In case of COMPARE_BUF is individual register my expecting is :
1. write in COMPARE_BUF replace the value in COMPARE_BUF. Value in COMPARE will remain the same.
2. on every SWAP the COMPARE and COMPARE_BUF will be "switched" so "current active logical compare register" will be switched from COMPARE to COMPARE_BUF and vice versa next time. The values in COMPARE and COMPARE_BUF will be different. The next SWAP will switch pointer from current COMPARE_BUF to COMPARE without coping one to another.
So DMA should write one time into COMPARE, next time into COMPARE_BUF, next again in COMPARE and so on.
What is right ?
Second question is updating in runtime of COMPARE without of using SWAP.
TCPWM datasheet says about double buffering. What does it mean ? Just COMARE and COMPARE_BUF or we have shadow registers ? Where can I read about it ? How does it work ? I've been looking for this in TCPWM datasheet, in PSoC 4 architecture reference manual and in PScC 4 registers reference manual. Have no answers.
Compare event trigger DMA to send data into COMPARE register. Does COMPARE register realy take new value from DMA or data from DMA take place in an shadow register (double buffer) ?
According to documentation COMPARE and PERIOD registers will be updated only on TC event. Ok. I will write PERIOD and COMPARE but they will be updated during next TC. Where in this case the new values of PERIOD and COMPARE are preserved ? As I understand the old values remain the same until TC event. But why I cannot write new value in PERIOD if it less then old value ? Until TC the PERIOD will not be changed but I cannot write it becase ... I do not have detailed information what going on in COMPARE and PERIOD after changing it's data on the run.
I need to change COMPARE and PERIOD on the fly but have no detailed information about algorithm of it. Timers of STM32 much more complex but very predictable in every details. The main problem is documentation. Is not detailed.
Show LessAre there any limitations that would prevent this module from fulfilling any role of a bt mesh network? Node, Relay, Proxy, Friend Low Power? Can it interoperate with the same and different BLE modules in a bluetooth network?
Show LessHello,
I have a question about SPI component.
Device: CYBLE-212020-01
1) Is it possible to assign both Slave and Master to the SPI (SCB mode) component?
2) Is it possible to share the four pins (miso, mosi, sclk, ss) using in both Slave mode and Master mode?
3) If 1) and 2) are impossible, any other way?
Best Regards
Show Less