Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/chapter02_03/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example chapter02_03

## The LED program with timing

This example implements the LED program (with timing) for the
Expand All @@ -12,7 +13,7 @@ Building the example can be done with GNUmake
in the command batch or shell script.
The results of the build will be stored in the `bin`
directory. After successful build, files such as the HEX-file
`led.hex` and othe name and map files can be found in `bin`.
`led.hex` and the name and map files can be found in `bin`.

## With `GNUmake`

Expand All @@ -38,9 +39,9 @@ VC as well as Atmel Studio.

In the LED program with timing, the blinking is controlled directly
from the `main` subroutine of the program. The blinking
frequency is approximately 1/2Hz, controlled by a timer dely.
frequency is approximately 1/2Hz, controlled by a timer delay.
The blinking loop can be found in the file `sys_start.cpp`.
It is reproduced below within its contect in `main`.
It is reproduced below within its context in `main`.
Please note the MCAL initialization, which is essential
for initializing clocks and interrupts. It is this layer
that needs to be modified when porting to other microcontroller
Expand Down
1 change: 1 addition & 0 deletions examples/chapter02_03a/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example chapter02_03a

## The LED program with cooperative multitasking scheduler

This example implements the LED program with
Expand Down
Binary file added examples/chapter02_06/images/2020-01-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/chapter02_06/images/measurement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/chapter02_06/images/measurement2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions examples/chapter02_06/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example chapter02_06

## The Led Program (with template LED class)

This example implements the LED program with a template
Expand All @@ -24,15 +25,15 @@ to capture the runtime of the port toggle.
The toggle signal has a width of approximately
$310~\text{ns}$, which agrees well with the claim in the book.

![](./images/2020-01-12.pdf)
![port signal measured on oscilloscope](./images/2020-01-12.png)

The toggle signal having a width of approximately $310~\text{ns}$
captured by a digital oscilloscope is shown.

Manually measuring the toggle signal with a _scope_ might require laboratory skill,
as shown in the next two pictures featuring a hand-help oscilloscope
as shown in the next two pictures featuring a hand-held oscilloscope
probe measurement on one of our self-made Arduino-like boards.

![](./images/measurement.pdf)
![hand-held measurement with oscilloscope](./images/measurement.png)

![](./images/measurement2.pdf)
![closer view of oscilloscope measurement](./images/measurement2-cropped.png)
19 changes: 10 additions & 9 deletions examples/chapter03_02/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Example Chapter03_02

## Integer Types Having Fixed Widths and Prime Numbers

<p align="center">
<a href="https://godbolt.org/z/dPbM7v4ff" alt="godbolt">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" /></a>
<a href="https://godbolt.org/z/dPbM7v4ff">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt" /></a>
</p>

Example chapter03_02 focuses on integer types having fixed widths.
The example gets into a fascinating calculation of prime numbers
that is simultaneously intended to emphasize the usefullness
that is simultaneously intended to emphasize the usefulness
and portability of fixed-width integer types.

## Fixed-Width Integer Types
Expand Down Expand Up @@ -50,7 +51,7 @@ with the input `Prime[100]`.

The example begins by querying the number of entries required
in the sieve to calculate the prime 541. For this, a simple divergent
asymptotic series approximation of the lograithmic integral function is used.
asymptotic series approximation of the logarithmic integral function is used.
Instead of 100, the approximation returns 108, which is
adequately close to the desired limit and large enough.

Expand All @@ -70,17 +71,17 @@ The approximate runtime of each task call required for the
entire sieve calculation of $100$ prime numbers is approximately $5\text{ms}$.

A debug port, in this case `portd.3` is toggled high and low
just prior to and after the call of the prime sieve cacle task.
A straightofrward digital oscilloscope measurement provides
just prior to and after the call of the prime sieve cycle task.
A straightforward digital oscilloscope measurement provides
a timing indication for the runtime of the prime sieve cycle task.

A running hardware setup is shown in the picture below.

![](./images/board03_02.jpg)
![running hardware setup](./images/board03_02.jpg)

The runtime of the prime sieve cycle task is depicted below.

![](./images/scope03_02.jpg)
![runtime curve on oscilloscope](./images/scope03_02.jpg)

## A PC-Based example

Expand Down Expand Up @@ -124,7 +125,7 @@ at this numerical point?

Consider the following input.

```
```text
N[(LogIntegral[10006721] - LogIntegral[2])/664999, 20]
```

Expand Down
5 changes: 3 additions & 2 deletions examples/chapter04_04/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example Chapter04_04

## LED Objects and Polymorphism

Example chapter04_04 uses an intuitive LED class hierarchy
Expand Down Expand Up @@ -109,7 +110,7 @@ as shown in the following table.
| LED4 | port expander pin `GPA2` | port toggle high/low, SPI software drive, $750~\Omega$ |

In this example, we use ports from both the microcontroller as well
as an external port expander chip. Hardware adressing is used
as an external port expander chip. Hardware addressing is used
on the port expander chip. The port expander address is
hard-wired to the value 7 via connecting each of the three
pins `A0` ... `A2` to $+{5}~\text{V}$.
Expand All @@ -134,4 +135,4 @@ The connections of the port expander chip are tabulated below.

The hardware setup is pictured in the image below.

![](./images/board4.jpg)
![hardware setup](./images/board4.jpg)
1 change: 1 addition & 0 deletions examples/chapter04_04a/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example Chapter04_04a

## LED Objects and Polymorphism via References

Example chapter04_04a implements the same basic functionality
Expand Down
10 changes: 5 additions & 5 deletions examples/chapter06_01/readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Example Chapter06_01

## A CRC Benchmark

<p align="center">
<a href="https://godbolt.org/z/ssTK8TjWj" alt="godbolt">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" /></a>
<a href="https://godbolt.org/z/ssTK8TjWj">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt" /></a>
</p>

Example chapter06_01 illustrates certain optimization
Expand Down Expand Up @@ -73,8 +74,7 @@ std::uint32_t crc32_mpeg2(input_iterator first,
## Application Description

One of the standard tests of a CRC is to compute the checksum
of the digits
<img src="https://render.githubusercontent.com/render/math?math=1{\ldots}9">.
of the digits $1 \ldots 9$.
Please note here that the digits are not decimal values.
They are the ASCII representations instead. In other words,
the standard CRC test computes the checksum of a byte array such as
Expand All @@ -101,7 +101,7 @@ of the the expected result.
The benchmark port pin `portd.3` is toggled high
prior to the CRC calculation and low following the calculation.
This provides a time pulse that can easily be measured
on the oscilloscpoe. For the 8-bit target, expect
on the oscilloscope. For the 8-bit target, expect
a CRC runtime of approximately $300~{\mu}\text{s}$.

The benchmark port definition can be located in the file
Expand Down
5 changes: 3 additions & 2 deletions examples/chapter06_14/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example Chapter06_14

## A CRC Benchmark with ROM-based Table and Data

Example chapter06_14 has essentially the same functionality
Expand Down Expand Up @@ -39,13 +40,13 @@ The partial image of a memory map file from example chapter06_14 for
the 8-bit target shows us that the data objects mentioned above have,
in fact, been _ROM_'ed.

![](./images/romdata.jpg)
![snippet from map file](./images/romdata.jpg)

The objects in the map-snippet above are in ROM.

## Application Description

The same standard CRC checksum and verification
is carried out in the `app::benchmark::task_func`
function. Slight sylistic differences between the algorithms in
function. Slight stylistic differences between the algorithms in
example06_01 and example06_14 reflect no functional change.
Loading