How to Build a Lego Monster Truck
solder the connector pin head
PWM shield needs a 5V input, that can be provided by wiring the 5V pin
on ESP8266 shield to the power connector of PWM shield, and stack them together, like the
4) Get Two DC 3V-6V Dual Axis Gear Motor from banggood.com. Or t
hey might cost less than $1 each if you buy them from AliExpress
solder wires to the DC motor with 22AWG solid core
5) build the steering mechanism:
6) Hack one of the DC motors according to instructions here
, and attach it to the Lego Gear Box
7) Mount the steering mechanism and the DC motor to a Lego 8 x 16 plate using cable tie
Attach the other DC motor with two wheels. The wheels are 65 mm in
diameter and 28 mm wide. You can get them from Amazon or banggood.com
9) Attach the DC motors (with wheels) to 3 2 x 16 Lego Plate stack
10) put everything above together with cable tie, connect the DC motor to PWM shield
Now you get yourself a Lego Monster Truck. And stay tuned for firmware/software!
PulseRain M10 board has officially entered the race for HackadayPrize2017! as "Play FPGA with Arduino"
The project page is
And for readers of this blog, please do me a favor by clicking the "Like Project" button on this page. (If you have a GitHub or Twitter account, you can sign in directly.). To tell you the truth, every like this project receives will translate into $1.00 seed money with $200 ceiling. Wow, that can buy hundreds of cups of mid-night coffee!
PulseRain M10: A FPGA Board like No Other
People start asking me why this blog had a long hiatus. And here is what's happening
My coworkers and I have spent the better part of the past 5 months developing and fine-tuning PulseRain's latest product: The M10 FPGA board.
We chose to make the M10 board because we need a platform to verify our FP51-1T MCU core. The FP51-1T is an 8051 core that has single clock instruction cycle. It has 4 stage pipeline structure that can reach above 100MHz on Altera Max10 C8 speed grade device. A lot of open source 8051 core claim to be 1T instruction cycle, but they often fall short on FMAX (max clock frequency). Most of them will fold around 50 - 60 MHz for the C8 speed grade.
And for the FPGA platform we are looking for, we would like to see:
*) open source hardware
*) versatile with plenty of peripherals
*) software friendly
We have looked up and down, but couldn't find a perfect match yet. So we decided to go extra miles and do it by ourselves.
And a spy photo of this board can be found here
We original decided on the name Mustang Duino, but later we took some marketing advice and named it PulseRain M10, because:
A) It has an Altera MAX 10 FPGA on board. On the record, M is for MAX
B) Internally, we nickname FP51 as Mustang to honor the legendary Mustang Fighter-bomber in World War II. So off the record, M stands for Mustang.:-)
We made the form factor of this board to be Arduino compatible, and we support both 3.3V and 5V IO through jumper setting, so that both 3.3V and 5V shield can be mounted to our board. By itself, the board is 2.1 inch x 3.2 inch.
And the board has an Altera 10M08SAE144C8G FPGA, with onboard peripherals like
*) Temperature Sensing Diode
*) Serial SRAM
*) Voice Codec, (with onboard microphne and speaking plug)
*) MicroSD Card Socket
For more information, please go to m10.pulserain.com
The prototype of the board meets our expectations. And we are currently starting pilot run for production. Stay tuned!
NIOS II Processor in MAX 10 Device
The Altera NIOS II (Gen 2) processor comes with MAX 10 device for free, sort of.
In fact, the NIOS II comes with two flavors: economical and fast. Unfortunately, it seems the latter needs a license while the former is truly free as free beer.
And the MAX 10 has very limited BRAMs. I found it not too hard to make bloated code that devour all the available BRAMs. In particular, please skimp on the usage of printf, and use small size C library if possible.
PS: Warmest Condolences to those who lost their loved ones 15 years ago.
SDC Constraint, Input / Output Delay
Preparing IO constraint for FPGA is always a tedious job. And the following is a spreadsheet to help the number crunching. BTW, I have to say that MS Excel is much more powerful than Google Spreadsheet.
AES and Encryption in China
AES is a popular encryption algorithm with symmetric keys. If you are looking for open source AES implementions, Ref  is one of them.
To verify the AES implementation is in line with National Standard, use the test vectors from Ref as passing criteria.
BTW, China has its own flavor of encryption product regulation (Ref). Ask Office of Security Commercial Code Administration (OSCCA) before the police knocking on your door. I'm not kidding, and HP knows it all well :-( (Ref).
 Ilya Levin, a byte-oriented aes-256 implementation
 Morris Dworkin, Recommendation for Block Cipher Modes of Operation, Methods and Techniques, NIST, 2001
 Xia Yu and Matthew Murphy, The Regulation of Encryption Products in China, MMLC Group
 CHINA’S EXPORT CONTROLS AND ENCRYPTION REGULATIONS
 Mr.王掌柜, 中国有趣的“商用密码管理”
 个人使用密码产品，例如 OpenSSL，是否属于违法行为?
Tab Completion in Python 3
For CLI (Command Line Interface), tab completion is always a handy feature. Before Python 3, you can use readline package (Ref ) to implement tab completion. However, readline became obsolete after Python 3. Fortunately, an alternative solution can be found here. This script is part of PulseRain Technology's FP51 debugger, but it can be applied elsewhere generally.
In addition, serial port often calls for full-duplex. One way to achieve full-duplex is, of course, to use multi-thread. Another way to do this is to use non-block read for UART Rx. This can also be found in OCD_Input.py.
 rlcompleter — Completion function for GNU readline
*) Legal Disclaimer
*) The Book
*) FCC Wireless
*) PAPA System