Skip to Content
Hands-On RTOS with Microcontrollers
book

Hands-On RTOS with Microcontrollers

by Brian Amos
May 2020
Intermediate to advanced
496 pages
13h 54m
English
Packt Publishing
Content preview from Hands-On RTOS with Microcontrollers

Pros and cons of a polled driver

Here are some of the advantages of using a polled driver:

  • It is easy to program.
  • Any task has immediate access to data in the queue.

At the same time, there are many issues with this approach:

  • It must be one of the highest priority tasks in the system.
  • There is a high chance of data loss when not executing at high priority.
  • It is extremely wasteful of CPU cycles.

In this example, we're only transferring data at 9,600 baud. Granted, most of the time was spent spinning on the RXNE bit, but transferring every byte as it is received in a queue is also fairly expensive (when compared to pushing bytes into a simple array-based buffer). To put this into perspective, USART2 on STM32F767 running at 216 MHz has ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers - Second Edition

Hands-On RTOS with Microcontrollers - Second Edition

Jim Yuill, Penn Linder

Publisher Resources

ISBN: 9781838826734Supplemental Content