FM Radio Player for RTL2832U sticks

 Author:   Posted on:   Comments
USB TV sticks using RTL2832U chip are well known for their ability to send raw samples to USB host. This makes it possible to process various signals in software (SDR). There are many software tools for this purpose and most of them can demodulate also FM radio, with stereo and RDS support.

The problem is that these applications have full featured SDR abilities, with spectrum analysis and waterfall display. This makes them not at all lightweight. I've been looking quite hard for a simple FM radio player for my RTL-SDR dongle.

Some of the RTL2832U dongles come with FM capable player on the CD. Unfortunately not all. After some searching I was able to find a simple tool that demodulates FM stereo signal and displays RDS data. The application was most probably a test tool designed by Realtek to illustrate features of RTL2832U.
FM Radio Player for RL2832U sticks

CH341A Mini Programmer Schematic and Drivers

 Author:   Posted on:   Comments
CH341A is an USB interface chip that can emulate UART communication, standard parallel port interface, parallel communication and synchronous serial (I2C, SPI). The chip is manufactured by Chinese company Jiangsu QinHeng Ltd.

CH341A is used by some cheap memory programmers. The IC is somehow limited in this configuration, because the programmer makes use only of the SPI and I2C interface. A popular device is the so-called "CH341A MiniProgrammer" that you can buy for 2 to 5 USD.

The problem is that this device comes as-is, without any documentation or software. Drivers are available from manufacturer's website (but the site is written in Chinese). Also, some source codes are available from manufacturer. But, first of all, let's have a look at the hardware.

CH341A Mini Programmer Schematic

Heatsink for RTL-SDR dongle

 Author:   Posted on:   Comments
Some of the popular RTL2832U based DVB-T dongles that can be used as SDR tend to heat too much. As temperature increases, frequency drifts and sensitivity drops. Some dongles, especially those using R820T may stop working at all at high temperatures.

Marko Cebokli (S57UUU) used a thermal camera to measure the temperature of the dongle. He measured up to 85°C at the tuner chip (R820T). His images prove also that the dongle PCB doesn't do a good job at dissipating heat.

Although I'm using a R820T2 dongle (which is said to heat less than the predecessor R820T), I was surprised to see that after only 10-15 minutes the dongle was hot. Opening it up, I discovered that all ICs were hot (the tuner R820T2, the RTL2832U, the 1117 regulator, even the EEPROM was heated inside the closed case of the dongle).

Heatsink for RTL-SDR dongle

15-Segment FV865ND VFD controlled by HT16515

 Author:   Posted on:   Comments
FV865ND is a VFD panel manufactured by Futaba Corporation. It is designed to be used in DVD players or set-top-boxes. It can display 8 characters and it has a lot of symbols. I found it in a DVB-S2 receiver (Comag SL100HD) where it was controlled by HT16515 IC. Fortunately, the front panel of this receiver contains everything needed to power the VFD (the power is supplied via a 5V line and it is converted to filament and VFD voltage by a small transformer).

I couldn't find any software for HT16515 but its datasheet is available. The IC is 3.3V and 5V compatible and the nice thing is that the panel connector has different pins for IC supply and VFD transformer. The IC supports key scan too and the front panel makes use of only 7 keys (maximum 32). Data is sent/received via serial interface, SPI like.

15-Segment FV865ND VFD controlled by HT16515

SC75823 13-Segment LCD Display

 Author:   Posted on:   Comments
SC75823 is an LCD controller IC that is able to drive up to 156 segments. It is a 5V device that gets display data via serial bus. I found it in an auto CD player's front panel with 8 x 13 segment character LCD. I couldn't find an Arduino compatible library for it so I wrote one.

The controller only supports writing data to it. There is no key input support like other front panel ICs that can control a display and read pressed keys. The panel I'm using had each key connected in series with a different resistor and the main processor read pressed key by analog read value. Since some keys didn't work anymore, I cut the PCB and removed extra parts, keeping only the LCD panel, its backlight and the controller.

The communication protocol is probably Sanyo CCB (computer control bus), somewhat similar to SPI (it uses clock, data and chip enable signals). The controller has a pin INH that when LOW turns off the display. The library supports turning display off via this pin if connected or using software command.
Arduino SC75823 13-Segment LCD Display

A different TM1628 7-segment display

 Author:   Posted on:   Comments
TM1628 is an LED controller IC that's used mostly at DVD players front panels. The IC can control up to 7 sets of segments (separate digits) and can also process input from up to 16 individual keys. It is controlled via SPI compatible serial interface.

The only Arduino compatible library I was able to find for TM1628 is developed by Vasyl Yudin and is available on GitHub. But, I couldn't get any readable output on display. That happened because my front panel had a different segment assignment to the controller than what I found on YouTube (the display with disc icon on it).

My front panel came from TeleSystem TS5.9RX DVD Recorder and it has 7 digits and some other indicator LEDs. The PCB also contains 5 keys - but I can expand it by adding more buttons. Below is a sketch example for this front panel. It is 5V compatible so it can be connected directly to 5V levels development boards like Arduino and compatible.
A different TM1628 7-segment display

Using Magix USB-Videowandler 2 on Linux

 Author:   Posted on:   Comments
Videowandler 2 is an USB analog video capture card. There is no official driver support for Linux and the device does not work when you plug it in. According to lsusb, the device is Afatech, which is totally wrong. The kernel only loads modules for USB audio - and this is the only thing that works (the audio input appears as a separate sound card).

Videowandler 2 is based on eMPIA 2861 USB chip. Video conversion is done by SAA7113 and audio conversion by EMP202. The IDs of the device are 1B80:E349. When opening the case, you may find printed on the board UB317 Ver:A or UB315 Ver:C. The latter my be identical to Kworld UB315 but I’m not sure.

Magix USB-Videowandler 2 board. Photo by Christian Enders.

Turn RTL-SDR dongle into RTL2832U universal board

 Author:   Posted on:   Comments

The most popular RLT2832U dongles are the ones with E4000 and R820 tuners. This is due to the high frequency range these tuners have. Elonics E4000 covers 52 to 2200 MHz with a gap at about 1100 MHz and Rafael Micro R820T covers 24 to 1766 MHz.

But there are also RTL2832U based dongles with other tuners. One example is FCI FC2580 tuner (found in Trust 16738 dongle) which is capable of receiving 146 - 308 MHz and 438 - 924 MHz, limiting its use to DVB-T only! It can't even receive FM radio 88 – 108 MHz.

If you’re having such a dongle don’t throw it away. There are situations when you don’t need a tuner at all (the direct sampling mode of RTL SDR that allows direct reception of signals on frequencies lower than 28 MHz). There is also the possibility of changing the existent tuner with, for example, a satellite receiver tuner that will receive 950 to 2150 MHz.

Configure WAN port on OpenWRT/LEDE

 Author:   Posted on:   Comments
OpenWRT/LEDE are Linux based, embedded operating systems for networking devices. Besides being open source, they are highly configurable and versatile. This post will show how to configure one of the LAN ports as WAN input for xDSL routers. The problem with xDSL routers (mainly based on Boadcom platform) is that there are no opensource DSL drivers, so this function does not work.

Anyway, many DSL routers are in fact better platforms, with improved hardware, than ordinary routers. If you want to connect the router to wired LAN internet this is what you should do. I've done this on a router with LEDE Snapshot installed (the difference is that snapshots do not come with web interface preinstalled). If you have a regulare release, you can skip LuCI installation, as you already have access to the web interface of the router.

Install OpenWRT/LEDE on P.RG AV4202N router

 Author:   Posted on:   Comments
AV4202N is an xDSL modem and WiFi router based on the BCM6368 SoC manufactured by Broadcom. The CPU has 2 cores running at 400 MHz, with 64 MB RAM and 16 MB flash memory. It also has 2 USB 2.0 ports and 2 WiFi internal antennas.

Currently, although the BCM63xx platform is supported by OpenWRT, there are no releases for this device. Neither LEDE Project has released a stable build for this device, but they are offering a development snapshot [3]. The problem with LEDE snapshots is that they don't work out of the box without additional software packages (you don’t get any web interface).

But, LEDE can’t be installed on the device due to the locked bootloader. This article will show you how to use JTAG to install a different bootloader that can be used to flash OpenWRT/LEDE firmware. Part 2 details LEDE configuration and internet connection.

Note! If the mentioned device was offered to you by an ISP for xDSL internet access, doing what is described next will void the warranty of the device and make it unusable. You should not attempt to change firmware in this situation. Third party firmware does not support xDSL!
Install OpenWRT/LEDE on P.RG AV4202N router

Generate good looking PCB artwork from KiCAD

 Author:   Posted on:   Comments

KiCAD is probably the most complete opensource EDA suite. It comes with a schematic editor, a PCB designer and a 3D viewer. PCB designs can be exported to multiple formats or printed directly from the software. Although the plotting (printing) options are quite advanced, there aren't options for overlaying different layers with different colors.

This tutorial will show you how to create PCB artwork that looks good on display or print and that is intended only as a guide to the reader, not as a source for manufacturing PCB. The result will be a greenish PCB (or any color you want) with silkscreen on top of it. This is probably something you already seen in electronics publications.

There are many ways of doing this. All you need to start are the PDF files plotted by KiCAD and some image editing software (I prefer opensource tools: GIMP or some ImageMagick scripting).

Generate good looking PCB artwork from KiCAD

How to compile librtlsdr on Windows

 Author:   Posted on:   Comments

Librtlsdr is the backend used by most SDR applications compatible with the well-known RTL2832U demodulator. Using librtlsdr, you can get raw I/Q samples from RTL2832U chip, thus turning a cheap TV stick into a software defined radio (SDR).

Librtlsdr source code can be found on GitHub. It compiles easily on Linux hosts using instructions from Osmocom project. Compiling librtsdr on Windows is not that easy, mostly because the only two required libraries (libusb and pthreads) cannot be located using the same methods as on Linux (pkgconfig).

Compile librtlsdr on Windows - cmd screenshot

Make a buffered JTAG adapter (Wiggler)

 Author:   Posted on:   Comments

JTAG is an in-circuit programming and debugging interface. It specifies the use of a dedicated debug port implementing a serial communications interface for low-overhead access without requiring direct external access to the system address and data buses. The interface connects to an on-chip test access port (TAP) that implements a stateful protocol to access a set of test registers that present chip logic levels and device capabilities of various parts.

JTAG interface is supported by many devices as a convenient way of rewriting firmware (specially boot loaders) when other methods fail. Using JTAG, the ROM memory can be directly written without desoldering it from PCB to program it using a specific programmer.

In most cases, you will need JTAG access to a device with a no longer working bootloader. Otherwise, if the bootloader runs, there should be easier ways of debricking the deice. Most of the times, a device with corrupt bootloader will not display any signs of working (i.e. no LEDs turned on in case of routers, no display on front panel of set-top-boxes). Nor any ports of the device will work (i.e. no serial port response, no network detected).

Buffered JTAG adapter (Wiggler)

QSS syntax highlight in Qt Creator

 Author:   Posted on:   Comments

Qt Creator is the IDE (integrated development environment) used by Qt SDK. It is a powerful piece of software that runs on Linux, Windows and macOS. Qt SDK is able to style built applications using QSS styles, something similar to CSS standard.

Qt Creator supports not only C/C++ syntax highlighting, but basically any language through Kate Editor Syntax Highlighting files. These are XML files that define lists of specific keywords. In this way, the Text Editor of Qt Creator is able to style these keywords using a color scheme.

Qt Creator doesn't have a default QSS syntax highlight configuration file. And neither Kate. But there are two ways to add QSS syntax highlighting to Qt Creator.

QSS syntax highlight in Qt Creator