Analog frontend interface

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Analog frontend interface

ソリューションへジャンプ
687件の閲覧回数
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 解決策
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

元の投稿で解決策を見る

2 返答(返信)
508件の閲覧回数
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

509件の閲覧回数
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