Friday, May 19, 2017

8-bit assembler compiler project

This project is an assembler compiler to generate binary executable for 8-bit x86 like CPU systems. This compiler can parse NASM style assembler code and it compatibles with Marco Schweighauser's javascript 8-bit virtual CPU.

Compare with Marco Schweighauser's javascript compiler this compiler parse almost same assembler code and generate almost identical executable code. The only difference in this parser is that all the operands are separated by white space(s), and not with the comma ( , ).

 jmp start
hello:
 db "Hello World!"
 db 0

start:
 mov c hello
 mov d 232
 call print
 hlt

print:
 push a
 push b
 mov b 0
 
loop:
 mov a [c]
 mov [d] a
 inc c
 inc d
 cmp b [c]
 jnz loop

 pop b
 pop a
 ret 

The output generated by this compiler for "Hello World" sample is listed in below and it can execute directly with Marco Schweighauser's 8-bit virtual CPU.

0000    1F0F 4865 6C6C 6F20 576F 726C 6421 0006  
0010    0202 0603 E838 1800 3200 3201 0601 0003  
0020    0002 0503 0012 0212 0315 0102 271F 3601  
0030    3600 3900   

This compiler is implemented using Lazarus / FPC and it is designed to work with different operating systems including Linux and Microsoft Windows.

This 8-bit assembler compiler is an open source, free software project and it is released under the terms of GNU GPL version 3.0 license. All the source codes and Linux based binaries of this project are available to download at https://github.com/dilshan/assembler-compiler.

Thursday, May 11, 2017

Adjustable constant current source

When comes to electronic designing and testing, adjustable current sources facilitates to simulate "load" on circuit(s). The most common use of "constant current source" is to test performance of power supply units and battery packs.

The current source introduced in this article is capable to handle current up to 6A with maximum input voltage of 50V. This is an operational amplifier based adjustable current source and it uses LM358 in a general voltage follower configuration. To handle large currents we use four 0.1Ω 20W resistors as "load resistor", and those load resistors are drive through pair of 55N06 N-channel MOSFET transistors.

Final view of adjustable constant current source prototype.

The power supply unit of this project is build around 9V × 2 (2A) step-down transformer and it is design to get regulated 12V DC voltage. In our design this 12V power source is used to drive LM358 Op-Amp and 12V cooling fan.

In our PCB design we did not include high current paths into PCB track layout. We connect all of of those connections using point-to-point wiring. Large heatsink is recommended for both 0.1Ω load resistors and for 55N06 MOSFET transistors. In our prototype design we use 250mm × 72mm × 50mm heatsink to mount all of those resistors and transistors. To transfer heat we also attach standard 80mm cooling fan into our enclosure.

The schematics, PCB designs and wiring diagrams related to this project is available to download at elect.wikispaces.com.

Sunday, April 16, 2017

Restoration of Philips 852 - 22RH852 turntable / tuner

Philips 852 is tuner, turntable with amplifier which is manufactured by Philips around 1975 - 1977. The tuner stage of this receiver consist with 4 bands such as LW, MW, SW and FM. This unit also comes with dual speed (33⅓, 45 RPM) belt driven turn table. The power amplifier of this unit is delivering 2 × 9W audio output power with pair of 4Ω speakers.

The 852 which we got had problems in power amplifier and turntable mechanism. After tracing the problems in power amplifier, we figure out that both BD262 transistors had short circuits between emitter and collector terminals. Because BD262 is no longer available in the market we replace both NPN and PNP transistor pairs of this amplifier with BD678 and BD679. 

Philips 852 player after cleanup and restoration.

The turntable mechanism of our 852 had many problems due to several missing / damaged parts. Most of the parts are damaged due to corrosion and we fabricate most of them using 3D printer and lathe. The missing antiskate-spring is replaced with modified spring which we got from another broken record player.

After the above fixes Philips 852 start to work again. With large 3 way speaker system this unit produces very good audio quality. The only drawback which we notice with this receiver is it's less sensitive tuner. Compare with most of the receivers SW and FM reception of this receiver is quiet poor, but this can be improve by using good external antennas with this unit.

Friday, March 24, 2017

Enable WebRTC on QtWebEngine for Raspberry Pi 3

WebRTC is a web technology to enable peer to peer communication in real-time. It mainly use to create video conferencing and chat applications using web browsers. In this post we describe how to enable this technology in QtWebEngine on Raspberry Pi 3 platform.

QtWebEngine is embedded browser component which comes with the Qt framework. This component is based on Google Chromium browser and it supports most of the Chromium features including WebRTC. In PC, WebRTC applications run smoothly on QtWebEngine component. But in Raspberry Pi platform situation is different and none of the WebRTC application are work with the QtWebEngine. The only thing which we can see is black box in a HTML5 video tag area. At the time of writing this problem exists in Qt version 5.6, 5.7 and 5.8.

Thursday, January 26, 2017

Reel to reel tape cleaner

Due to advancement of audio technologies reel to reel audio tapes are now classified as a rare item. The biggest problem with the reel to reel tapes are fungus. Fungus are developed on old unused tapes due to humidity exposure. Also another problem with old tapes is that the lubrication on the surface of the tape starts to deteriorate and tape starts to stick to itself, and this leads tape to break during the playback. Most of the that have Fungus can be fixed by using tape cleaner. But these days reel to reel tape cleaners are not available to buy and because of that we decided to build simple tape cleaner by using parts of old reel to reel tape players.

The core component of this player is an induction motor which we got from an old reel to reel player. The motor which we used in this project is Sony HC-134. HC-134 is 100V single-phase, capacitor run, induction motor with 1500 - 1800 RPM. Recommended auxiliary winding capacitor for this motor is 1.5μF. To deliver 100V AC to motor we use 3A, 230V to 100V step down transformer.

Final view of the reel to reel tape cleaner.

Casing and most of the parts of this cleaner is made by using 5mm transparent acrylic sheets. Size of the casing which we made for this cleaner is 300mm × 100mm × 215mm.

To clean 360m long (polyester) tape this cleaner takes 4 to 5min.

Tape before and after cleanup with the cleaner.

High resolution photographs of this reel to reel tape cleaner are available at my flickr.com page.

Tuesday, January 3, 2017

Telefunken HiFi Studio 1 restoration

HiFi Studio 1 is portable boombox manufactured by Telefunken in around 1979. This player consist with 4 band radio (with LW, MW, SW and FM), cassette player / recorder and with 2 × 30W audio power amplifier.

Restored HiFi Studio 1

This unit is designed using both ICs and transistors. Receiver of this unit is build around TDA1047, TBA570 and BA1320 ICs. Tape player/recorder is mainly build using NPN transistors and special Telefunken IC and 4066 ICs are used to get Telefunken's proprietary HIGH COM tape noise reduction feature. Power amplifier of this boombox is transistor based and it uses pair of TIP130 and TIP135 transistors in it's final stage.

Monday, January 2, 2017

Sony TC-252 reel to reel player restoration

TC-252 is 3 speed reel to reel player manufactured by Sony in around 1970 – 1972. This is transistor based tape player with 4W × 2 audio output power, sound-on-sound and sound-with-sound recording features.

The TC-252 which we got to restore had many problems. Major problem is someone alter the circuit in that recorder and attach LA4440 power amplifier into the circuit. Apart from that, motor speed of that recorder also starts to decrease after 10min of continues playback. Other than above two major problems it had some mechanical problems in playback position and all the potentiometers in the front panel are damaged beyond repairing.

TC-252 main PCB after restoration.

As a first step of the restoration we remove the LA4440 module attached into that recorder and rewire the player with original wiring layouts. After rewiring we check all the transistors in that player and find-out that the couple of 2SC634 transistors are damaged in that player. Because 2SC634 is not available in the market we replace those damaged transistors with BC548 transistors.

For the front panel potentiometers we use standard 10K and 20K (log) potentiometers available in the market.

To fix motor speed problems we replace 1.5MFD + 0.5MFD multi-section can capacitor with two separate 1.5MFD and 0.5MFD (450V) AC fan capacitors.

Internal view of restored TC-252 player.

After cleaning and reassembling the mechanical unit TC-252 player starts to work. Compare with most of the reel to reel players TC-252 looks like a basic player, but we really like it's playback audio quality and audio output power.