-
Yet another STM8 USB project
05/13/2021 at 16:58 • 5 commentsI made a USB HID game controller using a MPU6050 module. It was inspired by Cemu Gyro Joystick project that uses a dongle to supplement motion data for CEMUhook used in emulators.
Except mine is built with a STM8S003 with VUSB library. The STM8S003 is under the programming header. T he module is surface mounted without Castellated Edges.
There were some problems with I2C errata and interference from USB traffics, but that was all resolved by adding a delay.
It is a USB low speed device and as such limited to 7 byte HID reports (1 byte by Report ID). How to send 12 bytes of data? Group the Accelerometers and Gyroscopes under separate report ID and alternating their reports. Let the PC figure them out.
Windows recognizes the new device as a game controller with 6-axis (X/Y + 4).
Let's say I don't have a clue with setting up Node.JS and figure out how to compile stuff. I have to figure out what programs to use as an alternative.
Github: https://github.com/FPGA-Computer/STM8-Gyrostick
My project page: https://hw-by-design.blogspot.com/2021/05/stm8-gyrostock.html
-
2021 update
03/08/2021 at 23:39 • 0 commentsI replaced the guts of my old alarm clock, so one less clock to set for Daylight saving time.
I used recycled 7 segments displays from old cable converter and pair them with 2 smaller ones. The vintage displays use a lot more current than the green ones. 50mA vs 20mA.
Both versions on github: https://github.com/FPGA-Computer/LED-Clock
STM8 USB library - Last lower level library removed and save some more space.
https://github.com/FPGA-Computer/STM8-LCDUSB
https://github.com/FPGA-Computer/STM8-HID-Multimedia-DialTimer is updated to V2: https://github.com/FPGA-Computer/Timer
I added a connector for a nRF24 module as part of the V2 overhaul. I might not need it now, but it is much less work later when I do want one.
-
STM8 HID-Multimedia-Dial is now on github
09/17/2020 at 03:36 • 0 commentsI made a port of my old ATMega8 HID Multimedia Dial project to the STM8. It is now on github
The multimedia dial can control volume and mute. When I double click the switch, it changes mode for media playback Next/Prev.
This version uses the STM8S003. I have included a SWIM hardware debugger connector and soldered down the micro USB. (lost my bag of breakout PCB)
Also upgraded to a couple of RGB LED.
This project uses HID, so it is a good way for testing the changes I made to the STM8 VUSB. I have also recompiled USB2LCD with the new VUSB library and it seems to be working.
-
STM8 version of LCD2USB is now on github
08/18/2020 at 17:29 • 1 commentSTM8 version of LCD2USB (AVR) is available on github
It is a modification of a working STM8 VUSB library from STM8S-VUSB-KEYBOARD. The Russian comments are "google translated" to English.
I have done some additional changes in the USB stack for the Vendor Request packets needed by LCD2USB. I have changed the device library files to bare metal, refractor the code. etc. I have taken the packet processing core from AVR LCD2USB, but used my own code for the I/O.
A general purpose schematic and PCB for Eagle is available. The serial, I2C pins are broken out with spare footprints for a tiny crystal (available on aliexpress) and caps.
I am using 3.3V for the character LCD panel. See ELM's article for details. Contrast is controlled by PWM that drives the charge pump.
I am not sure if/how the buttons (S1 and S3) works with LCD Smarties. LCD2USB.dll doesn't seem to an entry for them.
LCD2USB works with LCD Smarties LCD2USB.dll plugin as a info display. It should work with lcdproc in Linux (not tested).
-
Simple things in life: hacks, recipe
05/11/2020 at 14:25 • 0 commentsSome of my recent activities during soft lock down.
Quick and simple recipe:
- Egg noodles from scratch
"instant" noodles from scratch, 4 simple ingredients. - Vegetables in 4-6 days, Flat hook for DIY mask
growing bean spouts quickly - add add water, no sunlight or soil needed. - Simple baked chicken
Mask:
- Vegetables in 4-6 days, Flat hook for DIY mask
replacement for those rubber band/hair ties
- Stitching like your life depends on it
hand stitching the middle seam for curved masks for novices
Repairs:
- Egg noodles from scratch
-
Recent stuff
01/27/2020 at 22:13 • 0 commentsMy STM8 LED clock project is also hosted here on HaD.io My timer was also updated with the latest features from the clock project. i.e. all the latest goodies such as NCO tolerance trimming, Daylight saving time and as part of the deal: Date, day of week, leap year. It would be interesting to see how temperature affects the accuracy clock on the timer as it is next to a window that leaks cold air and heated by a baseboard heater with a not so accurate bang-bang thermostat. Previously the timer was trimmed to about +/-0.6sec/day just by playing with the 16-bit divider.
I had to repair my very old Weller WESD51 soldering iron. Let's say I am not impressed at the overall build quality. It did last a very long time, but obviously not long enough for me. :P
They used a trimpot for the knob and a few corners were cut in this model and making it unreliable. More details on my blog.
I replaced it with a cheap chinese pot - I got a bag of 5 for less than $1. It may not be the greatest quality, but at least it has some metal parts in the bushing and shaft.
A bit of improvised molten hot glue casting, I modified the existing knob for the new pot.
-
STM8 timer
11/01/2018 at 00:46 • 0 commentsThis is a simple project: STM8S003 timer for watering plants and LED lighting It is essentially an clock project with a user interface for setting the alarms. The user interface is a missing piece in my microcontroller library and will be ported to my other projects.
Here is the UI for trimming the RTC by adjusting the values of the timer reload.
-
Portable F103 - LCD
08/19/2018 at 20:29 • 0 commentsDoing some reverse engineering of the LCD as I don't trust unknown 3rd party source code without knowing where they came from and more important how they got it and what LCD are they for. Some of the low level settings are for a specific LCD type.
Anyway, this is a quick test without the proper timing delays modified from my own Nokia 5110 LCD code. That's a good start.
Detail waveforms here: https://hw-by-design.blogspot.com/2018/08/portable-f103-lcd.html
Main project page: https://hw-by-design.blogspot.com/2018/08/portable-stm32f103.html
Sadly it is a blogging site, not project oriented.
-
Projects update quickies
08/16/2018 at 22:21 • 0 commentsCheap Xilinx Virtual Cable Alternative?
Made a JTAG dongle using ESP8266 module. Based on https://github.com/gtortone/esp-xvcd, but I made some changes to GPIO pins and added proper level translation.
Haven't started with the firmware. At some point I'll be removed the Arduino digitalwrite() junk as the abstraction are badly and sloooooooow for bitbanging.
Sneak peek at the 1 sq. inch layout if and when I am happy with the design.
The $20 FPGA board has arrived (18th Aug) from China. It took a bit of damage with the JTAG pin sticking out and slightly bent. Canada Post put the package in a a big Canada Post plastic bag.
The PCB side by side with a "credit card".
PCB arrived from OSH Park a couple of days ago.
Aside from the stereo connector a bit longer pushing into a couple of parts and a bunch of soldering mishaps, things are looking okay. I am in the middle of writing driver code.
Smart bench supply
A couple of modules and some plastic knobs showed up in the last couple of days.
The C$ 2.58 buck-boost one has a possibly XL6019 (180kHz) relabelled as XL6009 (400kHz). I saw 180kHz switching waveforms on my scope.
Compare the texture of the one on the left vs the one on the right hand side (fake). The fake one has some fine scan lines vs the textured surface on the left
There are a couple of possibly fake or obsoleted ELNA labelled cap. The ripple (lol 200mV) does not match their claim of 30mV even at low load. They do have decent inductors.
The C$ 1.78 XL6015 (180kHz) buck module is probably using real part as I see 188kHz on my scope and the ripple is actually decent. The inductor is getting warm - they probably use the wrong type of core that is too lossy. Might move inductor from the buck boost module here.