Communications task in background

Discussion around product based on ARM Cortex M4 core.

Moderators: nferre, ncollot

Yaro
Posts: 13
Joined: Mon May 25, 2015 8:00 pm

Communications task in background

Wed Dec 23, 2015 6:04 pm

Hi all,

I want to ask if it's possible to unload main routine form communications task and let them run in background.

For example I'm using on ARM MCU this peripherals:
- ADC
- I2C
- UART
- SPI

When adc_start(ADC); is called, ADC start conversion in background so I don't need to wait untill ADC has finished conversion and I can go to the next istruction and later read the ADC result.

I want to ask if it's possible to do the same with communication periphericals. I2C and SPI can be fast, but since my MCU can reach 120Mhz of speed, it's a waste of MCU speed if I need to wait untill I2C have finished to trasmit at 400kHz or SPI at 20Mhz or worst with UART. Also, if I perform some tasks and I don't want to interrupt them, I need to be able to unload MCU from any interrupts form peripherals and let them recive packets, buffer them and when I need to read them.

For now I've used functions as "twi_master_write" that "will NOT return until all data has been written", I've looked and didn't found any functions to perform what I'm looking for.

Something like this is possible?

Thank you!
joshw
Posts: 14
Joined: Sat Jan 17, 2015 4:29 am

Re: Communications task in background

Wed Dec 23, 2015 9:12 pm

The Atmel SAM controllers all have DMA which is capable of depositing data from an SPI, TWI, or USART into memory. You will need to make sure that you have enough channels for the particular controller and application you choose.
Josh @ CIHOLAS Inc

Return to “SAM4 Cortex-M4 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest