Thursday 20 October 2016

Multitasking on PIC microcontrollers


Multitasking is important these days. I wonder how we can achieve it in microcontrollers and embedded programming. I am designing a system which is based on a PIC microcontroller. I have designed its firmware in MplabX IDE using C and then designed an application for it in Visual Studio using C# .


Since I've gotten used to using threads in C# programming on the desktop to implement parallel tasks, is there a way to do the same in my microcontroller code? MplabX IDE provides pthreads.h but it is just a stub with no implementation. I know there is FreeRTOS support but using that makes your code more complex. Some forum says that interrupts can also be used as multi tasking but I don't think interrupts are equivalent to threads.


I am designing a system which sends some data to a UART and at the same time it need to send data to a website via (wired) ethernet. A user can control the output through the website but the output turns ON/OFF with a delay of 2-3 sec. So that is the problem I am facing. Is there any solution for multi tasking in microcontrollers?




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...