Hello!
I am planning to connect 2 10Megasemples/sec ADC with parallel output to kinetis MCU. Before i was planning to use FX3 from Cypress with USB 3.0 and 198Mhz parallel I/O(GPIF II) but yestarday i've seen that there is new k26 with usb HS PHY-nice news! It will be enoght for me and I like kinetis:)
So now i have a question how to interface those ADCs to MCU. In the datasheet it is written that rise and fall time of GPIO is less than 50ns so i''l be able to read 10 MSPS. Is it so?
In other hand for parallel devices there is an advice to use FlexBus but i've never used it before. Fast glanchat the datasheet says that firstly i have to set an adress before reading. Is there any advices for me?
P.S. SInce ADC is 16bit and more precise than MCU clock system will be separate device with PLL from analog devices. I will have to catch that clocks as external interrupt.
Thanks for solutions and have a good day!
已解决! 转到解答。
Hi, Alexey,
Frankly speaking, your question is difficult to answer, because the 10MSPS is a critical speed. I suppose your ADC interface has only data bus, one clock input signal and one flag output signal. Once the flag signal is for example High, you can read the data bus to get valid sample. I think there are several solution to read the samples. Assume you use K26, the core clock frequency is 180MHz, the FB_CLK is 60MHz. 10MSPS means that the reading time is within 100nS.
1)using FlexBus to transfer data.
In the solution, you can connect the flag to GPIO pin, connect the data to Data bus of FlexBus. One FlexBus access takes at least 4 FB_CLK cycles or 16nS*4=64nS, you have to consider the instruction time, reading the Flag pin, checking the logic, then reading the data via FlexBus.
2)using GPIO pins to read samples.
connect the GPIO pins in one port to data bus of the ADC, connect the flag to another GPIO, I think the solution is shorter than using FlexBus
3)using DMA to transfer sample of ADC.
connect the data bus of ADC to GPIO in one port, connect the flag to GPIO pin in another port, set up the Flag GPIO to trigger DMA. The DMA peak frequency is 12MHz.
4)using interrupt to read samples.
You can connect the data bus of ADC to GPIO pin in one port, connect flag signal of ADC to GPIO in another port. Because the interrupt mechanism takes a long time to push/pop some register to stack, I think the solution is impossible.
You can get the K20 Tower board and have try.
BR
XiangJun Rong
Hi, Alexey,
Frankly speaking, your question is difficult to answer, because the 10MSPS is a critical speed. I suppose your ADC interface has only data bus, one clock input signal and one flag output signal. Once the flag signal is for example High, you can read the data bus to get valid sample. I think there are several solution to read the samples. Assume you use K26, the core clock frequency is 180MHz, the FB_CLK is 60MHz. 10MSPS means that the reading time is within 100nS.
1)using FlexBus to transfer data.
In the solution, you can connect the flag to GPIO pin, connect the data to Data bus of FlexBus. One FlexBus access takes at least 4 FB_CLK cycles or 16nS*4=64nS, you have to consider the instruction time, reading the Flag pin, checking the logic, then reading the data via FlexBus.
2)using GPIO pins to read samples.
connect the GPIO pins in one port to data bus of the ADC, connect the flag to another GPIO, I think the solution is shorter than using FlexBus
3)using DMA to transfer sample of ADC.
connect the data bus of ADC to GPIO in one port, connect the flag to GPIO pin in another port, set up the Flag GPIO to trigger DMA. The DMA peak frequency is 12MHz.
4)using interrupt to read samples.
You can connect the data bus of ADC to GPIO pin in one port, connect flag signal of ADC to GPIO in another port. Because the interrupt mechanism takes a long time to push/pop some register to stack, I think the solution is impossible.
You can get the K20 Tower board and have try.
BR
XiangJun Rong
Hi XiangJun Rong,
Thanks for responde! Your answer is very helpful. Yes, you got it right- ADC got and output that indicates that converting is finished,(ADC is LTC2202).
1) Should i write zeros to adress to just get parallel input? Are there any good examples similar to my situation? (have nere worked with FB before)
2)If it can handle 10Mhz it for sure will be the fastest solution. Solution in that case is clear for me. I got a FRDM k20 and try to check GPIO speed with signal generator.
3)"The DMA peak frequency is 12MHz." Wow, have never took it in consideration. I thought it has the bus speed. Thanks for point that out!
4)That's right,thanks.
Hi, Alexey,
1) Should i write zeros to adress to just get parallel input? Are there any good examples similar to my situation? (have nere worked with FB before)
>>>>>Because the ADC data bus does not have address, so you need only to connect the data bus of ADC to the data bus of FlexBus, check the FlexBus address space in the reference manual of the respective Kinetis, it is okay if the address is within the range of FlexBus space.
This is an application note for the FlexBus An4393.
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4393.pdf
2)If it can handle 10Mhz it for sure will be the fastest solution. Solution in that case is clear for me. I got a FRDM k20 and try to check GPIO speed with signal generator.
>>>>>You can try to connect the Flag of ADC to one GPIO, connect data bus to another GPIO port, then have a try.
3)"The DMA peak frequency is 12MHz." Wow, have never took it in consideration. I thought it has the bus speed. Thanks for point that out!
>>>>>I think you can try the solution, connect flag of ADC to GPIO which can trigger DMA, connect the data bus to another GPIO port.
Because the timing is the restriction, you have to use the board and have a try to know if the solution is okay or not.
BR
XiangJun Rong