Please help me to write the code for the given requirement.
I want to send the ADC data to the port. I want 500k data to read the ADC and write to the port by using 12 bit SAR ADC of PSOC059lp
Welcome in the forum.
What do you understand by "the port" where you want to send the data to? What device is sitting on "that port" and accepts the data?
Did you already download and install Creator 4.0?
Which kit have you got?
I am using CY8CKIT-059 PSoC® 5LP Prototyping Kit. I am dealing with the analog signal frequency of 60 kHz. I want to digitized the analog signal by using 12 bit SAR adc (single ended adc) with a maximum sampling frequency(1 MSPS) for the duration of 5 miliseconds and then send adc output data to the GPIO pin of the microcontroller or GPIO pin of CY8CKIT-059 PSoC® 5LP Prototyping Kit. I installed the Psoc creator 4 along with CY8CKIT-059 Kit Setup. Please help...
There is no "the GPIO pin". You may setup a 12 bit wide interface with status/clock signals or use a standard interface as UART, I2C or SPI to shovel the data to your device (which you did not mention what it is).
1 Msps for 5ms are 5000 values, so you'll need 10kB temporary storage which you have got on a PSoC5. To transfer the ADC data to sram you will need to use DMA. In Creator you will find (from Start Page) a couple of examples which you can modify for your needs.
Chandan, when you want me to help you, you should say something about your device that is going to get the data. Because there is no 12bit wide port I am asking that question. What are you going to do with the ADC samples sent out??
I want to connect Raspberry pi of 12 Gpio pin to the 12 port of Psoc 059lp prototype kit. I do not want to use internal RAM of Psoc 5. So I want to write ADC data of psoc 5 to the RAM of raspberry Pi. Please help.
Your raspberry has got
You will need select one and write some code to get the incoming data.
On PSoC side you will need to buffer your data in memory because transmission speed is quite limited.
I am not saying it is impossible, but it will be at least very very hard to make the Raspberry Pi to read 12 bit parallell GPIO data input with any reasonable speed. There will also be handshaking needed and remember this type of things are usually done using Linux kernel drivers, that you probably would have to write also. Using memory mapped IO registers it is perhaps possible to do this from userspace, but there will be no guarantee that the kernel doesn't mess up the timings.
So the reasonable, efficient, way to get things done is to use a serial interface, UART is probably the easiest way, buffer the data in PSoC RAM and then send it over UART to the RPi. Use ADC -> DMA -> RAM buffer. Then when the data has been sampled, let the program send the data over serial. For more speed you can use SPI but then then you will have more problems with setting up SPI to talk nicely from both sides. Its really a question of how much time and effort debugging communications problems you can spend, compared to the safe but slow way. If I were you I would first make UART data transfer work, and then if I need more speed look at how this can be improved. Perhaps by using USB_SERIAL, this can improve speed quite a bit.
Writing an RPi program to read the incoming UART serial data is standard.
I am thank full for your response. Since my signal frequency in the range of 60kHz to 100kHz. I need fast data transmission . In the UART communication has a maximum speed of 460 Kbps. Thats why I need GPIO read and write to RAM of Raspberry Pi for the fast data transfer RAM and send it via Wi-Fi communication.
Well USB UART can handle up to 10Mbit/s, if the OS allows it and they are well programmed.
Unfortunately these are the limitations of the platforms you work with so you need GPIO am afraid you will have to do most of the work yourself.
Setting out 12 output pins on one port on CY8CKIT-059 will probably not work, but you can use something like four groups of four pins, you will need handshaking. These cannot be written by DMA but it must be done under firmware control. For 100 kHz it should be possible, I am afraid the RPi side will be much harder.
Right sir, Setting out 12 output pins on one port on CY8CKIT-059 will probably not work, so I am using 8 and 4 group of pin. As part of Raspberry Pi side I am trying. I want to take the advantage of Wi-Fi communication inbuilt with Raspberry Pi.