NTS Forums

Please login or register.

Login with username, password and session length
 

News:

Welcome to the Newtek Technology Services Forum!


Author Topic: Multitasking on PIC microcontrollers  (Read 33 times)

Offline xinlei

  • Hosting Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Multitasking on PIC microcontrollers
« on: June 29, 2017, 12:50:55 AM »
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(PIC12F629). 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?