This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sequential programming Vs FSM Vs RTOS

Hi All,

I've completed a nice data logger project including USB, SD/MMC support, GPS and other SPI devices using sequential programming.

I'm now looking for best practice on how the functionality I've created could be better structured and that leads me towards structuring the functions into a State Machine or use an RTOS to go the threading route.

I've done some research on RTOS but it would be good to hear from practitioners. Any experiences or links to resources regarding correct use of RTOS would be greatly appreciated.

Thanks,

Robert.

Parents
  • Too many people on this site - and around the world - uses RTOS in their embedded systems for it to be a 4-letter word in the derogatory sense.

    An RTOS gives simpler and clearer loops, but instead requires critical sections or similar to protect the threads from corrupting each other. The individual stacks also increases the RAM requirements.

    It takes a bit of information about the goals to know if an RTOS is meaningful or not. An ARM are well suited for an RTOS but that doesn't mean that an RTOS helps for a specific application. An '51 can run an RTOS, but for applications that are complex enough to really warrant an RTOS, there might be an idea to look at other processors instead.

Reply
  • Too many people on this site - and around the world - uses RTOS in their embedded systems for it to be a 4-letter word in the derogatory sense.

    An RTOS gives simpler and clearer loops, but instead requires critical sections or similar to protect the threads from corrupting each other. The individual stacks also increases the RAM requirements.

    It takes a bit of information about the goals to know if an RTOS is meaningful or not. An ARM are well suited for an RTOS but that doesn't mean that an RTOS helps for a specific application. An '51 can run an RTOS, but for applications that are complex enough to really warrant an RTOS, there might be an idea to look at other processors instead.

Children
  • Hi all,

    Thanks for the insight.

    My current target is a 32-bit ARM device (LPC2148). The project started 2 years ago and the LPC had the right mix of speed, flash and perpherials for my project.

    The projects grown from a simple gps logger to a fully featured device with many more interfaces and higher level requirements. I had the gps logging to an SPI flash but recently added a SD card which greatly complicated matters and got me into all sorts of exception handling problems which prompted me to re-evaluate. I'm investigating adding a webserver and an rf module which will further complicate the flow so now is the right time to consider a better structure.

    Thanks,

    Robert