Fastest binary sampling frequency possible on PSoc 5LP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I'm using the PSoC 5LP on the CY8CKIT-059 development board for a segment of my final year engineering project. I need to sample binary data at the highest frequency possible. I'm currently using a 50% DC PWM to generate a stream of 1's and 0's as dummy data of a set frequency. I would like to know the minimum sampling period achievable. For the real system the data is not a PWM stream, but an external binary (0 V or 5 V) signal from an IR receiver at a constant frequency. And the faster I can sample, the faster I can transmit my data to the board. I'm using the clock set-up at 78 MHz

I can currently sample one bit every 1.038 us. I do this as follows:

I set up the PWM to create an interrupt at any edge. In the main, when the dummy data starts being received (PWM start), the PWM pin (my "receiver") interrupt is triggered. This enables a flag, which when caught in the main, disables the PWM pin ("receiver") interrupt. Thereafter I enable a timer set for half the PWM period, which sets a sample flag at each interrupt. Each time this sample flag is set, I read the pin by performing a read function on the PWM pin and store it into an array. I have tried other methods, but this is around the fastest speed I could achieve as of yet. Is there anyway of getting a smaller sampling period?  I would preferably like to be able to sample data at every 50, 100, or 200 ns, but anything better than what I have is already an improvement.

Excuse me if this is a really stupid question, but I don't have much experience with this processor. I can attach a minimal project if necessary. Also, if I left out any other details, I will gladly provide them if you let me know.

Thanks in advance. Any help would be greatly appreciated.

Message was edited by: Marcel Stegmann

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I believe that easyest way of sampling input stream woul be using existing SPI slave component SPIS. It just reads input binary stream and converts it to byte. Then you send that byte to PC using USBFS. If continuously transmitting, the bottleneck is USB transfer speed (~2MB/s). Other way to convert binary to byte is Shift register component. No interrupts should be involved. Use DMA to temporarily buffer incoming data in RAM.

View solution in original post

2 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I believe that easyest way of sampling input stream woul be using existing SPI slave component SPIS. It just reads input binary stream and converts it to byte. Then you send that byte to PC using USBFS. If continuously transmitting, the bottleneck is USB transfer speed (~2MB/s). Other way to convert binary to byte is Shift register component. No interrupts should be involved. Use DMA to temporarily buffer incoming data in RAM.

Anonymous
Not applicable

Thank you very much! I've never used an SPIS or a DMI component before, but it actually seems like a very suitable solution to my problem. It's not what I was hoping for as I will find it more difficult to debug it if I get transmission errors, but very suitable. If I can get it working I'll definitely vote this as the correct answer. Thank you.

0 Likes