Skip to content
Libre Computer

ECE 210

Modern Computer: Von Neumann

This section uses Das Frite. The labs are a Von Neumann computer: a program in memory, a processor that runs it, and I/O on the header. The course stops before the boot ROM, device-tree source, and kernel drivers. It does not replace ECE 200 Digital Logic.

Each week has two lecture hours, a two-hour lab, and four homework hours. Week 3 has no Monday lecture, so that week has one lecture hour. The lab that week stays two hours.

In class is the lecture. The lab and the homework under it are different hand-ins. Read the module the week names, and stop where the week says to stop. Pin numbers and nominal voltages are on the station sheet. These notes do not print a second pin list.

All four courses. Modules and labs: education.libre.computer.

Week 1

In class

Name the board, the supply, the boot media, and the header. On this section the boot media is a USB drive. The supply is the station's USB Type-C supply. The header is the pin field the station sheet draws. Point at each one before you write anything.

A SHA-256 check answers one question: the bytes on the drive are the bytes the course published. Compute the checksum and compare it with the published value before you boot. The serial adapter sits where the station sheet draws it. Stop before any boot stage. Do not mark stages on the log.

On the lab site: Module 0, First boot, is the flash and the login. Stop before annotating boot stages.

Lab

  1. Write the term image with the desktop imager. Compare its SHA-256 with the published value before you boot.
  2. Connect the 3.3 V serial adapter on the pins the station sheet names. Log in on the console, then again over SSH. Name the board, the supply, the boot media, and the header. Second pass: compute the checksum of the spare drive and leave that drive unbooted.
  3. Assemble the lab hand-in: The checksum you compared, a photo of the serial wiring, and a screenshot of the console login and the SSH login.

Hand in: The checksum you compared, a photo of the serial wiring, and a screenshot of the console login and the SSH login.

Homework

From the station sheet, write what each of the four replaceable parts is, and which one a student can swap without opening the board. Turn in: A four-line glossary of the board, the supply, the boot media, and the header.

Week 2

In class

Make a directory, edit a file in the shell, redirect output, and read a process id. First make the directory and show that the shell can list it. Next write a short program into a file in that directory and run it. The run is a process, and the process id is how you point at that run.

Redirecting output sends the program's prints into a file. Run it a second time into a second filename so you can see that the first file stayed. The program in the file is the program in memory for this week. The processor is what runs it.

On the lab site: Module 0, First boot, names the shell. This week grades the script, the file it wrote, and the process listing.

Lab

  1. In the shell, make a course directory, edit a file, run it, and find its process id.
  2. Redirect the program's output to a file and copy that file to the bench PC. Second pass: run it again into a second filename.
  3. Assemble the lab hand-in: The script, the file it wrote, and the process listing that shows it ran.

Hand in: The script, the file it wrote, and the process listing that shows it ran.

Homework

Write three shell commands that show a file's size, a directory listing, and one running process, and run them without using the week-2 script. Turn in: The three commands and one line of output from each.

Week 3

In class

No Monday lecture. One lecture hour remains: where the meter leads go on the supply and on one 3.3 V rail, and why a higher voltage must not touch a header pin. Stop before the boot ROM.

Put the leads on the supply first, on the points the station sheet marks, and read the nominal voltage from the sheet before you measure. Then move the leads to one 3.3 V rail the sheet names. A higher voltage on a header pin is the failure the sheet warns about. Copy that warning before you measure.

On the lab site: Module 2, First power-on and voltage rails. Stop before Module 3.

Lab

  1. No Monday lecture. Measure the station supply and one 3.3 V rail with the bench meter.
  2. Write one sentence on what a 5 V signal would do to a header pin. Stop before the boot ROM. Second pass: measure that same rail again and keep both readings.
  3. Assemble the lab hand-in: A two-row meter table (the supply and one 3.3 V rail: nominal and measured) and one sentence on why 5 V must not touch a header pin.

Hand in: A two-row meter table (the supply and one 3.3 V rail: nominal and measured) and one sentence on why 5 V must not touch a header pin.

Homework

Before you measure, copy the station sheet's nominal supply voltage, its nominal header voltage, and its warning about a higher voltage on a header pin. Turn in: Those two nominal voltages and the warning sentence from the sheet.

Week 4

In class

Open the Python GPIO library on the image and read the station sheet's pin list. The image already has the library. The sheet is the only pin list you use. Light one LED and read one button on pins the sheet lists. A device-tree edit is outside this course.

This is the I/O on the header: the program from week 2 now reaches a pin. An overlay and a kernel driver are later courses. Do not edit a device tree.

On the lab site: Module 9, Device tree and pin multiplexing, and Module 10, I/O, reach GPIO through an overlay. This week is the Python file and the pin numbers. Stop before an overlay and before a driver.

Lab

  1. Using the Python GPIO library on the image, and only the pins the station sheet lists, light one LED and read one button.
  2. Do not edit a device tree. Second pass: light the LED from a second listed pin, then move the wire back.
  3. Assemble the lab hand-in: The Python file and the pin numbers used for the LED and the button.

Hand in: The Python file and the pin numbers used for the LED and the button.

Homework

Draw the LED path and the button path from the station sheet, including the resistor, and do not write the Python program. Turn in: The drawing and the resistor value printed on the sheet.

Week 5

In class

Read a button's contact type on a datasheet and say what a debounce interval changes. The contact type is what the switch does electrically when you press it. The part number is the one printed on that datasheet. Copy it from the sheet in front of you.

A debounce interval is how long the program waits before it will count another press. A longer interval ignores a bounce. A shorter interval can count one press more than once. You choose an interval, press the button 20 times, and record the count the program reports.

On the lab site: the modules do not grade a part number, a debounce interval, and a 20-press count. This week does.

Lab

  1. Read the button datasheet for the contact type.
  2. Debounce the button in the week-4 program. Press it 20 times and record how many presses the program counts. Second pass: press it 10 more times and set that count beside the first.
  3. Assemble the lab hand-in: The datasheet part number, the debounce interval you chose, and the count from 20 presses.

Hand in: The datasheet part number, the debounce interval you chose, and the count from 20 presses.

Homework

If presses were spaced exactly one debounce interval apart, compute how long 20 presses would take. Turn in: The interval you assumed and the product, with the unit.

Week 6

In class

Find an I2C address and one register on the sensor datasheet. The address is how the controller names this sensor on a shared bus. The register is one location inside the sensor. Both numbers are on the datasheet, and the page number comes with them. The image already enables the bus. No device-tree edit.

The read is one Python call: address, register, value. Read it a second time and keep both values. The supply range on the datasheet is the homework, on a page you do not use for the register read.

On the lab site: Module 10, I/O, decodes a bus on an analyser. This week is one Python read. Stop before the analyser capture.

Lab

  1. On the I2C bus the image already enables, read one register from the station sensor in Python.
  2. Take the address and the register number from that sensor's datasheet. Do not edit a device tree. Second pass: read that register once more and keep both values.
  3. Assemble the lab hand-in: The I2C address, the register number, the value you read, and the datasheet page you used.

Hand in: The I2C address, the register number, the value you read, and the datasheet page you used.

Homework

Copy the sensor's supply range from its datasheet onto a page you will not use for the register read. Turn in: The supply range and the datasheet page that states it.

Week 7

In class

Show a user service, a timer, and a reboot that starts a program with no one at the keyboard. A user service is a unit file that starts a program as that user. A timer starts it again on a period. The test is a reboot: after the board comes back, the program has run, and nobody typed the command.

The period you write on paper for the homework is one reading per minute, in the unit a service file would use. The lab is the service file itself and one log line from a reboot you did not start by hand.

On the lab site: Module 8, Linux boots, explains init. This week grades the service file and that log line.

Lab

  1. Make the week-6 program start when the board boots, as a user service, and append one reading on a timer.
  2. Reboot and do not start the program by hand. Second pass: reboot once more and keep the second log line in your notes.
  3. Assemble the lab hand-in: The service file and one log line from a reboot you did not start by hand.

Hand in: The service file and one log line from a reboot you did not start by hand.

Homework

Choose a timer period of one reading per minute and write it in the unit a service file would use, on paper, not in the service file. Turn in: The period and the unit.

Week 8

In class

Show the station's spare media and what a wire on the wrong header pin fails to do. On this section the spare is a USB drive. Before you boot the bad drive, copy the spare's label and the shelf where it is kept. That copy is the homework.

Boot the drive the TA marked bad, swap in the spare, and log in. Move the LED wire to a pin the sheet does not list, watch the miss, and put the wire back on the listed pin. The four-line note is what failed, which spare you swapped in, how you knew the login was back, and that the wire is on the sheet's pin again.

On the lab site: Module 12, A whole system, discusses recovery. This week is the spare-drive swap and the restored wire. Stop before a product runbook.

Lab

  1. Boot the media the TA marked bad.
  2. Swap in the station's spare media and log in. Move the LED wire to a pin the sheet does not list, observe the miss, and put the wire back. Second pass: move the wire off the listed pin once more, restore it, and name the pin.
  3. Assemble the lab hand-in: A four-line note: what failed, which spare media you swapped in, how you knew the login was back, and that the LED wire is on the sheet's pin again.

Hand in: A four-line note: what failed, which spare media you swapped in, how you knew the login was back, and that the LED wire is on the sheet's pin again.

Homework

From the station sheet, copy the spare-media label and the shelf where it is kept, before you boot the bad drive. Turn in: The label and the shelf.

Week 9

In class

Show a logger that appends one line per reading, and what a classmate needs written down to run it. Append means a new reading is added. It does not erase the line before it. The README is what a classmate follows to find the file, start the service, and read a line, without asking you.

The five homework steps are how that classmate finds the readings file after a reboot. Do not paste the program into the homework. No device tree. No driver.

On the lab site: Module 12, A whole system, is a full product. This week is the logger and that README. Stop before a device tree and a driver.

Lab

  1. Turn the sensor program and the service into a logger that appends readings to a file.
  2. Write a one-page README a classmate can follow. Second pass: append one more reading and keep both lines.
  3. Assemble the lab hand-in: The logger program, a sample of the file it appends, and a one-page README a classmate can follow to run it.

Hand in: The logger program, a sample of the file it appends, and a one-page README a classmate can follow to run it.

Homework

Write five steps a classmate uses to find the readings file after a reboot, and do not paste the program. Turn in: Those five steps.

Week 10

In class

Walk the cold-boot demo order and which lines of the week-9 notes a student may still fix. The order is a cold boot, then the logger, then one question about your own pin choice or debounce interval. Write two questions a partner might ask, and your answers, before the demo. That writing is the homework.

After the demo, change only the lines of the week-9 README that the demo showed were wrong. Leave the rest of the page as it was.

On the lab site: the modules have no demo hand-in. This week grades the cold-boot demo.

Lab

  1. Demonstrate the logger from a cold boot.
  2. Each partner answers one question about their own pin choice or debounce interval. Second pass: cold-boot again and answer the same question a second time.
  3. Assemble the lab hand-in: The cold-boot demo, and the week-9 README with only the fixes the demo found.

Hand in: The cold-boot demo, and the week-9 README with only the fixes the demo found.

Homework

Write two questions a partner might ask about your pin choice, and your answers, before the demo. Turn in: The two questions and the two answers.