Analog frontend interface

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Analog frontend interface

Jump to solution
649 Views
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)?

Labels (1)
0 Kudos
1 Solution
470 Views
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

View solution in original post

2 Replies
470 Views
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

471 Views
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