Spark Logic

$10 O-Scope revisited

Over the last few days I’ve been playing with Ray’s STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery Oscilloscope idea.

Image

Some preliminary results are available here..

https://github.com/pingumacpenguin/STM3 … ontruction

My take on the Scope Sketch is here..

https://github.com/pingumacpenguin/STM32-O-Scope

Its a fun little project and well worth building just for the entertainment value. Currently bandwidth is a little limited, but with a little extra effort it would be possible to make a fully functional 2MHz Scope for next to nothing. Ideal for probing i2c, audio and other low speed signals.

EDIT: We managed to squeeze the maximum speed out of the ADC, read further through the thread for details. The github code includes all of the enhancements made of the course of this thread.

Replies20

Thu Feb 23, 2017 9:00 am

I see, PB9 on Mapple-type boards is used to “USB enable” switching. So, I guess, resistor on board can be found where to solder. Anyway, but, how about you 3 “main developers” for this moment :), come together and agree on unified connections? :) Then we will have “hardware platform” with easily exchangable software. I think Rexnanet has a good point of his version of TFT wires, to have that as a basis, probably is possible to agree on encoder inputs, generator (optional) control pins, amplification (for MPC) control pins?

Thu Feb 23, 2017 9:37 am

ThunderOwl wrote:I see, PB9 on Mapple-type boards is used to “USB enable” switching. So, I guess, resistor on board can be found where to solder. Anyway, but, how about you 3 “main developers” for this moment :), come together and agree on unified connections? :) Then we will have “hardware platform” with easily exchangable software. I think Rexnanet has a good point of his version of TFT wires, to have that as a basis, probably is possible to agree on encoder inputs, generator (optional) control pins, amplification (for MPC) control pins?

Thu Feb 23, 2017 9:56 am

Rexnanet, ThunderOwl,

it’s possible to change the Landscape -format to Portrait,
than we could display the Signal with full 8 bit resolution (256) in the high and had place for scope-settings (delay, trigger, …) in a own in the 84 x 240 field on the top or on the ground ?

Thu Feb 23, 2017 1:34 pm

mausi_mick wrote:Rexnanet, ThunderOwl,

it’s possible to change the Landscape -format to Portrait,
than we could display the Signal with full 8 bit resolution (256) in the high and had place for scope-settings (delay, trigger, …) in a own in the 84 x 240 field on the top or on the ground ?

Thu Feb 23, 2017 3:01 pm

Rexnanet,

I think with the 8 bit it’s difficult too, because the MCP6.. has only 1% accuracy and you have to select other components to better than 0,5 %.

And I think better than 7bit it’s for hobbyist enough . :lol:

Fri Feb 24, 2017 9:50 am

This pin issue can be solved by creating an #ifdef BLUEPILL_BOARD and #ifdef MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal _BOARD and place all pin assignments inside each of those defines.

This way we can simply set the variable we want and that’s it :)

What do you think?

Fri Feb 24, 2017 10:05 am

mausi_mick wrote: MCP6.. has only 1% accuracy

Fri Feb 24, 2017 10:10 am

rexnanet wrote:This pin issue can be solved by creating an #ifdef BLUEPILL_BOARD and #ifdef MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal _BOARD and place all pin assignments inside each of those defines

Fri Feb 24, 2017 11:38 am

ThunderOwl wrote:
That sounds smart to me. What others say? :) (who actually understand coding, unlike me :D okay, i understand just a little bit… :) )

Fri Feb 24, 2017 1:22 pm

the noise, yes, by small signals.

but I think a Scope is more for the signal form etc, not for the accuracy ( if the amplitude is 2.5V or 2.516 V) .

Sat Feb 25, 2017 3:42 pm

mausi_mick wrote:the noise, yes, by small signals.

but I think a Scope is more for the signal form etc, not for the accuracy ( if the amplitude is 2.5V or 2.516 V) .

Sun Feb 26, 2017 5:29 pm

I intended to replace the stock firmware on DSO-138 oscope which is based on STM32F103STM32F103Микроконтроллеры и процессоры…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…[SOLVED] generic blue pill clone as USB keyboard with analog front end. Did some work over the holidays, but finally got the chance to clean it up and publish. Key areas for improvement were – get the waveform data from serial port and add a second channel (digital and analog)

My original development was on Bluepill, so the codebase can be adapted to work with generic F103 boards.

I will start another thread for that.

pic2.png
pic2.png (164.74 KiB) Viewed 1752 times

Sun Feb 26, 2017 6:18 pm

Very interesting, willfly1 !

Mon Feb 27, 2017 9:16 am

willfly1 wrote:
My original development was on Bluepill, so the codebase can be adapted to work with generic F103 boards.

I will start another thread for that.

Mon Feb 27, 2017 9:57 am

super !
and the SW is very good structured !

I tried to change it to Maple MiniMaple MiniОтладочные и вычислительные платы…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…Underclocking STM32F103 to 48MHz and to the SPI-TFT-Display ILI9341ILI9341Дисплеи, сенсорные панели и светодиоды… shows on my screen. I have used and programmed a few different types of SPI screens( ili9341 , st7735) using Python very successfully and these parallel screens have many of the…[SOLVED] FSMC LCD on STM32F407VET :

STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery -O-Scope_DSO-138.JPG
STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery -O-Scope_DSO-138.JPG (51.33 KiB) Viewed 1713 times

Mon Feb 27, 2017 2:17 pm

rexnanet wrote:
Please add the link here later.
But this version uses a parallel display right?

Mon Feb 27, 2017 2:20 pm

mausi_mick wrote:super !
and the SW is very good structured !

I tried to change it to Maple MiniMaple MiniОтладочные и вычислительные платы…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…Underclocking STM32F103 to 48MHz and to the SPI-TFT-Display ILI9341ILI9341Дисплеи, сенсорные панели и светодиоды… shows on my screen. I have used and programmed a few different types of SPI screens( ili9341 , st7735) using Python very successfully and these parallel screens have many of the…[SOLVED] FSMC LCD on STM32F407VET :

STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery -O-Scope_DSO-138.JPG

But I have only changed at this time the Display-Pins ( CS,RST,DC,CLK) and the pins from the encoder.

To move the ADC Inputs (PA0 , PA4) is for me difficult or impossible , because their is something written in assembler.

But I think I have to take an second STM32F103STM32F103Микроконтроллеры и процессоры…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…[SOLVED] generic blue pill clone as USB keyboard …

Mon Feb 27, 2017 2:44 pm

mausi_mick wrote:super !
and the SW is very good structured !

I tried to change it to Maple MiniMaple MiniОтладочные и вычислительные платы…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…Underclocking STM32F103 to 48MHz and to the SPI-TFT-Display ILI9341ILI9341Дисплеи, сенсорные панели и светодиоды… shows on my screen. I have used and programmed a few different types of SPI screens( ili9341 , st7735) using Python very successfully and these parallel screens have many of the…[SOLVED] FSMC LCD on STM32F407VET :

But I have only changed at this time the Display-Pins ( CS,RST,DC,CLK) and the pins from the encoder.

To move the ADC Inputs (PA0 , PA4) is for me difficult or impossible , because their is something written in assembler.

But I think I have to take an second STM32F103STM32F103Микроконтроллеры и процессоры…19.html . ag123 Sat Apr 28, 2018 5:54 pm come to think of it blue pill / maple mini ( stm32f103 ) is an *ideal* keyboard controller, the scanning can be done with assistance of sh…[SOLVED] generic blue pill clone as USB keyboard …

Tue Feb 28, 2017 12:35 pm

hi rexnanet,

I had a some problems to make the program stable, I have to change a lot of pins, and some pins must be pwm-Pins.

Now I have PA4 free for SPI and the analog Inputs are on PA0 and PB0.

It’s not much work,
– delete complete src lib in the download DLO-138
– change the libs in Adafruit… in DLO-138.ino and insert <SPI.h>
– change in display.ino :
Adafruit_ILI9341ILI9341Дисплеи, сенсорные панели и светодиоды… shows on my screen. I have used and programmed a few different types of SPI screens( ili9341 , st7735) using Python very successfully and these parallel screens have many of the…[SOLVED] FSMC LCD on STM32F407VET _STM tft = Adafruit_ILI9341ILI9341Дисплеи, сенсорные панели и светодиоды… shows on my screen. I have used and programmed a few different types of SPI screens( ili9341 , st7735) using Python very successfully and these parallel screens have many of the…[SOLVED] FSMC LCD on STM32F407VET _STM(TFT_CS, TFT_DC, TFT_RST); // Using hardware SPI
//Adafruit_TFTLCD_8bit_STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery tft;
– delete their tft.reset() and change tft.begin(0x9341) to tft.begin
– change the global.h (different MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal /blue-pill)

here my MapleMapleОтладочные и вычислительные платы…expensive short of buying in bulk. many resort to usb-serial converters. today comes leaflabs maple , stm32duino it is ‘disruptive’ in a similar light, user customizable usb is no…Linux Journal -global h:

// comment out following line to use DSO push buttons instead of encoder

#define USE_ENCODER

// serial print macros

#define DBG_INIT(...) 		{ Serial.begin(__VA_ARGS__); 	}
#define DBG_PRINT(...) 		{ Serial.print(__VA_ARGS__); 	}
#define DBG_PRINTLN(...) 	{ Serial.println(__VA_ARGS__); }

#define SERIAL_BAUD_RATE 115200

// analog and digital samples storage depth
#define NUM_SAMPLES 2048

// TFT_SCK PA5 // D6 #####
// TFT_MOSI PA7 // D4 #####

#define TFT_CS        PA4   // D7  ##### PA14  // PA14 D21
#define TFT_DC        PA15  // D20 #####
#define TFT_RST       112   // 112 ##### //PA13    // 3.3V

// display colours

#define AN_SIGNAL1 		ILI9341_YELLOW
#define AN_SIGNAL2 		ILI9341_MAGENTA
#define DG_SIGNAL1 		ILI9341_RED
#define DG_SIGNAL2 		ILI9341_BLUE

// pin definitions (DSO138DSO138Модули, приборы и готовые устройства…kinda. … scope.html M-17 “DLO-138” – Alternative open source firmware for well known DSO-138 ! This is from our forum here (Thank You, willfly1 !!): It can be used on original DSO…DIY Oscilloscopes – List and Discussions )

#define BOARD_LED 		PC13  // D14 ##### PA15
#define TEST_WAVE_PIN PA9   // D26 ##### PA7 D4  // PWM 1KHz square wave output
#define TRIGGER_IN		PA8
#define TRIGGER_LEVEL	PB8
#define VGEN		    	PA10  // D25 ###### PB9		// used to generate negative voltage in DSO138

// captured inputs

#define AN_CH1 			PA0		// D11 analog channel 1
#define AN_CH2 			PB0   // D3 ###### //PA4=D7		// analog channel 2
#define DG_CH1 			PA13	// digital channel 1 - 5V tolerant pin. Pin mask throughout code has to match digital pin
#define DG_CH2 			PA14	// digital channel 2 - 5V tolerant pin. Pin mask throughout code has to match digital pin

// misc analog inputs

#define VSENSSEL1 	PA2
#define VSENSSEL2		PA1
#define CPLSEL			PA3

// switches
#define ENCODER_A PB3 // D19 ##### // PB13 //##################################
#define ENCODER_B PB4 // D18 ##### // PB14 //##################################
#define ENCODER_SW PB5 // D17 ##### // PB12 //##################################
#define BTN4 PB6 // D16 ##### // PB15
/*
// switches
#define ENCODER_SW PB12
#define ENCODER_A PB13
#define ENCODER_B PB14
#define BTN4 PB15
*/
// TFT pins are hard coded in Adafruit_TFTLCD_8bit_STM32STM32Микроконтроллеры и процессоры…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…[STM32GENERIC] F429i Discovery .h file
// TFT_RD PB10
// TFT_WR PC15
// TFT_RS PC14
// TFT_CS PC13
// TFT_RST PB11

// FLASH memory address defines

#define PARAM_PREAMBLE	0
#define PARAM_TIMEBASE	1
#define PARAM_TRIGTYPE	2
#define PARAM_TRIGDIR	3
#define PARAM_XCURSOR	4
#define PARAM_YCURSOR	5	// 5,6,7,8 - 4 params
#define PARAM_WAVES		9	// 9,10,11,12 - 4 params
#define PARAM_TLEVEL	13
#define PARAM_STATS		14
#define PARAM_ZERO1		15
#define PARAM_ZERO2		16
#define LED_ON	digitalWrite(BOARD_LED, LOW)
#define LED_OFF	digitalWrite(BOARD_LED, HIGH)

// number of pixels waveform moves left/right or up/down

#define XCURSOR_STEP	25
#define YCURSOR_STEP	5

#define BTN_DEBOUNCE_TIME 350

Tue Feb 28, 2017 12:42 pm

Doing great job, mausi_mick!

Post a reply