Skip to content

Week06: Electronics Design

group assignment

use the test equipment in your lab to observe the operation of a microcontroller circuit board

This article was written by Shintaro Ito.

01. Oscilloscope settings.

  • oscilloscope Information
Item Details
Manufacturer Tektronix
Series TBS1000B
Model TBS1202B (200MHz), TBS1152B (150MHz), TBS1102B (100MHz), TBS1072B (70MHz), TBS1052B (50MHz), TBS1032B (30MHz)
Frequency Band 200MHz, 150MHz, 100MHz, 70MHz, 50MHz, 30MHz (30MHz model is limited to North America and Europe)
Number of Input Channels 2
Maximum Sample Rate 2GS/s on all channels
Record Length 2.5k points on all channels
Trigger Function Advanced triggers (pulse trigger, selectable line video trigger, etc.)
Display 7-inch (17.78 cm) WVGA (800×480) Active TFT Color Display
Automatic Measurement Items 34 types
FFT Function Dual-window FFT (simultaneous display of time domain and frequency domain)
USB Port USB host port on the front panel, USB device port on the rear panel
Other Features Limit Test, Data Logging, Frequency Counter, TrendPlot™, Context-sensitive Help Menu

manual Japanese

manual English

02. Probe Compensation

Compensation is performed first because noise may be present in the probe.

Procedure

  1. connect the probe to the equipment.
  2. You need to rotate it when connecting.
  3. The terminal comes out by pulling the probe.

Steps 2, 3, and 4 are described in the image.

A: Main signal terminal: Voltage signal flows here.

B: GND terminal: Terminal for grounding.

  1. Connect A: Main signal terminal on top of the probe compensation, and B: GND terminal below.
  2. C: By pressing Autoset, a rectangle for compensation appears and is compensated. Fine adjustments are possible with the compensation driver.

![](https://t25532679.p.clickup-attachme

03. Check the signal emitted from the microcontroller with an oscilloscope.

Microcontroller and Environment Used This Time

  • Xiao rp2040
  • macbook air M1

Procedure

  1. Prepare an IDE “Thonny” that has the function of writing Python to MicroPython.

    1. You can download it from here.

      https://thonny.org/

  2. Connect Xiao rp2040 to the PC with TypeC while pressing the boot load button. Then you can connect to the PC in boot load mode.

  3. To convert XIAO RP2040 to Micro Python, you need to update to Micro Python firmware. It seems that the firmware for Raspberry Pi Pico can be used, so download and use it. You can download and write it from the following site.

    https://micropython.org/download/RPI_PICO/

  4. To write the downloaded firmware to Xiao rp2040, you can use either the file manager or the terminal command. I moved it with the mv command because the file manager was malfunctioning. The command is mv ./ ~/Volums/NO NAMME/.

    Warning

    The file path is different depending on each environment, so this command cannot be used as is.

  5. After writing, have Thonny, the IDE, recognize Xiao rp2040. To make it recognize, move to the interpreter tab from Tools > option, and set as follows:

    • Device: MicroPython (Raspberry Pi Pico)
    • Port: Serial port of XIAO RP2040

    Warning

    The serial port differs depending on each environment, so select the port for your environment.

  6. Write the code

    • This time’s code
      main.py
      from machine import Pin, PWM
      import time
      # Output pin (GPIO of RP2040)
      PWM_PIN = 7
      # PWM initialization
      pwm = PWM(Pin(PWM_PIN))
      pwm.freq(50000)         # Set PWM frequency to 50kHz
      pwm.duty_u16(32768)     # 50% duty with 16bit value (range of 0 to 65535)
      while True:
          time.sleep(1)       # Maintain PWM signal in an infinite loop
      
    • To write, save as main.py, then right-click the target from the file list on the left and select write.
  7. After writing, the signal should be outputting. Connect the probe and check the signal. At this time, the output pin needs to be re-read between Xiao rp2040 and Raspberry Pi pico.
  8. The re-reading is as shown in the table below.

  9. Connect the probe to GND of Xiao rp2040 and pin 7 set in the code (5pin in xiao rp2040 by re-reading).

    A: Main signal terminal: Voltage signal flows here.

    B: GND terminal: Terminal for grounding.

  10. make a measurement with an oscilloscope. The information on the measurement screen is as follows .

    1. Average voltage: 1.68V
    2. Voltage offset: 2V
    3. Time Base (time scale): 10.0µs/div
    4. Ch1 (Channel 1 setting): 100mV/div Sampling Rate: 50.0006kHz
    5. Peak-Peak voltage: 6.80V

Week 05 Group Work Completed. And on to the Individual Assignment…

Each person’s URL is listed