Skip to content

Week 6 Group Assignments -

Group assignment:

Use the test equipment in your lab to observe the operation of a microcontroller circuit board (as a minimum, you should demonstrate the use of a multimeter and oscilloscope)

Multimeter

We started by characterizing the XIAO with a multimeter.

Power Rail Measurement

We hooked up alligator clips with breadboard pins on the end into the 5V and GND pins of the XIAO. Then, we clipped the alligator side of the leads to the leads on the scope which were hooked up to Vin and GND. We could measure easily approximately 5V coming from the board. We then switched the Vin lead to the 3V3 pin on the XIAO to confirm 3.3V on that pin.

Multimeter setup.

Variable Voltage Measurement

Then we decided to see if we could measure a variable signal from one of the pins. We created an Arduino program to increase the voltage on one of the analog pins from 0 to 3.3V and to blink an LED every second on a digital pin.

xiao_voltmeter_test.ino
const int led=7;
const int pulse=2;

void setup() {

pinMode(led,OUTPUT);
pinMode (pulse, OUTPUT);

analogWrite(pulse, 128);

}

void loop() {
  for (int i = 0; i <= 255; i++) {
        analogWrite(pulse, i);
        delay(10);
      }

  // put your main code here, to run repeatedly:
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}
We uploaded this code to the XIAO and hooked the leads of the mulimeter to pin A0 on the board. As the program was running we could see the voltage increase from 0 to 3.3V in about 2 seconds. Then it would hold at 3.3V until the blink function was complete and then cycle through again.

Then we moved the positive lead of the voltmeter to D5 of the XIAO. We could see on the meter that the Volage was at 0 while the LED was off and jumped to 3.3V when the LED was on.

Analog reading with multimeter.

Oscilloscope

We used our Siglent SDS 1202X-E scope to evaluate the performance of the XIAOESP32C3. As a reference, we followed along with this YouTube video from AddOhms which provided a great step by step guide to measuring an Arduino.

Voltage Rail

We started by measuring the voltage rail of the XIAO. We put jumper wire leads on the GND and 3.3V rails. We hooked up the leads to channel 1 and turned on the XIAO. We were able to see a straight horizontal line at 3.3V. We adjusted the Volts/div and saw how zooming in we lost sight of the trace, but were able to get it back by adjusting the vertical offset knob.

Oscilloscope setup.

Next we wanted to see the noise on the power rail. We changed the channel settings to have the coupling to AC. This took away the DC component and settled the signal around zero. From this were able to see that with the grid lines showing that the noise was about 100mV on the high side and -100mV on the low side for a total of 200mV. Then we tested the measure function. We presed the measure button and seleced the ‘Max’ and the ‘Peak to Peak’ options. Back on the screen the scope displayed the the max was about 124mV and the P2P wasabout 244mV.

Noise readings.

Signal Measurement

We wanted to use the scope to test the output from pins that were varying in output. So we wrote a quick program to pulse and LED with a digital write and an analog pin with PWM output.

xiao_scope_test.ino
const int led=7;
const int pulse=2;

void setup() {

pinMode(led,OUTPUT);
pinMode (pulse, OUTPUT);

analogWrite(pulse, 128);

}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Digital Output

We hooked up the scope to D5 (GPIO7) on the XIAO and reset the view on our scope. We also changed the display to a rolling output to see the live view. The program blinks the LED on and off every second and we were indeed able to see this on the waveform on the scope. We also added frequency to the measurement window which read about 500mHz (.5Hz) which is equavalent to the programmed cycle time of 2 seconds (1 second high, one second low).

Reading digital output wave from the LED pin.

Analog Output

We then hooked up the scope to A0 (GPIO2) to look at the PWM signal. We also added a duty cycle measurement type to our window.

When we first looked at the screen, it was a messy wall, as the signal is varying much more quickly than the digital signal above. We adjusted our horizontal divisions to zoom in until we were able to see a stable square wave form.

From our measurements we can see that the cycle is running at 1kHz and that the duty cycle is 50% which matches the code.

Reading analog output PWM from pin A0.