Skip to main content

Posts

Showing posts from May, 2017

8-bit assembler compiler project

This project is an assembler compiler to generate a 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 320...

Adjustable constant current source

When comes to electronic designing and testing, adjustable current sources facilitates to simulate "load" on the circuit(s). The most common use of "constant current source" is to test the performance of power supply units and battery packs. The current source introduced in this article is capable to handle current up to 6A with a 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 built around 9V × 2 (2A) step-down transformer and it is designed 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 desig...