Analog frontend interface

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Analog frontend interface

跳至解决方案
686 次查看
martindusek
Contributor V

I have analog frontend IC sampling image sensor which outputs data on 8 bit parallel bus every falling edge of its clock, approx. 600 000 samples per second.

I want the samples to be written to Kinetis K26 RAM as they arrive from the IC. Is it possible with some Kinetis peripheral (i.e. not involving CPU)?

标签 (1)
0 项奖励
回复
1 解答
507 次查看
mjbcswitzerland
Specialist V

Hi

You can use a GPIO to generate a DMA transfer request on any edge. A DMA channel can copy the 8 bits of data from the FlexBus to internal SRAM. 600kByte/s is a low load for this.

Below is how it is configured in the uTasker project (example of reading to a 1k circular RAM buffer on each falling edge of PTB16). Optionally an interrupt can be triggered each time the circular buffer is half-full or when it circles back. The code can be used on any Kinetis processor with DMA (compatible with Cortex M4 and M0+ parts).

static unsigned char ucInputBuffer[1024];            // circular buffer to receive into
INTERRUPT_SETUP interrupt_setup;                     // interrupt configuration parameters
interrupt_setup.int_type       = PORT_INTERRUPT;     // identifier to configure port interrupt/DMA
interrupt_setup.int_handler    = 0;                  // no interrupt handler when using DMA
interrupt_setup.int_port       = PORTB;              // the port that the interrupt input is on
interrupt_setup.int_port_bits  = PORTB_BIT16;        // input pin controlling triggers
interrupt_setup.int_port_sense = (IRQ_FALLING_EDGE | PULLUP_ON | PORT_DMA_MODEL); // DMA on falling edges
// Configure DMA channel 9 to transfer a byte from an external address to the input circular buffer on each trigger
//
fnConfigDMA_buffer(9, DMAMUX0_CHCFG_SOURCE_PORTB, (sizeof(ucInputBuffer)), EXTERNAL_ADDRESS, ucInputBuffer, (DMA_DIRECTION_INPUT | DMA_BYTES), 0, 0);
fnConfigureInterrupt((void *)&interrupt_setup);      // configure interrupt/DMA and begin

Regards

Mark

http://www.utasker.com/kinetis/TWR-K65F180M.html

在原帖中查看解决方案

2 回复数
507 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Martin,

I think the Kinetis K26 can read the data from the sensor via DMA or interrupt mode using the GPIO parallel data bus or FlexBus bus as Mark said, but we need the detail, can you give us the part number so that we can have a review?

BR

XiangJun Rong

508 次查看
mjbcswitzerland
Specialist V

Hi

You can use a GPIO to generate a DMA transfer request on any edge. A DMA channel can copy the 8 bits of data from the FlexBus to internal SRAM. 600kByte/s is a low load for this.

Below is how it is configured in the uTasker project (example of reading to a 1k circular RAM buffer on each falling edge of PTB16). Optionally an interrupt can be triggered each time the circular buffer is half-full or when it circles back. The code can be used on any Kinetis processor with DMA (compatible with Cortex M4 and M0+ parts).

static unsigned char ucInputBuffer[1024];            // circular buffer to receive into
INTERRUPT_SETUP interrupt_setup;                     // interrupt configuration parameters
interrupt_setup.int_type       = PORT_INTERRUPT;     // identifier to configure port interrupt/DMA
interrupt_setup.int_handler    = 0;                  // no interrupt handler when using DMA
interrupt_setup.int_port       = PORTB;              // the port that the interrupt input is on
interrupt_setup.int_port_bits  = PORTB_BIT16;        // input pin controlling triggers
interrupt_setup.int_port_sense = (IRQ_FALLING_EDGE | PULLUP_ON | PORT_DMA_MODEL); // DMA on falling edges
// Configure DMA channel 9 to transfer a byte from an external address to the input circular buffer on each trigger
//
fnConfigDMA_buffer(9, DMAMUX0_CHCFG_SOURCE_PORTB, (sizeof(ucInputBuffer)), EXTERNAL_ADDRESS, ucInputBuffer, (DMA_DIRECTION_INPUT | DMA_BYTES), 0, 0);
fnConfigureInterrupt((void *)&interrupt_setup);      // configure interrupt/DMA and begin

Regards

Mark

http://www.utasker.com/kinetis/TWR-K65F180M.html