Spark Logic

$10 O-Scope revisited

STM32F103C8T6 LQFP48 Pinout
ILI9341 MSP3223 · 14-contact header Pinout

Over the last few days I’ve been playing with Ray’s STM32STM32Microcontrollers and processors…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]…View in hardware catalog 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

Fri Jul 31, 2015 9:42 am

If your board doesn’t have the RTC crystal fitted, one of these will do the trick. I have fitted 4 of these so far to different boards, and they work flawlessly. These crystals are pretty tiny (2mm x 6mm not including the leads) however, so you may need a magnifier to see them easily (unless your eyesight is pretty good) and a very fine tip on your soldering iron.

You can obviously comment out the time functions in the code if they are causing issues too. The scope doesn’t rely on them (yet) for anything other than the clock display.

Fri Aug 21, 2015 10:43 am

Hi
Sorry if my question is n00bish, I’m new to C/C++.

I’m trying to compile Pig-O-Scope for Maple MiniMaple MiniDevelopment and computing boards…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…View in hardware catalog clone using Arduino 1.6.5:
-touchscreen is not defined since my TFT doesn’t have one
-all libraries (except for UTouch) are in place
-Time library is renamed and is included correctly
-BOARD_LED is changed to PB1
-I’m aware about second Adafruit_GFX_AS instance but it doesn’t interfere (tested using other TFT projects)

But still I got a compile error:

STM32-O-Scope.ino: In function 'void setup()':
STM32-O-Scope:258: error: 'setADCs' was not declared in this scope
STM32-O-Scope:263: error: 'setCurrentTime' was not declared in this scope
STM32-O-Scope:264: error: 'serialCurrentTime' was not declared in this scope
STM32-O-Scope:265: error: 'sleepMode' was not declared in this scope
STM32-O-Scope:271: error: 'toggleSerial' was not declared in this scope
STM32-O-Scope:272: error: 'toggleHold' was not declared in this scope
STM32-O-Scope:273: error: 'decreaseTimebase' was not declared in this scope
STM32-O-Scope:274: error: 'increaseTimebase' was not declared in this scope
STM32-O-Scope:275: error: 'decreaseZoomFactor' was not declared in this scope
STM32-O-Scope:276: error: 'increaseZoomFactor' was not declared in this scope
STM32-O-Scope:277: error: 'scrollRight' was not declared in this scope
STM32-O-Scope:278: error: 'scrollLeft' was not declared in this scope
STM32-O-Scope:279: error: 'incEdgeType' was not declared in this scope
STM32-O-Scope:280: error: 'decreaseYposition' was not declared in this scope
STM32-O-Scope:281: error: 'increaseYposition' was not declared in this scope
STM32-O-Scope:282: error: 'toggleTestPulseOn' was not declared in this scope
STM32-O-Scope:283: error: 'toggleTestPulseOff' was not declared in this scope
STM32-O-Scope:285: error: 'unrecognized' was not declared in this scope
STM32-O-Scope:307: error: 'timer_set_period' was not declared in this scope
STM32-O-Scope:315: error: 'clearTFT' was not declared in this scope
STM32-O-Scope:326: error: 'showCredits' was not declared in this scope
STM32-O-Scope:327: error: 'showGraticule' was not declared in this scope
STM32-O-Scope:332: error: 'showLabels' was not declared in this scope
STM32-O-Scope.ino: In function 'void loop()':
STM32-O-Scope:346: error: 'trigger' was not declared in this scope
STM32-O-Scope:347: error: 'showGraticule' was not declared in this scope
STM32-O-Scope:350: error: 'blinkLED' was not declared in this scope
STM32-O-Scope:352: error: 'TFTSamples' was not declared in this scope
STM32-O-Scope:353: error: 'showLabels' was not declared in this scope
STM32-O-Scope:360: error: 'takeSamples' was not declared in this scope
STM32-O-Scope:370: error: 'showTime' was not declared in this scope
STM32-O-Scope.ino: In function 'void trigger()':
STM32-O-Scope:440: error: 'triggerNegative' was not declared in this scope
STM32-O-Scope:443: error: 'triggerPositive' was not declared in this scope
STM32-O-Scope:446: error: 'triggerBoth' was not declared in this scope
STM32-O-Scope.ino: In function 'void takeSamples()':
STM32-O-Scope:519: error: 'DMA1_CH1_Event' was not declared in this scope
STM32-O-Scope:521: error: 'adc_dma_enable' was not declared in this scope
STM32-O-Scope.ino: In function 'void decreaseTimebase()':
STM32-O-Scope:681: error: 'clearTrace' was not declared in this scope
STM32-O-Scope:694: error: 'showTrace' was not declared in this scope
STM32-O-Scope.ino: In function 'void increaseTimebase()':
STM32-O-Scope:701: error: 'clearTrace' was not declared in this scope
STM32-O-Scope:708: error: 'showTrace' was not declared in this scope
STM32-O-Scope.ino: In function 'void increaseZoomFactor()':
STM32-O-Scope:714: error: 'clearTrace' was not declared in this scope
STM32-O-Scope:718: error: 'showTrace' was not declared in this scope
STM32-O-Scope.ino: In function 'void decreaseZoomFactor()':
STM32-O-Scope:725: error: 'clearTrace' was not declared in this scope
STM32-O-Scope:729: error: 'showTrace' was not declared in this scope
STM32-O-Scope.ino: In function 'void setCurrentTime()':
STM32-O-Scope:853: error: 'serialCurrentTime' was not declared in this scope
Multiple libraries were found for "Adafruit_GFX_AS.h"
Used: C:\Users\Matus\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Adafruit_GFX_AS
Not used: C:\Users\Matus\Documents\Arduino\libraries\Adafruit_GFX_AS-2
'setADCs' was not declared in this scope

Fri Aug 21, 2015 11:08 am

Interesting… I’m not sure if I actually tested those ifdefs for the touch screen. I’ll have a play with it later.
Does it compile if you grab the utouch lib and install it and leave #define TOUCH_SCREEN_AVAILABLE as is?

Fri Aug 21, 2015 11:27 am

ahull wrote:Does it compile if you grab the utouch lib and install it and leave #define TOUCH_SCREEN_AVAILABLE as is?

Fri Aug 21, 2015 11:50 am

The old / original bootloader only gives you 17k, the new bootloader gives your all the RAM in the device

Easy test is just to switch the bootloader in the menu and recompile

Fri Aug 21, 2015 12:20 pm

RogerClark wrote:The old / original bootloader only gives you 17k, the new bootloader gives your all the RAM in the device

Easy test is just to switch the bootloader in the menu and recompile

Fri Aug 21, 2015 12:33 pm

RogerClark wrote:The old / original bootloader only gives you 17k, the new bootloader gives your all the RAM in the device

Easy test is just to switch the bootloader in the menu and recompile

Fri Aug 21, 2015 1:44 pm

You can decrease the buffer size too.
// Samples - depends on available RAM 6K is about the limit on an STM32F103C8T6
// Bear in mind that the ILI9341 display is only able to display 240x320 pixels, at any time but we can output far more to the serial port, we effectively only show a window on our samples on the TFT.
# define maxSamples 1024*6

Fri Aug 21, 2015 2:18 pm

ahull wrote:You can decrease the buffer size too.

Fri Aug 21, 2015 9:01 pm

Backlight is not comtrolled by the processor, its normally connected to Vcc.

So if its not getting lit at all, you have wired it up incorrectly or its defective

Fri Aug 21, 2015 11:46 pm

darth_llamah wrote:ahull wrote:You can decrease the buffer size too.

Sat Aug 22, 2015 8:55 am

victor_pv wrote:darth_llamah wrote:ahull wrote:You can decrease the buffer size too.

Sat Aug 22, 2015 1:25 pm

darth_llamah wrote:
TFT is for sure not defective, wiring seems to be OK.
But I’m not sure if resulting .hex is good- there is no output on TEST_WAVE_PIN and the board is not enumerated as a serial port.
I’ll check everything again with unmodified sketch

Sat Aug 22, 2015 9:34 pm

I totally agree with the modular testing approach that Ray has described.

I often have to go back to the LCD demo to confirm that the connections are correct, before I move on to the real think I want to do.

Tue Aug 25, 2015 2:55 pm

RogerClark wrote:I totally agree with the modular testing approach that Ray has described.
I often have to go back to the LCD demo to confirm that the connections are correct, before I move on to the real think I want to do.

Thu Sep 10, 2015 10:02 am

Finally I build this project with the TFT TJCTM24024TJCTM24024Displays, touch panels and LEDs…ant to do. zoomx Thu Sep 10, 2015 10:02 am Finally I build this project with the TFT TJCTM24024 -SPI. Problems encountered: If you have Adafruit_GFX_AS library in your libraries f…View in hardware catalog -SPI.

Problems encountered:
If you have Adafruit_GFX_AS library in your libraries folder you will find the problems described here
viewtopic.php?f=14&t=562
the solution was to move this library and the Adafruit_ILI9341ILI9341Displays, touch panels and LEDs… 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…View in hardware catalog _STM library inside the sketch folder and modify all references of .h in all .cpp files.
Time.h library must be renamed in other else.

LED TFT pin seems that it don’t work in PA3 pin (but STM board take power from STlink, I forgot USB cable), I used a 3.3V pin.
It seems that touch coordinates are rotated by 180 degrees, maybe it is written in some pages here but I believe that the solution is simple.

A note.
STLink was unable to find the chip until I used the STM32STM32Microcontrollers and processors…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]…View in hardware catalog ST-LINKST-LINKModules, instruments and finished devices…ot add the serial usb device… suspect flashing failed…. Do I need to debrick it with st-link ? (which I don’t have lol) BennehBoy Mon Jan 23, 2017 8:11 pm NM managed to rescue it…View in hardware catalog Utility, then in setting choosed “Connect Under Reset” (Mode), then, after connection, blanked the chip. After done that the IDE was able to program the chip. I simply don’t remember wich sketch was in the chip.

Thu Sep 10, 2015 8:57 pm

The SWD (STLink) pins are normally set to GPIO mode if you upload via the bootloader etc.

I think only STLink uploads leave the SWD pins in their SWD mode.

Sat Sep 12, 2015 3:26 am

ahull wrote:Oink, oink… enjoy.. :D

Sat Sep 12, 2015 1:03 pm

martinayotte wrote:ahull wrote:Oink, oink… enjoy.. :D

Post a reply

Optional · up to 10 MiB