PSoC™ 4 Forum Discussions
Hello,
I am connecting the PSoC CY8CKIT-042 board's SPI interface to a SPI master device, the HFCLK is 48Mhz, the SPI master clock is 8Mhz,
the PSoC 4 is SPI slave, the SPI works on Motorola mode, the SCLK mode is "CPHA = 1, CPOL= 1", in this configuration, the SPI master always receives wrong MISO data from PSoC 4200 chip.
After i measured the SPI signals by a logic analyzer, i found the SPI MISO signal had big lantency, the lantency is about 80-90ns which assert after next clock rising edge, so the SPI master can not launch correct MISO data.
Look at the datasheet of PSoC 4200, the following AC Specifications of SPI Slave Mode:
Spec ID Parameter Description Min Typ Max Units
SID171 TDSO MISO valid after Sclock driving edge – – 42 + 3 ×Tscbclk ns
By my understanding, this SID171 means the MISO lantency may be the maxium 104.5ns.
Is is correct for my case? Is the PSoC 4 SPI slave not possible to get working on 8Mhz clock?
Thanks,
-Charlie
Show Lesshello, I have a doubt .. I am working with the CY8CKIT-0420BLE kit and the device used in my project is the CY8C4247LQI-BL483 .I am working with the ADC component and uses teraterm for recieving the commands for the ADC.
how do multiple pins ( say p1.4 , p3.0) serve the same functionality say uart_rx?
if I have connected my uart rx pin ( in the project) to p1.4 (in .cydwr) , and connect p3.0 for one ADC channel input, I assume the UART recieving will happen correctly.
If nothing is connected to p3.0 the teraterm works fine, but if a wire is connected between P3.0(J2) and the Gnd,and then try to read the analog channel 0(p3.0) the teraterm stops working..
if i repeat the same for other ADC channels, ( ADC_ch_1 at p3.1, ADC_ch_2 at p3.2) the teraterm works fine and the analog voltage is read as 0.
Can anyone guess what makes the teraterm stop?
is it because that both pins can be used as uart_rx?
Show LessI have one BLE moudle setup (M1) in the Broadcast mode and another BLE module (M2) setup in the Peripheral and Central roles. I can connect (M2) as a peripheral to a smartphone and the smartphone reads the data sent by M1 correctly. If I then attempt to scan the broadcast module (M1) for its advertising data using GattcStartScan the CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT is never generated and I can not receive the advertising data. Does anyone know if I can use the devices this way?
Show LessHi;
I have observed that there is no measurement instruments in PSoC creator 4. I designed a circuit and wanted to monitor my current and voltage, but it looks like there is no multi-meter in PSoC 4 Gui.
Is there any possibility to monitor your design or is there any other cypress product which has that functionality ?
Show LessMay anyone provide me a sample of code to handle an interrupt on an external pin that coexists with DeepSleep mode?
Compared to previous versions Psoc Creator 4 has introduced some difference in this regard ?
TNX
Show LessHello, I have recently purchased the CY8CKIT-044 PSoC® 4 M-Series Pioneer Kit and having a great time learning how to do simple projects. I am trying to write a simple program to interface with a 74HC595 Shift Register to control 8 LEDS. The HC595 has a Clock input, a Serial Data Input and a Latch. I am trying to use the Shift Register in the PSoc Creater and need some help with the top schematic. I have uploaded my top schematic for review. I want to know how I can create a bursted clock that will be used to clock in the data the the HC595. I have tried to use the Clock component from the SYSTEM group and connect it to a Digital Output pin but it won't compile. If anyone could give me some suggestions of know of an example that uses an Shift Register please let me know.
Thanks,
Joe
Show LessI working to send a simple Int between two BLE devices. I've been able to run the UART example in which one device is setup as a central and the other as peripheral. All works well there. This allows you to type in a serial window and it sends it to the other device.
What I'm trying to do now is a simple Int programmatically between the two devices. I am able to get the data back and forth however it always comes out weird on the device that I'm sending it to.
Here is how I send a piece of data from my peripheral device:
void Send_Event_Code_To_Sensor(int eventCode)
{
CYBLE_API_RESULT_T bleApiResult;
CYBLE_GATTS_HANDLE_VALUE_NTF_T tempHandle5;
tempHandle5.attrHandle = CYBLE_SERVER_UART_SERVER_UART_TX_DATA_CHAR_HANDLE;
tempHandle5.value.val = (uint8*)eventCode;
tempHandle5.value.len = sizeof(eventCode);
do
{
bleApiResult = CyBle_GattsNotification(cyBle_connHandle, &tempHandle5);
CyBle_ProcessEvents();
}
while((CYBLE_ERROR_OK != bleApiResult) && (CYBLE_STATE_CONNECTED == cyBle_state));
}
Here is how I receive it on the central device:
void HandleUartRxTraffic(CYBLE_GATTC_HANDLE_VALUE_NTF_PARAM_T *uartRxDataNotification)
{
if(uartRxDataNotification->handleValPair.attrHandle == txCharHandle)
{
unsigned int paramVal = *uartRxDataNotification->handleValPair.value.val;
}
}
The problem is that when I receive the data it's always something weird.
For instance, if I try to send the number 1 from my peripheral like this:
Send_Event_Code_To_Sensor(1);
It decodes as 64 on my central device. What am I doing wrong here? Is it because I'm sending it as a pointer here:
tempHandle5.value.val = (uint8*)eventCode;
Maybe?
Show LessHello,
I am using cypress CYBL10161-56LQXI. I am using I2C as a slave. I have a problem that after my slave sends the desired data, in the next cycle when master asks the slave if any data is available and if there is no data available, the cypress sends 0xff,0xff....[Buffer length].
I am using this,
strncpy(i2cReadBuffer,"abcd",sizeof("abcd"));
if(0u != (I2C_I2CSlaveStatus() & I2C_I2C_SSTAT_RD_CMPLT))
{
// Clear slave read buffer and status
I2C_I2CSlaveClearReadBuf();
(void) I2C_I2CSlaveClearReadStatus();
}
So here, master would receive abcd first then it receives 0xff,0xff.... It would be great if you could help me out with that.
Thanks.
Show LessI have the PSoC 4 BLE system connected via SPI to a device. That device has a "Who Am I" register at 0x0f that will reply with the value 0x6a if read correctly.
I have used a SCB dialog to create a SPI master, Sub mode: Motorola CLK CPHA=1, CPOL=1
Data Rate: 1Mbps
Rx & Tx data bits 16
Transfer Separation: Separated
Rx & Tx Buffer Size: 8
No Interrupts
I have written the code to just query that register to prove that the SPI bus works. When the register is read correctly a LED connected to Pin 2 is turned on.
What I found was that I had to put a while loop to continuously read the SPI bus to get the correct value. In fact I had to read the bus 9 times first and then on the 10th time the value returned was correct.
Here is the code:
static uint8_t readTheRegByUart(uint8_t theRegAddr) {
uint8_t theRegValue = 0;
uint16_t theReadCmd = 0x8000;
/* read the register */
theReadCmd |= (uint16_t)((uint16_t)theRegAddr << 8);
SPI_SpiUartWriteTxData(theReadCmd);
while(SPI_SpiUartGetRxBufferSize() > 0) {
theRegValue = (uint8_t) (SPI_SpiUartReadRxData() & 0x000000ff);
}
return theRegValue;
}
int main(void) {
uint8_t theValue;
CyGlobalIntEnable; /* Enable global interrupts. */
SPI_Start();
while((theValue = readTheRegByUart(0x0f)) != 0x6a);
Pin_2_Write(0);
for (;;)
{
;
}
}
Am I running into a buffering issue from the Rx FIFO in the SPI implementation? Is using the "Uart" version of the SPI code wrong?
Any insights would be helpful.
Cheers!!
Show Less