Skip to content

Week 4 Overview

This week, we will program different types of micro-controllers.

  • We will program a rp2040 in C++ and Micropython.
  • We will also learn about bare metal programming.
  • After doing the tutorials, we will design something original with the rp2040.
  • And finally, we will compare and contrast programming with a rp2040, Arduino UNO R3, and ATtiny 412.
  • The group project will involve researching different micro-controllers and writing a detailed page on their uses and implementations.

Notes from Dr. Gershenfield’s lecture

  • C11 microcontroller.
  • SRAM (fast).
  • DRAM (slower but larger).
  • Flash (bigger memory but harder to program, for program storage).
  • Fuse: memory storage.
  • 7 Different types of processors within a 1 dollar microcontroller.

  • Peripherals, different pins/ports.

  • Any computing device or equipment that is part of the computer but doesn’t perform any core computing process
  • A/D, reads voltage and gives a number.
  • Comparator: compares b/w 2 different voltages.
  • D/A number → voltage.
  • Modules measure time.
  • Pulse switch modulation varies the length of the pulse.
  • Use cases:

    • UART: to send messages to peripherals in and out.
    • USB.
  • Word size: how many bits it operates on.

  • Common = 32.
  • Inverted device: 0 and 1 switch.
  • Rp2040:
  • Implementation.
  • 32 bit processor.
  • Much faster than other ones.
  • 250Mz overclocked.
  • Can do simple artificial intelligence.
  • Very powerful peripherals.
  • Re-configurable.
  • Write little programs and write customizable peripherals.
  • Useful for machine learning applications.
  • Pi pico, a fast, versatile board with rasperberry pi capabilites.
  • GCC is the compiler that we use.
  • Ask ChatGPT to explain the code.

  • Better programming? → have to write tight efficient code.

  • Boards

    • Samdees
    • Esp32
    • Rp24
    • Bare metal programming
    • Bootloader has microcontroller retrieve instructions.
    • Each pin has 3 registers
  • Bits and bytes, 1 byte is 8 bits for an arduino. Binary and decimal systems

  • Port register
  • Blinking built in led example:

    • pinMode(9, Output)
  • PortB=2;

  • Delay
  • DDRD = 16
  • Pointers: A pointer in c is a variable that points to the memory location of another variable memory address.

  • ((volatile byte 0x25) = 32;

  • Bit shifting: You can just move the numbers somehow. Add zeros to the right

Last update: December 27, 2023