Multithread with 8051

Hi there,

Does anyone know if it's possible to rum multiple threads on 8051 mocrocontroller?

Thank you.

Parents
  • Certainly. It's just software.

    The 8051 architecture doesn't really lend itself well to preemption, though. It's doable, just as with any processor, but it costs more than you might expect given experience with other processors.

    The compile-time call tree analysis Keil C does becomes far less useful when you can preempt a task at any point in its execution, and thus have to have separate call trees for every task. This tends to increase the amount of space needed for the space, which means you can't fit it into the internal data memory, which means you have to switch to external data for all your temporaries and automatics, which makes all the code bigger and slower. It's not the overhead of a preemptive kernel itself that's a problem, but rather than increase in all the rest of the code.

    Most of these limitations come from the awkwardness of the DPTR and the instruction set, so it's not a matter of finding better tools.

Reply
  • Certainly. It's just software.

    The 8051 architecture doesn't really lend itself well to preemption, though. It's doable, just as with any processor, but it costs more than you might expect given experience with other processors.

    The compile-time call tree analysis Keil C does becomes far less useful when you can preempt a task at any point in its execution, and thus have to have separate call trees for every task. This tends to increase the amount of space needed for the space, which means you can't fit it into the internal data memory, which means you have to switch to external data for all your temporaries and automatics, which makes all the code bigger and slower. It's not the overhead of a preemptive kernel itself that's a problem, but rather than increase in all the rest of the code.

    Most of these limitations come from the awkwardness of the DPTR and the instruction set, so it's not a matter of finding better tools.

Children
More questions in this forum