STM32G474CEU6 USB Multitool.
----------------------------
o Digital scope, Logic Analyser, waveform generator,
PWM generator and DDS Sqearwave generator.
o Easy build
- Low component count
All analog and digital parts contained in MCU
- Buildt on Veroboard, no etching and drilling
BOM
---
MCU:
1 x STM32G474CEU6 long board from WeAct studio
https://www.aliexpress.com/item/1005009527083176.html
Resistors:
1 x 470K
1 x 330K
2 x 100K
1 x 100R
Capacitors:
1 x 1uF
1 x 100nF
1 x 47pF
1 x 40pF trimmer
Reed relay:
1 x SIP05
PCB:
1 x Veroboard
Connectors:
2 x 24 pin female headers
1 x BNC connector (optional)
2 x RCA connectors (optional 4 pin male header)
1 x 6 pin male header
Cost:
To reduce cost you can use a 4 pin male header for
the HS Clock and Wave generator. You can also create
your own scope probe using a ballpoint or felt tip pen
housing, a 330 ohm resistor and a tv antenna cable.
Then you dont need any connector for the probe.
See Probe.jpg
Build
-----
See: PCB.pdf or Schma.cad if you are using RadSTM32
1. Cut the Veroboard to size
2. Solder the two 24 pin headers
Bend the pins before soldering. This makes
it easier to solder. Solder only the named pins.
3. Cut all the tracks that needs to be cut. Be
careful to cut the right tracks at the right
positions.
4. Solder all the jumper wires.
5. Solder the resistors, capacitors, reed relay
and connection wires. The scope wire should be
a shielded wire.
6. Inspect and test for solder bridges and bad
soldering.
7. Program the MCU with the G474_USB_Scope.bin file.
8. Insert the MCU and test. Note that the scope ground
wire has the vertical position voltage. Do not
connect it to ground. Doing so will not do any harm
but the scope will not work properly.
Adjusting the trimmer capacitor
-------------------------------
1. Connect the HS Clock output to the Scope input
Do not connect the ground wire.
2. Set the HS Clock to 1 KHz, 50% duty cycle.
3. Set the scope to 500mV and 5uS. Leave all the others
to their default value.
4. Adjust the trimmer until you get a nice 3.3V squear wave.
Software error corrections
--------------------------
The Scope.h file has two valuses that might need to
be changed. The values can be positive or negative.
SCPVPOSERR: Correct the scope vertical position.
SCPTPOSERR: Correct the scope trigger position.
Specifications
--------------
Scope:
o Sensivity
- 50mV to 2V / Div in 1 2 5 steps
o Coupling
- AC and DC
o Probe
- X1 and X10 with a probe
- X1 with a DIY probe
o Timebase
- 25ns to 500ms in 1 2.5 5 steps
o Horizontal position
- -50 to +50 pixels
- Pre trigger
o Vertical position
- +/- 8V
o Trigger position
- +/- 8V
o Trigger hysteresis
- 0 to 70mV in 10mV steps
o Trigger filter
- 16 filter positions
o Trigger edge
- Rising, falling or none
o Hold
- Frezes the captured wave
o Single shot
- Can only be uset in normal mode
- 5K buffer
- Useful when capturing non repetitive waves
or when a stedy trigger cannot be obtained
o Modes
- Sliding wave mode
250ms and 500ms / Div
- Normal mode
5us to 100ms / Div
- Fast mode
25ns to 2.5us / Div
Minimum input frequency 100KHz
Maximum input frequency 10MHz
Worst case sampling rate 60MHz
Best case sampling rate 400MHz
Logic Analyser:
- Channels: 4 bits
- Trigger: High, Low or don't care on each bit.
- Sample size: 64, 128, 256, 512, 1K, 2K, 4K and 8K.
- Sample rate: 1Hz, 10Hz, 100Hz, 1KHz, 10KHz,
100KHz, 1MHz, 2MHz, 4MHz and 8MHz
- Search next or previous trigger
HS Clock:
o Frequency
- 1Hz to 24MHz
- Resolution
Any frequency that can be obtained
by dividing the 120 MHz clock
o Duty cycle
0 to 100%
Waveform generator:
o Waveforms
- Off, sine, triangle, squear, sawtooth,
reverse sawtooth and DC Out
o Frequency
- 1Hz to 20KHz in 1 2 5 steps
o Amplitude 1st harmonic
- 0 to 100% (max 3.3V)
o Amplitude 2nd harmonic
- 0 to 100% (max 3.3V)
DDS squear wave generator with sweep
- 3.3Vpp output
- 1 Hz to 999999 Hz
- Resolution: 1 Hz
- Sweep: 1% to 50% in 1, 2, 5 steps
- Sweep time: 1s to 50s in 1, 2, 5 steps
- Sample rate 13.333 MHz
NOTE:
Done in software. Stops when you leave the function.
Conclusion:
Great tool for the hobbyist and those learning
about electrinics and microcontrollers.
This cheap and easy build has limitations on
the scoppe due to noise on the 100mV and 50mV
ranges. Most of the noise comes from the scope
trigger (COMP2). If the noise causes problems,
move the trigger position out of the way and
use single shot or the hold function to capture
the wave (normal mode only).
KetilO