Author Archives: admin
Nucleo L476RG + Platform IO Blink Example

2025/08/24
作為教學工具,比較Platform IO和STM32CubeIDE

大家都係用STM32CubeMX,所以Gen出黎嘅Code無太大分別。計功能肯定係STM32CubeMX強,第一佢有一個生成器可以生成粒MCU所有Setting,而PlatformIO係純Code,所以好考驗老師嘅功力,但係純Code有純Code嘅好處,就係學生可以更了解第一句代碼點影響粒MCU,會更有利於教學。STM32CubeIDE會要求你將啲Code寫係comment與comment之間,睇上去好亂,而PlatformIO無呢回事,啲Code睇上去好Clean。PlatformIO最大賣點係源於VSCODE所以有Github Copilot,我之前用STM32CubeIDE同VSCode開住同一個project,github copilot一邊gen我一邊改,我就無問題。但作為學生會好麻煩。 2025/08/24
Scale STM32CubeIDE UI in mac
Run STM32CudeIDE by Changing anything in STM32CubeIDE.ini won't work 2025/08/21
Compile bochs in 2016 old mac with macports
2025/08/17
Useful linux command
List out 10 biggest files in folder List biggest folders 2025/08/11
Micropython燒程式落stm32, reboot會無哂
https://github.com/issues/created?issue=micropython%7Cmicropython%7C17828解決辦法就係加呢兩句係main.py頭import pybpyb.usb_mode('VCP+HID') 2025/08/05
Why your STM32 is bricked

My STM32 is bricked (can't run anything in STM32CubeIDE) because my main loop has no sleep, after i add it back, my STM32 can run many times in STM32CubeIDE. To recover my weact blackpill, i use "while true; do st-flash erase; sleep 1; done" to keep running the st-flash command, I found out pressing the […] 2025/08/04
Set STM32F411CEU6 to run at 96Mhz with 48Mhz USB (100Mhz is not possible)

With HSE = 25 MHz, the PLL configuration must satisfy: Let’s try the main PLL: Since PLL_Q must be an integer (4-15), 48 MHz USB is not possible with VCO = 200 MHz: To get exactly 48 MHz: Since SYSCLK cannot exceed 100 MHz, VCO = 192 MHz (SYSCLK = 96 MHz, USB = 48 […] 2025/08/03
Create your hardware in libsigrok
In short, you need to build libsigrok then sigrok-cli Step 1: Add your device to Makefile.am Step 2: in configure.ac Step 3: Create /src/hardware/quantr folder add api.c, protocol.c and protocol.h api.c: protocol.c: protocol.h: Step 4: Build libsigrok Step 5: Build sigrok-cli Step 6: Test Then test it by "sigrok-cli -L", you should able to see […] 2025/08/03
STM32 Logic Analyzer Day 1
Trying to build a logic analyzer prototype, today i am using weact black pill board. I am using interrupt to fire the DMA and get the pins values, then use virtual com port to transfer it to PC, so far it works 2025/08/02
WEACT blackpill stm32f411ceu6 virtual com port

2025/08/02
Weact STM32 H750 board use serial port via usb

Unlike nucleo to user serial port via usb by just enabling the uart. We have to enable VCP in weact H750 board. Reference: https://blog.csdn.net/Naisu_kun/article/details/118192032 2025/08/01
Java swing embed a website

2025/07/30
Good book : DNA

2025/07/28
Weact STM32H750 DMA Reg-To-Mem example

Few things need to be care and different then STM32F411CEU6 Gitlab source https://wiki.st.com/stm32mcu/wiki/Getting_started_with_DMA 2025/07/23
Solved: Weact STM32H750VBT6 unable to find target

I changed the clock to maximum 480Mhz, after I F5 for the first time, I unable to burn any program to it again. To solve this, press both reset and boot buttons on the board, click F5 in STM32CubeIDE, then release reset button (still hold the bott button). It will successfully burn the program again. […] 2025/07/23
ATMEGA328P and ATMEGA328PB are different in programming
I got this error is i change "MODEL=atmega328p" to "MODEL=atmega328pb" in my makefile. Github copilot said the error occurs because the ATmega328PB has two TWI (I2C) modules, and its I/O register naming is different from the ATmega328P. Specifically, the ATmega328PB splits some port definitions (like DDRC, PORTC) into two sets (for PORTC and PORTD, etc.), […] 2025/07/22
STM32L476RG - DMA from register to memory example

Thinking how to build a logic analyzer using STM32. This example keep transfer the value of GPIO A to memory then fire interrupt using DMA. It will toggle PC0 for every complete transfer in my Nucleo L476RG board, I use oscilloscope to test, around 93KHZ 2025/07/21
Shooting Star : 四驅車

2025/07/19
Example : STM32F411CEU6 mem-to-mem DMA interrupt

https://wiki.st.com/stm32mcu/wiki/Getting_started_with_DMA#DMA_memory-to-memory_example_overview 2025/07/15
LVGL_python connecting two SPI devices

All device pins should be connected to the same pins on the ESP32 board except the CS (chip select) pin. 2025/07/10
Waveshare-ESP32-C6-1.47-Touch + Micropython + LVGL

Special Thanks to Mr kdschlosser for writing the driver More Examples on https://github.com/quantrpeter/Waveshare-ESP32-C6-1.47-Touch-Micropython-LVGL Example: 2025/07/06
Waveshare ESP32-C6-Zero + LVGL + ST7735S + 80x160 LCD

2025/07/06
Perfect 3D print for Ender 3 Pro

My old Ender 3 Pro, give 0.3mm X-Y Hole compensation, now no need polishing, I can plug them into another. Two filament print from two different nozzle temperature, same perfect. 2025/07/04
Waveshare-c6-zero + st7735

https://gitlab.quantr.hk/example/micropython/waveshare-c6-zero-st7735 2025/07/03
Waveshare ESP32-C6-Zero + LVGL + ST7735S

https://www.waveshare.com/wiki/ESP32-C6-Zero 2025/07/03
Run: Micropython + LVGL on CYD (Cheap Yellow Display

Example: Clock Cheap Yellow Display Pins Connector types Connector Type Note P1 4P 1.25mm JST Serial P3 4P 1.25mm JST GPIO P4 2P 1.25mm JST Speaker CN1 4P 1.25mm JST GPIO (I2C) What pins are available on the CYD? There are 3 easily accessible GPIO pins Pin Location Note IO35 P3 JST connector Input only pin, […] 2025/07/02
Mac: Run ubuntu command with GUI in docker

Step 1: create Dockerfile Step 2: Build the image docker build -t xclock-ubuntu . Step 3: Set XQuartz and restart it Step 4: Run "xhost + 127.0.0.1", and this "xhost +localhost" wont work Step 5: Run Another way 2025/07/01
Run Micropython in CYD (Cheap Yellow Display) and control the TFT

Official Tutorial From TaoBao Factory : https://github.com/quantrpeter/2.8inch_ESP32-2432S028R Remark: use offset 0x1000 to write the firmware and have to erase flash first, so: Download micropython firmware here https://micropython.org/download/ESP32_GENERIC/ 1. esptool.py erase_flash2. esptool.py --baud 460800 write_flash 0x1000 ESP32_GENERIC-20250415-v1.25.0.bin Download All Files in below links, or by the attachment in this posts ILI9341 Display Driver Download ili9341.py from: […] 2025/06/29
Solved: unable to write to cheap yellow display esp32

In mac, sometime arduino unable to write the program to cheap yellow display esp32, you can type the command manually 2025/06/29
AT28 Flash board

2025/06/29
Quest Migration Manager UI

2025/06/23
Solved : sr: resource: Failed to open resource 'fx2lafw-sigrok-fx2-8ch.fw'

If you have this problem: run: sigrok-cli --loglevel 5 -d fx2lafw --scan , it said failed to find the firmware file So build this project and restart terminal, then you will success 2025/06/19
Muselab Logic Analzyer Nano - Sigrok-cli command
2025/06/18
Micropython for has no SoftI2C
It has no SoftI2C, so change display = ssd1306.SSD1306_I2C(128, 64, SoftI2C(sda=Pin(20), scl=Pin(21))) to import timefrom machine import Pin, I2C, SoftI2Cimport ssd1306 i2c = I2C(1) # Create I2C object display = ssd1306.SSD1306_I2C(128, 64, i2c) # Pass I2C object display.fill(0)display.text("Hello, World", 0, 0)display.show() time.sleep(100) 2025/06/07
Tutorial build micropython for WEACT_F411_BLACKPILL

using st-flash is better then dfu-util because we don't need to put the board into dfu mode Micrpython testing example 2025/06/07
AT28 Programmer (Java + Arduino)

https://gitlab.quantr.hk/quantr/toolchain/java-at28-programmer https://gitlab.quantr.hk/example/arduino/at28-programmer 2025/06/06
MicrPython SSH1106

IT IS SSH1106,NOT SSD1306 2025/06/04
ESp32 Arduino LED Example

https://item.taobao.com/item.htm?_u=vbuhab0c8fc&id=692235616325&pisk=gfaLsUj6M1dLBGaKsWSMEFEN3lfGiGVU_JPXrYDHVReTeSd3x0DoV4e4H0TlY2m-yRMg-vVnRbi7E-ZndkDkyzeapeYoR8b-FSrNavc3-Qh7fJLuxWD3XQ3USkYoK9u8N-0RntbcoWPE846cnxid94gjO3OBEYg614c8jWtHGWPEzYOMFiq_TQhdgwAINY1t5bhIO4MINF1twb9IPviWChGjC4gSA0t_1jcXApMWA1KstbcWRXGS5hGSZHgSP8N16bksO4gS9i5KQBGpyo2QH1YJL2LWPPhKfiViCiyQJXhnnWapBddr9DHbOAB4G69Z2JnLSwpq9lNYiXePueuI2kwK14QJ72VYfJnTvTLtblN4PcENHnP4OowSKP6XyYq4JomqAILY68UtRAUPaUkQx7ao2y6XZvaUKPn4zpBiEoVgRcefIFer2kwK1qsPZr4xT7vmHbxC61Ky4DGw7oIF1mRpfIltn6iB43oo_fHc6tty4DGZ6xfB_3-rqf5..&spm=a1z09.2.0.0.20712e8dhZRCRN (Set to 115200, otherwise upload will fail) 2025/05/31
香港好多人覺得自己係諸葛亮

諸葛亮勁係無資源嘅情況底下可以有高強嘅執行力。而香港人絕大部份都無執行力。 2025/05/13