Library

Video Player is loading.
 
Current Time 3:00
Duration 22:24
Loaded: 0.00%
 
x1.00


Back

Games & Quizzes

Training Mode - Typing
Fill the gaps to the Lyric - Best method
Training Mode - Picking
Pick the correct word to fill in the gap
Fill In The Blank
Find the missing words in a sentence Requires 5 vocabulary annotations
Vocabulary Match
Match the words to the definitions Requires 10 vocabulary annotations

You may need to watch a part of the video to unlock quizzes

Don't forget to Sign In to save your points

Challenge Accomplished

PERFECT HITS +NaN
HITS +NaN
LONGEST STREAK +NaN
TOTAL +
- //

We couldn't find definitions for the word you were looking for.
Or maybe the current language is not supported

  • 00:02

    Welcome to the Modern Embedded Systems Programming course.

  • 00:05

    I'm sorry for my long absence since posting lesson 20, but I'd like to make it up to you

  • 00:10

    by announcing a new group of lessons about the architecture and design of embedded software.

  • 00:15

    Today I am going to introduce the ubiquitous foreground-background architecture, also known

  • 00:21

    as the super-loop or main+interrupts.

  • 00:24

    Apart from being interesting in its own right, foreground/background is the starting point

  • 00:29

    for all embedded software architectures and, among others, is an important stepping stone

  • 00:34

    to understanding a Real-Time Operating System (RTOS), which was perhaps the most requested

  • 00:39

    subject for me to explain.

  • 00:41

    So, you can view this lesson as a prerequisite for the upcoming lessons about the RTOS as

  • 00:47

    well as other architectures.

  • 00:52

    To follow along today's lesson you need to download two pieces of code from the companion

  • 00:57

    website to this course at state-machine.com/quickstart.

  • 01:01

    The first is the lesson 21 project that I prepared in advance, and the second piece is the 'qpc'

  • 01:07

    framework, which you will use in most of the upcoming lessons in this group.

  • 01:15

    You need to unzip these two downloads into the embedded-programming directory on your

  • 01:20

    disk.

  • 01:34

    This lesson also uses the ARM-Keil MDK toolset from the ARM company instead the Eclipse-based

  • 01:40

    Code Composer Studio from Texas Instruments.

  • 01:43

    The reason for this change is that I ran into problems with the latest CCS 7.3, which was

  • 01:48

    simply blocked by my anti-virus software.

  • 01:51

    I made all sorts of attempts to reconcile the CCS with my anti-virus, but I ultimately failed.

  • 01:57

    This is, among others, one reason why this group of lessons took longer to prepare.

  • 02:02

    In the end, I decided to treat this setback as an opportunity to introduce you to the

  • 02:07

    third, very popular and excellent ARM-Keil MDK toolset, which is just as good as the

  • 02:12

    IAR toolset, and in my option easier to use than Eclipse.

  • 02:17

    To get Keil MDK, you can start from ARM.com and choose the "Development Tools -> Microcontroller

  • 02:23

    and Embedded Development" menu.

  • 02:25

    Alternatively, you can simply google for "Keil MDK".

  • 02:28

    Either way, you will land on this main MDK page.

  • 02:38

    As you can see in the comparison of available MDK editions, there is a free, code-size limited

  • 02:43

    Lite version, which will be perfectly adequate for all projects in this video course.

  • 02:52

    Click on the Download button and fill out the usual download form.

  • 02:56

    Click the Submit button.

  • 03:00

    While you install the Keil MDK toolset, you might want to familiarize yourself with the documentation

  • 03:12

    The toolset comes with the Getting Started videos and a guide in PDF.

  • 03:19

    So, assuming that you have successfully installed ARM Keil MDK toolset, you can go to the lesson21

  • 03:29

    directory you have just downloaded and click on the provided uVision project file.

  • 03:37

    When you run the Keil uVision IDE for the first time, you might need to register the

  • 03:42

    license, which in my case is MDK-Lite Evaluation Version.

  • 03:46

    You can get this license online by clicking on "Get LIC via Internet".

  • 03:55

    Also, the first time you open a project for the TivaC LaunchPad board, you might need

  • 04:00

    to install the so called "Software Pack".

  • 04:03

    You open the Pack Installer

  • 04:09

    and select the Texas Instruments, TivaC Series, TM4C123x Series pack, which includes your

  • 04:17

    specific microcontroller.

  • 04:20

    OK, so finally you can get to the code for today's lesson that is actually very similar

  • 04:27

    to what you had back in lesson 8 in that it simply blinks the green LED on your TivaC

  • 04:34

    LauchPad board.

  • 04:35

    The only difference from the previous version is the delay() function, now called BSP_delay(),

  • 04:42

    because it is defined in the Board Support Package (BSP), which you first encountered

  • 04:47

    in lesson-15.

  • 04:49

    In this lesson you will see how to take the concept of the Board Support Package to the

  • 04:53

    next level.

  • 04:55

    Before you go any further, let's just build this version of the Blinky program and check

  • 05:00

    that it still works by opening it in the micro-Vision debugger.

  • 05:14

    When you run the program, you can see that the Green LED blinks by staying on for about

  • 05:18

    a quarter of a second and off for about three quarters of a second.

  • 05:24

    Now, going back to the editing mode, let me explain a few things about the BSP_delay()

  • 05:32

    function.

  • 05:34

    Unlike the previous crude delay() implementation from lesson-8, BSP_delay() is based on the

  • 05:40

    SysTick interrupt, which delivers more precise timing, because it does not depend on the

  • 05:44

    speed of the compiler-generated code.

  • 05:47

    In this new implementation, the SysTick interrupt is programmed to fire at a rate of BSP_TICKS_PER_SEC,

  • 05:54

    which is defined as a hundred times per second in the bsp.h header file.

  • 05:59

    This BSP_TICKS_PER_SEC constant is subsequently used to configure the SysTick interrupt.

  • 06:10

    The SysTick interrupt handler simply increments the local l_tickCtr variable, which is declared

  • 06:16

    both static and volatile.

  • 06:18

    The 'volatilie' qualifier has been introduced back in lesson-5, but here let me quickly

  • 06:23

    remind you that when you declare a variable to be "volatile", you are telling the compiler

  • 06:28

    that the variable might change unexpectedly even though no currently performed program

  • 06:32

    instructions change it, which is exactly what can happen when a variable is modified in

  • 06:37

    an interrupt.

  • 06:38

    The BSP_tickCtr() function simply reads and returns the current value of l_tickCtr variable.

  • 06:45

    But as you surely remember from the last lesson-20, to avoid any race conditions between the SysTick

  • 06:51

    interrupt and the code that calls BSP_tickCtr(), the access to such a variable must occur in

  • 06:57

    a critical section, that is, with interrupts disabled.

  • 07:00

    Finally, the BSP_delay() function first reads the tick counter and stores it in the automatic

  • 07:06

    variable 'start'.

  • 07:08

    Next, it enters a polling while-loop, which constantly reads the tick counter value and

  • 07:13

    computes the difference from the start.

  • 07:15

    The loop continues as long as the difference is smaller than the specified number of clock

  • 07:20

    ticks.

  • 07:21

    Please note that the 2's complement arithmetic, which I discussed in lesson 2, handles properly

  • 07:26

    the discontinuity when the tick counter rolls over from all-Fs to 0.

  • 07:32

    At the end of the day, however, the BSP_delay() implementation, just like the previous, crude

  • 07:37

    delay() function, is based on the same primitive idea of polling, so it ends up wasting all

  • 07:42

    the CPU cycles until the specified number of clock ticks elapse.

  • 07:47

    However, for this lesson, the most important point is that the software structure of the

  • 07:51

    Blinky program has all the characteristics of the so called *foreground/background architecture*

  • 07:57

    also known as "main+ISRs", which is very common in smaller embedded systems.

  • 08:03

    As the name suggests, the architecture consists of two main parts: the endless *background*

  • 08:08

    loop inside the main() function and the interrupt handlers, like your SysTick_Handler() and

  • 08:13

    possibly others, comprising the *foreground*.

  • 08:17

    The interrupts running in the foreground preempt the background loop, but they always return

  • 08:22

    to the point of preemption.

  • 08:25

    The two parts of the system communicate with each other by means of shared variables, like

  • 08:31

    l_tickCtr.

  • 08:32

    To avoid race conditions due to preemption of the background loop by the foreground interrupts,

  • 08:36

    these shared variables should be defined as volatile and must be protected by briefly

  • 08:41

    disabling interrupts around any access to them from the background.

  • 08:46

    The timing of the execution of the various functions called from the background loop

  • 08:50

    is not well defined, because it depends on the time spent inside the loop that typically

  • 08:54

    varies from one pass through the loop to another due to conditional branching in the code and

  • 08:59

    interrupt activity.

  • 09:01

    For these reasons, any operations with strict time constraints cannot be reliably performed

  • 09:06

    from the background loop and must be pushed to the interrupt level running in the foreground.

  • 09:11

    However, this tends to make the interrupts longer and they might start to interfere with

  • 09:15

    the background loop and with each other.

  • 09:17

    Still, due to its simplicity, the foreground/background architecture is very popular in high-volume

  • 09:23

    embedded applications, such as consumer electronics, home appliances, toys, remote controllers,

  • 09:37

    and countless others.

  • 09:40

    Foreground/background is also exactly the architecture used in various maker platforms,

  • 09:46

    such as Arduino.

  • 09:48

    Here, for example is the Arduino version of the Blinky program.

  • 09:53

    At the first glance, you might not recognize it as a foreground/background, because Arduino

  • 09:58

    hides it inside its library.

  • 10:02

    But if you take a look at the main function inside the Arduino library, you should immediately

  • 10:11

    recognize the familiar background architecture consisting of initialization, the setup()

  • 10:22

    function, and the endless loop, repetitively, calling the loop() function.

  • 10:28

    Note that the for-loop with empty control is equivalent to the while(1) loop and is

  • 10:33

    a C-language idiom that means for-ever.

  • 10:38

    Arduino has, of course, also the foreground level consisting of interrupt handlers.

  • 10:43

    Here, for example, is the system clock tick Interrupt Service Routine (ISR), which increments

  • 10:48

    some counters, just like your SysTick handler.

  • 10:53

    There is also, of course, the matching polling delay(), which is perhaps the most frequently

  • 10:58

    used function in Arduino programs.

  • 11:03

    Now, let's go back to your Blinky background code and notice that you can still organize

  • 11:09

    it a bit better.

  • 11:11

    For example, the initialization part is board-specific, so it logically belongs to the Board Support

  • 11:17

    Package (BSP).

  • 11:18

    So, let's make a BSP_init() function inside the BSP module, place all the initialization

  • 11:27

    code there, and call it from main.

  • 11:34

    Next, notice that switching the LEDs on and off is also board-specific, meaning that the

  • 11:42

    code will need to change if you used a different board with LEDs attached to different pins.

  • 11:47

    Therefore, you should move this code to the BSP as well.

  • 11:51

    Specifically, inside the BSP module you can create BSP functions to turn LEDs of various

  • 11:57

    colors on and off.

  • 12:00

    Once the functions are defined, you can simply call them from the background loop.

  • 12:14

    Of course, you need to add the prototypes of all the new BSP functions to the BSP header

  • 12:19

    file.

  • 12:22

    An finally, notice that now you can now remove all board-specific stuff from the main code,

  • 12:32

    such as the MCU header file, the LEDs pin numbers, etc.

  • 12:37

    You can move all this stuff into bsp.c, because your background loop no longer depends on

  • 12:42

    any of these details.

  • 12:49

    As you can see the code compiles and links error-free.

  • 12:53

    The end effect is that your main code is completely insulated from the board.

  • 12:57

    The background code only specifies WHAT needs to be done, while the BSP code specifies HOW

  • 13:03

    to do it.

  • 13:04

    This way of separating concerns (the WHAT from the HOW) has many advantages.

  • 13:09

    First, your main code is smaller and self-explanatory.

  • 13:12

    You really don't need comments to understand what's going on.

  • 13:15

    The second advantage is that you could run this main code on a different board or you

  • 13:20

    could use a different development toolchain.

  • 13:23

    Of course, you would need to provide a different BSP implementation in the bsp.c file, but

  • 13:29

    you don't need to change a single line of your main application code.

  • 13:33

    It is even possible to run your main application on a desktop PC, which is not an embedded

  • 13:38

    board at all.

  • 13:40

    Now, let's check experimentally where your Blinky program spends the most of its time

  • 13:45

    by simply breaking into the running code.

  • 13:48

    As you can see, the program stops in BSP_tickCtr() function.

  • 13:52

    When you inspect the call stack view, you can see that BSP_tickCtr() is called from

  • 13:56

    BSP_delay(), which in turn is called from main at the shown location.

  • 14:02

    In fact, you have almost no chance at all to find this program doing anything else than

  • 14:08

    delaying its execution.

  • 14:11

    When you draw a flowchart of this background code you can see arrows going *backwards*

  • 14:15

    the flow of control.

  • 14:17

    These are the pooling loops where the code spends the most of its time, and therefore

  • 14:21

    they are shown with thick lines.

  • 14:23

    I will call this type of code both *blocking* and *sequential*.

  • 14:28

    The code is *blocking*, because it waits for events (such as a timeout event after expiration

  • 14:32

    of a delay) in-line and does not progress until the expected event arrives.

  • 14:38

    Once the event arrives, however, the code naturally progresses directly to handling

  • 14:43

    the event because the code downstream the blocking call provides the right context for

  • 14:48

    the expected event.

  • 14:50

    The code is *sequential*, because the sequence of expected events is hard-coded in the sequence

  • 14:55

    of instructions.

  • 14:57

    For example, the Blinky program expects a timeout event of a duration of 1/4 second

  • 15:02

    after turning the Green LED on, and another timeout event of duration 3/4 of a second

  • 15:08

    after turning the Green LED off.

  • 15:11

    But it is also possible to arrange the background code differently in a non-blocking fashion,

  • 15:17

    without the polling loops that busy-wait for specific events.

  • 15:20

    To show this alternative, I make the sequential implementation inactive by surrounding it

  • 15:25

    with #if 0 ... #endif.

  • 15:28

    Now, I add the new non-blocking version of the background loop.

  • 15:38

    When you build and debug this version, you can see that it blinks exactly as before.

  • 16:00

    But when you break into the code, you can see that it always stops inside the main loop

  • 16:05

    rather than inside some other function.

  • 16:20

    When you look at the flowchart of the non-blocking background code, you can see that no arrows

  • 16:25

    in the flowchart go backwards.

  • 16:27

    Instead, all arrows point forwards without blocking the main background loop, so the

  • 16:32

    program spends the most of its time right in the main loop, as indicated by the heavy

  • 16:37

    lines.

  • 16:39

    Compared to the sequential and blocking version, the non-blocking main loop spins hundreds

  • 16:43

    of thousand times per second instead of only once per second in the sequential code.

  • 16:49

    This means that the main loop can handle events as soon as they arrive in the order in which

  • 16:54

    they arrive.

  • 16:55

    In other words, the non-blocking code is driven by events, and therefore I will call it *event-driven*.

  • 17:03

    Of course, there is a price to pay for this increased flexibility and timeliness of such

  • 17:07

    non-blocking code, and that is the apparent higher complexity.

  • 17:13

    The event-driven code is more complex, because the sequence of events this code can accept

  • 17:18

    is no longer hard-coded in the sequence of instructions.

  • 17:22

    By the way, the non-blocking code is structured here as a polling state machine.

  • 17:27

    This is unfortunately not the norm.

  • 17:29

    In the majority of real-life projects, you will see rather convoluted and deeply nested

  • 17:34

    IF-THEN-ELSE branching based on the value of many global variables, also known as the

  • 17:40

    "spaghetti code" or a "big ball of mud".

  • 17:43

    I cannot go into details of state machine in this lesson about foreground/background

  • 17:47

    systems.

  • 17:48

    But I promise to come back to state machines, in several upcoming lessons, actually, as

  • 17:53

    they are fundamentally important in embedded systems programming.

  • 17:58

    This concludes this lesson about the foreground/background architecture, which is fundamental to understanding

  • 18:03

    all other architectures used in embedded software.

  • 18:05

    You saw that foreground/background can be implemented either using the sequential paradigm

  • 18:11

    with blocking, or with the event-driven and non-blocking paradigm.

  • 18:16

    In the upcoming lessons I will explore all these options, starting with the introduction

  • 18:20

    to Real-Time Operating Systems in the very next lesson!

  • 18:25

    If you like this channel, please subscribe to stay tuned.

  • 18:29

    You can also visit state-machine.com/quickstart for the class notes and project file downloads.

All

The example sentences of FAMILIARIZE in videos (15 in total of 28)

while preposition or subordinating conjunction you personal pronoun install verb, non-3rd person singular present the determiner keil proper noun, singular mdk proper noun, singular toolset proper noun, singular , you personal pronoun might modal want verb, base form to to familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction the determiner documentation noun, singular or mass
we personal pronoun 're verb, non-3rd person singular present so adverb happy adjective that preposition or subordinating conjunction we personal pronoun took verb, past tense the determiner time noun, singular or mass to to familiarize verb, base form ourselves personal pronoun with preposition or subordinating conjunction our possessive pronoun life noun, singular or mass raps noun, plural
you personal pronoun familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction the determiner shapes noun, plural of preposition or subordinating conjunction the determiner drawing verb, gerund or present participle and coordinating conjunction the determiner values noun, plural of preposition or subordinating conjunction chiaroscuro noun, singular or mass
you personal pronoun must modal familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction what wh-determiner point noun, singular or mass of preposition or subordinating conjunction sailing noun, singular or mass and coordinating conjunction what wh-determiner tack verb, base form you personal pronoun are verb, non-3rd person singular present on preposition or subordinating conjunction at preposition or subordinating conjunction all determiner
be verb, base form sure adjective to to familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction their possessive pronoun rules noun, plural and coordinating conjunction etiquette noun, singular or mass when wh-adverb it personal pronoun comes noun, plural to to bicycle noun, singular or mass
each determiner area noun, singular or mass of preposition or subordinating conjunction the determiner swot proper noun, singular analysis noun, singular or mass is verb, 3rd person singular present designed verb, past participle to to better adjective, comparative familiarize verb, base form the determiner one cardinal number conducting verb, gerund or present participle it personal pronoun
please verb, base form feel verb, base form free adjective to to pause verb, base form the determiner video noun, singular or mass and coordinating conjunction familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction the determiner information noun, singular or mass on preposition or subordinating conjunction this determiner chart noun, singular or mass .
those determiner are verb, non-3rd person singular present all determiner prefixes verb, 3rd person singular present you personal pronoun should modal familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction now adverb that preposition or subordinating conjunction we personal pronoun are verb, non-3rd person singular present working verb, gerund or present participle with preposition or subordinating conjunction coulomb proper noun, singular 's possessive ending .
familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction what wh-pronoun makes verb, 3rd person singular present you personal pronoun excited verb, past tense and coordinating conjunction gives verb, 3rd person singular present you personal pronoun pleasure noun, singular or mass so adverb that preposition or subordinating conjunction you personal pronoun can modal communicate verb, base form
like preposition or subordinating conjunction i personal pronoun said verb, past tense , it personal pronoun 's verb, 3rd person singular present important adjective to to familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction the determiner words noun, plural that preposition or subordinating conjunction most adjective, superlative people noun, plural will modal
familiarize verb, base form ourselves personal pronoun and coordinating conjunction just adverb really adverb take verb, base form in particle the determiner beauty noun, singular or mass and coordinating conjunction the determiner history noun, singular or mass of preposition or subordinating conjunction the determiner atmosphere noun, singular or mass .
that preposition or subordinating conjunction you personal pronoun may modal have verb, base form options noun, plural regarding verb, gerund or present participle who wh-pronoun to to take verb, base form in particle your possessive pronoun classes noun, plural so adverb make verb, non-3rd person singular present sure adjective you personal pronoun familiarize verb, base form
on preposition or subordinating conjunction the determiner color noun, singular or mass wheel noun, singular or mass and coordinating conjunction it personal pronoun 's verb, 3rd person singular present probably adverb good adjective to to familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction them personal pronoun , in preposition or subordinating conjunction practice noun, singular or mass
principal proper noun, singular then adverb asked verb, past tense kiyama proper noun, singular and coordinating conjunction okabe proper noun, singular to to support verb, base form their possessive pronoun way noun, singular or mass and coordinating conjunction try verb, base form to to familiarize verb, base form themselves personal pronoun
additional adjective cue noun, singular or mass calls verb, 3rd person singular present on preposition or subordinating conjunction something noun, singular or mass like preposition or subordinating conjunction anki proper noun, singular to to familiarize verb, base form yourself personal pronoun with preposition or subordinating conjunction exactly adverb why wh-adverb you personal pronoun got verb, past tense

Use "familiarize" in a sentence | "familiarize" example sentences

How to use "familiarize" in a sentence?

  • The road to wisdom is paved with excess. The mark of a true writer is their ability to mystify the familiar and familiarize the strange.
    -Walt Whitman-
  • The way good inventions are made is to familiarize yourself with those of others. The men who cultivate letters and the arts are all sons of Homer.
    -Jean-Auguste-Dominique Ingres-
  • I am determined to hold on as long as possible, but if I should disappear, I should not have had the time to familiarize my successors with the necessary information.
    -Jean Moulin-
  • The ability of writers to imagine what is not the self, to familiarize the strange and mystify the familiar, is the test of their power.
    -Toni Morrison-
  • Familiarize yourself with the chains of bondage and you prepare your own limbs to wear them.
    -Abraham Lincoln-
  • Be versed in ancient lore, and familiarize yourself with the modern; then may you become teachers.
    -Confucius-
  • The purpose of life is to familiarize oneself with this after-death body so that the act of dying will not create confusion in the psyche.
    -Terence McKenna-
  • Do something you fear, NOT to conquer the fear, NOT to accomplish a task, but to familiarize yourself with the processes with which fear protects itself, to demystify it.
    -Cheri Huber-

Definition and meaning of FAMILIARIZE

What does "familiarize mean?"

/fəˈmilyəˌrīz/

verb
To learn about or get to know something.

What are synonyms of "familiarize"?
Some common synonyms of "familiarize" are:
  • acquaint,

You can find detailed definitions of them on this page.