Wednesday, June 27, 2018

Tutorial On Using 555 Timer IC As PWM Generator

Welcome, 555 Timer is a versatile timer IC which can perform different operations and has thousands of applications in industry. Today we are going to learn that how can we use 555 timer as PWM generator. Pulse Width Modulation often refered to as PWM, is as the name suggests, is a type of modulation in which we vary the width of digital signal, be it voltage or current, while frequency of output signal remains constant. When the pulse is varied with the passage of time average output voltage change occurs. You can learn more about PWM in power electronics section where PWM finds numbers of applications.


Here in this circuit 555 timer is configured as Astable multi-vibrator with controlled signal, so when the control signal is changed output pulse is changed with constant frequency.

Required Parts:



  • 555 Timer IC
  • Resistors 1k x 2
  • Resistor 10k 
  • Resistor 540 Ohm
  • LED 
  • Potentiometer 10k
  • Capacitor 4.7uf 
  • Breadboard
  • 9 Volt Battery
Please Click on images to view Larger. 
Breadboard Assembly:

Working circuit of 555 Timer IC as Pulse Width Modulation Generator with 9 Volts battery


Schematic Diagram:


Complete Schemetic of 555 Timer as PWM Generator


Questions and suggestions are welcomed in comments sections.

Thursday, June 21, 2018

How to add two double digit Decimal numbers in 8086 assembly | The Easy Way


This program adds two double digits numbers the easy way. Click to download source code
; CODE BEGINS

TITLE TWO_DIGIT_ADDITION 
.MODEL SMALL 
.STACK 100H 
.DATA 
    DIGIT1 DB 0AH, 0DH, "ENTER FIRST DIGIT: $" 
    DIGIT2 DB 0AH, 0DH, "ENTER SECOND DIGIT: $" 
    RESULT DB 0AH, 0DH, "RESULT IS $" 
.CODE 
    MAIN: 
        MOV AX, @DATA 
        MOV DS, AX 
         
        LEA DX, DIGIT1 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
         
        SUB AL, 30H 
        MOV BH, AL 
         
        MOV AH, 01H 
        INT 21H 
         
        SUB AL, 30H 
        MOV BL, AL ; BH:BL FIRST NUMBER 
         
        LEA DX, DIGIT2 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
         
        SUB AL, 30H 
        MOV CH, AL 
         
        MOV AH, 01H 
        INT 21H 
         
        SUB AL, 30H 
        MOV CL, AL ; CH:CL SECOND NUMBER 
         
        ADD BL, CL 
         
        MOV AL, BL 
        MOV AH, 00H 
        AAA 
         
        MOV CL, AL ; LAST DIGIT OF ANSWER 
        MOV BL, AH 
         
        ADD BL, BH 
        ADD BL, CH 
         
        MOV AL, BL 
        MOV AH, 00H 
        AAA 
         
        MOV BX, AX 
       ;MOV BH, AH 
       ;MOV BL, AL 
        
        MOV DX, OFFSET RESULT 
        MOV AH, 09H 
        INT 21H 
         
        MOV DL, BH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, BL 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, CL 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
    EXIT: 
        MOV AH, 04CH 
        INT 21H 
    END MAIN     
         
         
; CODE ENDS


FOLLOWING IS THE OUTPUT OF THE PROGRAM

OUTPUT OF MULTI DIGIT ADDITION PROGRAM WRITTEN IN ASSEMBLY LANGUAGE FREE SOURCE CODE DOWNLOAD

Tuesday, June 19, 2018

8086 Program To Print Text In Assembly

for code explanation please follow how to print text in 8086 assembly code. Thanks



; CODE BEGINS

TITLE TEXT_MESSAGE 
.MODEL SMALL 
.STACK 100H 
.DATA 
 
    MSG DB 0AH, 0DH, "TEXT MESSAGE$" 
.CODE 
    MAIN: 
        MOV AX, @DATA 
        MOV DS, AX 
         
        MOV DX, OFFSET MSG 
        MOV AH, 09H 
        INT 21H        
         
  ;     LEA DX, MSG 
  ;     MOV AH, 09H 
  ;     INT 21H 
         
         
         
         
         
    EXIT:     
        MOV AH, 04CH 
        INT 21H 
    END MAIN 
; CODE ENDS

Following is the output of the program

Output of assembly program which show how the text or character string can be printed in assembly language

Saturday, June 16, 2018

Table Printing In 8086 Assembly With User Input | Version 2

Following code prints the table of the number which the user inputs. This program is an updated version of my previous program. In this program, I have adjusted output formatting as well.
 Feel free to copy the code and use it for your projects and assignments. Furthermore, if you have any queries do let me know in the comments section. Thanks



[READ BEFORE YOU PROCEED] IF YOU ARE A BEGINNER AND LOOKING FOR A SIMPLE TEXT PRINTING PROGRAM. A GREAT TUTORIAL WITH EXPLANATION IS LINKED HERE


[CODE]
TITLE TABLEPRINTING 
.MODEL SMALL 
.STACK 100H 
.DATA 
    MESSAGE DB 0AH, 0DH, "ENTER A NUMBER: $" 
    NOTPROCESS DB 0AH, 0DH, "NOT A VALID DIGIT, CANNOT PROCES$" 
    AGAIN DB 0AH, 0DH, "REPEAT?(Y/N): $" 
.CODE 
 
    MAIN: 
        MOV AX, @DATA 
        MOV DS, AX 
         
        LEA DX, MESSAGE 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
         
        MOV CH, 0AH 
        MOV CL, 00H       
         
        CMP AL, 3AH 
        JGE NOT_PRO 
        SUB AL, 30H 
        MOV BH, AL 
        MOV BL, 01H 
  NEXT: 
                    
        MOV DL, 0DH 
        MOV AH, 02H 
        INT 21H            
         
        MOV DL, 0AH 
        MOV AH, 02H 
        INT 21H            
         
        MOV DL, '0' 
        MOV AH, 02H 
        INT 21H 
         
         
        MOV DL, BH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, '*' 
        MOV AH, 02H 
        INT 21H 
         
         
        MOV AL, BL 
        MUL BH 
         
        AAM 
         
        PUSH AX 
        
         
        MOV AH, 00H 
        MOV AL, BL 
        AAA 
         
         
         
        MOV CL, AH 
        MOV BL, AL 
         
         
        MOV DL, CL 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, BL 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
  RESULT:       
        MOV DL, '=' 
        MOV AH, 02H 
        INT 21H 
         
        ;----------------------- 
         
        POP AX 
         
        MOV DH, AL 
        MOV DL, AH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
        MOV DL, DH 
        ADD DL, 30H 
        MOV AH, 02H 
        INT 21H 
         
         
        ;----------------------- 
         
        INC BL 
        DEC CH 
        CMP CH, 00H 
        JNE NEXT 
        JMP QUESTION 
   NOT_PRO: 
        LEA DX, NOTPROCESS 
        MOV AH, 09H 
        INT 21H 
         
   QUESTION: 
        LEA DX, AGAIN 
        MOV AH, 09H 
        INT 21H 
         
        MOV AH, 01H 
        INT 21H 
         
        OR AL, 20H 
         
        CMP AL, 'y' 
        JNE EXIT 
        JMP MAIN 
   EXIT:          
        MOV AH, 04CH 
        INT 21H
  END MAIN
[/CODE]

output of the program


Output of the assembly program which prints multiplication table of any given number in assembly language

Complete Video Tutorials