Category Archives: Computer Engineering
Waveshare ESP32 Zero C6 – RGB led micropython example

2025/04/01
testing ESP32 UART using MicroPython

Mac command to read from UART 2025/02/24
solved: nextpnr-ice40 Library not loaded: ‘@rpath/Python3.framework/Versions/3.9/Python3’
run this command 2025/02/07
Solved: macports fatal error: ‘boost/filesystem/path.hpp’
Edit CMakeLists.txt, add these two line on top 2025/02/07
Two ways to init the output pin and remain same value
2025/02/02
The correct way to send code to micropython via uart and run

There are two mode in micropython: REPL vs paste mode. I guess the uart of my ESP32 board has no flow control, so you can’t send all bytes at once, because it is too fast, so I sleep 100 ms for every 100 bytes. REPL mode You can’t just send your python code, you need […] 2025/01/28
Solved Chisel : Error compiling the sbt component ‘compiler-bridge_2.12’

When running the chisel book example, we got Error compiling the sbt component ‘compiler-bridge_2.12’. Here are the way to solve it git clone https://github.com/schoeberl/chisel-examples.git Edit hello-world/build.sbt Edit hello-world/src/main/scala/Hello.scala 2025/01/09
解剖玩具麥輪車

MX512G : 低压单通道有刷直流电机驱动器, RMB $2MX1616S : 双路有刷直流马达驱动电路, RMB $7.8TRSP5040A : SOP8語音OTP芯片40秒碩呈語音播報IC程序開發, RMB 0.27RF2520A : 无线遥控收发器芯片, RMB $4.3 2024/12/28
Tutorial to setup RF-Nano

https://item.taobao.com/item.htm?_u=ibuhab0bb1b&id=628418040642&spm=a1z09.2.0.0.76e02e8dYbXP6k 2024/12/18
STM32 + DHT11 example

https://gitlab.com/peter-example/stm32/thei-stm32-demo-stm32f411ceu6 2024/12/18
Add -g option to riscv-tests

To enable debug, “CFLAGS=-g ./configure” won’t work, edit ./isa/Makefile and add -g to variable RISCV_GCC_OPTS then it works. The dump file won’t show debug info, run “riscv64-unknown-elf-objdump -DS rv64ui-v-addi” then you see it 2024/11/17
HKPS First RISC-V Board

2024/09/28
Weact Logic Analyzer

https://github.com/WeActStudio/LogicAnalyzerV1 2024/08/27
All the gates I have

2024/07/08
如果想知道容器嘅原理

如果想知道容器嘅原理,我圈起左 2024/07/01
IoT sensors

2024/04/14
Good ELF diagram

http://blog.k3170makan.com/2018/10/introduction-to-elf-format-part-vi.html 2024/04/13
Fixed dwarf bug

When i change kernelvec.S to -ggdb, my dwarf library broken but now fixed. Commit :e640c3d9 And I still don’t understand why .S won’t be an compile unit in dwarf, why design like that. 2024/04/09
Quantr Dwarf Library – Print address/lineNo/ColNo from specific address
2024/04/07
Install apache and php for http research

I need a super clean apache and forward all PHP requests to a independent php-cgi process which host by a specific port 1. Install Apache Mac In ubuntu, no need to build apache from source, just “sudo apt-get install apache2” Linux 2. Install PHP Mac Linux if you meet this error “configure: error: re2c 1.0.3 […] 2024/03/30
The way to extend qemu TCG plugin functionality

Hi, if want to to provide other function-calls to TCG plugin, such as reading guest memory, follow these steps: https://peter.quantr.hk/2024/01/qemu-risc-v-log-all-memory-operations/ 5. Run in qemu 6. Edit xv6-riscv Makefile: References: 2024/02/10
QEMU risc-v , log all memory operations

Step 1: Step 2: modify ./tests/tcg/plugins/mem.c , add this code in vcpu_mem() Step 3: in xv6-riscv change this to Then you see this References 2024/01/27
Qemu’s trace_memory_region_ops_write

I was trying to find the body of trace_memory_region_ops_write function in qemu source code, can’t find it. It is generated by python script (log.py) 2024/01/17
RISC-V qemu doesn’t log “PRIV” in every instruction

RISC-V qemu seems wrong because it doesn’t log “PRIV:” in every instruction in qemu.log. Even mret is execute and the mode is changed, it doesn’t log “PRIV”. To fix this: 2023/12/27
Create a breadboard FPGA

We tried to ask GOWIN to let us generate the bitstream but seems they are not willing to open their standard, xilinx and altera has no hope too. So for education purpose we now go for build a simple one. We found the way to break logic into LUTs, so we want to build a […] 2023/12/24
NOR vs NAND flash

i finally found the differences between NOR and NAND flash, but just dont know what is it 2023/12/22
ENC28J60 + Arduino

2023/11/09
Arduino Function Generator

I am using Nano and AD9833 to build a simple function generator. Code in here https://gitlab.com/quantr/hardware/arduino-function-generator 2023/11/07
Arduino + AD9833 using library by Rob Tillaart

Buy the board here : https://item.taobao.com/item.htm?spm=a1z09.2.0.0.6caf2e8dU9c4dS&id=590166217396&_u=6buhab0a8d9 Install the library, see below Make sure connect these pins to the board, total 5 pins, follow below Refer to https://github.com/RobTillaart/AD9833 , more examples in https://github.com/RobTillaart/AD9833/tree/master/examples 2023/11/06
Arduino + AD9833

Buy from here. I am using the example from here but ignore the switch buttons. You need to add this zip into the library and make sure don’t install the other library call “AD9833”, very important 2023/11/06
Rotate button by Arduino

Refer to https://zhuanlan.zhihu.com/p/349824627 , buy from here 2023/10/30
MCP4725 I2C DAC Breakout board

Bought from here Testing maximum frequency, around 800us 2023/10/30
GY-4725 board

Bought from here. This code test maximum frequency, around 1ms period is peak Documents 2023/10/30
計準NPN了

Main point: calculate Ib, we can do it by Ib=Ic / Beta min OR Ib=(Vb – 0.7) / Rb 2023/10/27
FPGA Research
This is a synthesis of a simple verilog program in vivado 2023/10/14
Funny Toy : Oscilloscope

I got this electronic toy from Taobao, i want to have more experience on soldering and putting different components on the PCB and making them work. After 3 hours in soldering and 1 hour in debugging, i finally make it works https://v.youku.com/v_show/id_XNjAyNDAwNDY2OA==.html?spm=a2hje.13141534.1_3.d_1&scm=20140719.manual.240103.video_XNjAyNDAwNDY2OA== All documents here 2023/10/09
Nucleo-L476RG DAC

2023/10/08
砌機 : FPGA

Lattice FPGA比STM32簡單, 我應該可以搞得掂 用户手册: https://github.com/wuxx/icesugar-nano/blob/main/README.mdwin7串口驱动: https://github.com/wuxx/icesugar-nano/blob/main/doc/usbser.inf原理图及源码: https://github.com/wuxx/icesugar-nano 主要component其實得兩個: FGPA同粒Flash 2023/10/05
Multimeter book, teach you how to build one

2023/09/16
Arduino read/write AT24C256
Many examples not work from google, it is because it needs a delay after write operand, so i put delay(100) 2023/08/31