PSoC™ 5, 3 & 1 Forum Discussions
Dear all,
I am wondering Can PSOC 5LP DMA generate a signal after each transfer (not finishing TDs)? I understand that NRQ can generate a signal of two clock cycles after the TDs is finished (I chained 16 TDs). I am asking because there are two DMA channels in parallel sharing the same spoke (DAC). They may or may not be at the same rate. I want to know when each transfer is done so I can align the signal. The master clock is 78MHz.
The signal I am trying to alian is the trigger out signal. So I generate a waveform from flash through dma to DAC and output to a GPIO. I want to generate a trigger signal which is aligned with the waveform to another GPIO. What I did is that I user a counter, and route the drq signal and count of the trigger together. I set the period of the counter to the number of points that DAC will output and compare threshold of the counter to be half of the number of the points in DAC. I then use the compare out as the trigger signal. I can get the trigger aligned when 2 DAC channel are used at maximum speed of 1Msps. When I set the update rate of both channel to 2Msps, the output signal in DAC and trigger are still correct in timing. However, the alignment is lost, and timing difference is keep shifting. In update rate between 1Msps and 2Msps, each time after the sequence is downloaded via USB, there is a chance that the alianment will miss but not each time.
I suspect it will be better if I can have access to the signal that each DMA transfer finishes as that will the be the exact time that I want to count in the counter.
Best,
Show LessHello All,
I need to generate timestamp in Unix /Epoch time in my PsoC5LP project.
However there is no API to set/get time in Unix format with PSoC5LP RTC.
I see that PsoC4BLE device's RTC support Get_Unix_Time() and Set_Unix_Time APIs.
Can someone help me with Unix time in PsoC5 RTC?
Are there any common libraries available for datetime to unix time and vice versa for PsoC?
Is it possible to port the APIs from PsoC4 to PsoC5?
Regards,
Reshmi
Show LessI have already developed firmware that uses 16-bit, but now I need higher sampling rate so 14-bit is used. I would like to keep one firmware that can work with either. Is it possible to modify the resolution at run-time?
Show LessHello again
I am trying to read a sensor that outputs a frequency value and while trying to understand how I could do that I came across this example that does just that: http://www.cypress.com/file/144696/download and Frequency Measurement.
While trying to get the example given in the last link to work I ran into an issue while debugging because the debugger seems to get stuck in the if operation when checking for the interrupt flag to be true and I'm not sure why (line 141 from the main.c file in the attachment). I tried changing the interrupt routing into a CY_ISR function like I did with one of my other projects but to no avail.
I'm also trying to understand the component functioning because I'm pretty sure I'm not getting the full picture. As far as I understood, the PWM is there to create an interval where the counter can count the rising edges of the signal placed in the input pin. What I'm not understanding is how the pwm clock influences the whole thing. I will eventually need to use this with a much lower period, so I'm already trying to be ahead of things for when I need to change it. I'm not sure what I should change to turn the period down, if the PWM clock or the PWM pulse width itself, and I also haven't understood fully what the counter clock influences.
I will attach the project example that I fiddled with.
Would appreciate any help you guys could give.
Thank you very much
Show LessI have an application were I am receiving data over RF at a "constant" rate of 500 Kbps for some hours and I need to get that data to a Linux machine so that it can store the data into bulk non-volatile memory. Right now on the Linux machine I am using libusb-1.0 to read the data that is received from the PSoC.
For simplicity, I have started by doing a simple bulk transfer with one endpoint after I receive a given packet; however, this clearly can not work since the shortest polling interval for a bulk transfer is 10 ms. Also I am not sure what throughput I could expect if I were to gather 512 bytes worth of data then send that data with a bulk transfer.
I did some quick math and it should take ~8 ms to receive 512 bytes worth of data over RF so a 10 ms transfer interval, so a bulk transfer solution with a single end point might not work.
Failing the bulk transfer, I was thinking about setting the transfer up to look like usbuart and just clock the data out far faster than normal uart data rates. If I were to do this, is there a good way to receive this data over usb in a Linux environment since the data rate wouldn't be a standard uart baude rate?
Mutant usb uart would be a great way to handle the data transfer if there was a nice easy way to receive it on Linux.
Finally, as a last resort, I was thinking about going with an isochronous transfer. I downloaded the an56377 and it has an example that does this with DMA and can apparently hit data rates up to 800 KB/s which would be more than plenty of course; however, I would like to avoid the added programming complexity Linux side.
As always, I appreciate all and any advice, and I look forward to our discussion.
Show LessHi All,
I have tried the power management_Hibernate code example for psoc5 lp family. I am using it in my Cy8c5888LTI-LP097 controller. I am able to go in hibernate mode without watchdog reset but when i try the same code example with watchdog timer, it is not working with it.. I already tried
CyWdtStart(CYWDT_1024_TICKS,CYWDT_LPMODE_DISABLED); and
CyWdtStart(CYWDT_1024_TICKS,CYWDT_LPMODE_MAXINTER);
API so that it will stop the watchdog in hibernate and sleep mode but it is not working in my case.
this is my case i am clearing WDT before entering hibernate mode.
if(Pin_1_Read() == 0) {
/* Turn off LED to indicate Hibernate mode */
LED_P1_2_Write(0u);
CyWdtClear();
/* Prepare system clocks for the Hibernate mode */
CyPmSaveClocks();
/* Switch to the Hibernate Mode */
CyPmHibernate();
/* Restore clocks' configuration */
CyPmRestoreClocks();
LED_P1_2_Write(1u);
}
Any suggestion in this case.
Thanks in advance...
Regards
Abhishek
Hi,
With PSoC 5, I2C Master UDB configuration, I am interfacing to a Microchip 244AA64F EEPROM. My goal is to write information to the EEPROM, then read back to verifty. So far I have only been successful by using a fixed CyDelay() with a minimum of 4 milliseconds. The Microchip data sheet has a flowchart for ACK polling which I've attempted but my status from I2C is always I2C_MSTR_ERR_LB_NAK, then becomes I2C_MSTR_BUS_BUSY and never becomes I2C_MSTR_NO_ERROR.
Once the write has been performed a I2C_1_MasterSendStop()_is sent. Then I would like to somehow poll that the write cycle has completed and continue on. The Microchip datasheet states that while a write cycle is in progress, the chip will not submit an ACK and recommends sending a start condition until the ACK is returned. This is how I've implemented it (unsuccessfully).
status = I2C_1_MasterSendStart(0x50, I2C_1_WRITE_XFER_MODE) ;
while(status != I2C_1_MSTR_NO_ERROR)
{
I2C_1_MasterSendStart(0x50, I2C_1_WRITE_XFER_MODE) ;
}
Is there a simple, tried and true method for polling?
Thanks, Nick
Show LessHello, I have not used the SPI Master function before and have a few questions. I am interface to the XRA1403 SPI 16-BIT IO Expander to toggle 16 LEDs. The SPI interface is described in the data sheet:
The SPI command Byte format is
Bit 7 (1=Read Operation and 0=Write Operation),
Bits6:1 is the Command Byte
Bit 0 is Reserved
My question is when I call the SPI_Write function will it clear bit 7 of the Command byte? Or must I control it in the Command Byte word.
#define OCR1_WR 0x02 // Write to Output Control Register, but 7 is cleared
#define OCR1_RD 0x82 // Read from Output Control Register, but 7 is set
So a write would look like:
SPIM_WriteTxData(OCR1_WR | 1); // sets bit 1 in the OCR1 register
Is my read command correct?
But I am not sure how to do a read, can anyone help me with a read?
Thanks,
Joe
Show LessHi there all,
I've been working on creating an I2C Bootloader host application for PC using the CY7C65211 USB-Serial bridge IC aboard the CYUSBS234 Dev Kit. I am attempting to bootload the PSoC5 on the CY8CKIT-050.
I finally got the USB-I2C API going in C# .NET (thanks to this thread) and now I'm running into errors during the actual data transfer processes. When I attempt to bootload, I get an error code 0x4019. This corresponds to the bootloader reporting an error (0x4000 is the mask), but I'm not sure where the 0x19 is coming from (it doesn't match to anything in the ReturnCodes enum).
I have a logic analyzer capture of the activity on the bus for the bootload process.
Transmission from Host (0x38 - Enter Bootloader):
Response from PSoC (??? - Where did those 0xFF bytes come from?):
Transmission from Host (0x3B Exit Bootloader):
At this point, the process ends with the 0x4019 error code. The first thing I notice is that the second transmission (response from the PSoC) doesn't to adhere to the response packet structure outlined in the Datasheet for the Bootloader v1.60 component. I'm only getting what is presumably the Start of Packet (0x01) byte after 12 0xFF bytes. I'm not getting the End of Packet (0x17) byte at all.
The twelve 0xFF bytes from the PSoC is almost certainly the issue, but at this point in the execution of the bootload routines, the process is basically out of my hands and in the domain of the bootloader component that's actually handling all the comms to the host.
The length of the start condition on the first transmission from the host and the length of the ACKs at the end of each transmission also seem a bit long, but shouldn't actually matter I don't think?
Any ideas for what I can check to narrow the issue down? Something I'm getting wrong? The bootloader on the PSoC should in theory just handle itself, I don't know why the response is the way it is. I've attached the Creator project. I can also provide the Visual Studio C# WinForms project I've been using to test this if need be.
Thanks,
-Kyle
Show Less