Skip to content

Commit c6fa46e

Browse files
committed
Docs and syntax
1 parent 049fe1e commit c6fa46e

3 files changed

Lines changed: 34 additions & 7 deletions

File tree

examples/chapter11_07a/readme.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ of digits of the mathematical constant $\pi$.
1616
The spigot-type calculation that was introduced in earlier
1717
examples is used.
1818

19-
The calculation requires significant RAM,
19+
The calculations requires considerable amounts of RAM,
2020
much more than is available on our target system with the $8$--bit microcontroller.
2121
For this purpose, a $4~\text{MByte}$ external serial SRAM is used.
2222
This simplifies the breadboard wiring significantly
@@ -29,10 +29,36 @@ An industry-standard display reports the
2929
progress of the running calculation and the number of
3030
completed computations in the current power-on cycle.
3131

32-
3332
## Hardware Setup
3433

35-
TODO: The pin connections
34+
An ARDUINO(R) board is used predominantly out-of-the-box,
35+
but it has been adapted with manually soldered-on pins allowing
36+
it to be fitted to the breadboard. The level-shifting is carried out with
37+
an industry-standard level shifter. The $4~\text{MByte}$ serial SRAM
38+
is controlled via an all-software SPI channel.
39+
The LCD display is controlled by a separate independent
40+
all-software SPI channel.
41+
42+
The pin most important pin connections are shown in the tables below.
43+
44+
### SRAM Connections
45+
46+
| SRAM Pin | Function | ARDUINO(R) Connection |
47+
| --------------- | ---------- | ----------------------- |
48+
| 1 | CSN | portd.7 |
49+
| 2 | MISO | portd.6 |
50+
| 6 | SCK | portd.5 |
51+
| 5 | MOSI | portd.4 |
52+
53+
54+
### LCD Connections
55+
56+
| LCD | ARDUINO(R) Connection |
57+
| ---------- | ----------------------- |
58+
| CSN | portb.2 |
59+
| SDI | portd.1 |
60+
| SCK | portd.0 |
61+
3662

3763
TODO: The hardware setup with the $4~\text{MByte}$ serial SRAM
3864
is pictured in the image below.

examples/chapter11_07a/src/app/pi_calc_cfg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#ifndef PI_CALC_CFG_2023_05_09_H
99
#define PI_CALC_CFG_2023_05_09_H
1010

11+
// In this embedded software adaptation of this work,
12+
// we limit the decimal digit count to about 100k or fewer.
13+
1114
#define PI_CRUNCH_METAL_PI_SPIGOT_USE_100_DIGITS 100
1215
#define PI_CRUNCH_METAL_PI_SPIGOT_USE_1K_DIGITS 1000
1316
#define PI_CRUNCH_METAL_PI_SPIGOT_USE_10K_DIGITS 10000

examples/chapter11_07a/src/mcal/avr/mcal_spi_types.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define MCAL_SPI_TYPES_2024_12_07_H
1010

1111
#include <mcal_port.h>
12+
#include <mcal_port_pin_dummy.h>
1213
#include <mcal_reg.h>
1314
#include <mcal_spi/mcal_spi_software_port_driver.h>
1415

@@ -57,10 +58,7 @@
5758
mcal::reg::portb,
5859
static_cast<std::uint32_t>(UINT32_C(2))>;
5960

60-
using port_pin_lcd_sdo_type = mcal::port::port_pin<std::uint32_t,
61-
std::uint32_t,
62-
mcal::reg::portb,
63-
static_cast<std::uint32_t>(UINT32_C(4))>;
61+
using port_pin_lcd_sdo_type = mcal::port::port_pin_dummy;
6462

6563
using port_pin_lcd_sdi_type = mcal::port::port_pin<std::uint32_t,
6664
std::uint32_t,

0 commit comments

Comments
 (0)