Wednesday, 27 June 2012

MICROCONTROLLER PROGRAMMING TUTORIAL FOR BLINKING LED IN ASSEMBLY LANGUAGE

Microcontroller programming ,my microchip PIC microcontroller in assembly language..,blinking of LED code tutorials in .ASM... examples
                LIST P=16F84A #INCLUDE "P16F84A.INC"
                            ;**** XT    4MHZ
           STATUS = 03H
           PORTA = 05H
           TRISA = 85H
           PORTB = 06H
          TRISB = 86H
          FIL1 = 0CH ;file created
          FIL2 = 0DH ;FILE CREATE
         BSF 03,5
         MOVLW B'00000000' ;BINARY
         MOVWF TRISA ;
         MOVWF TRISB ;PORTB
         BCF 03,5
        CLRF PORTA
        CLRF PORTB
       GOTO START

DELAY
             DECFSZ FIL1,F
           GOTO DELAY
            DECFSZ FIL2,F
           GOTO DELAY
             RETURN

 START
             MOVLW B'00000001' ;ON
            MOVWF PORTB
            CALL DELAY
            MOVLW B'00000000' ;OFF
             MOVWF PORTB
              CALL DELAY
             GOTO START

        END
    SORRY I CANT PASTE THE CIRCUIT FOR THE PROGRAM...BUT I THINK YOU SHOULD BE ABLE TO DESIGN THE CIRCUIT.... A VERY SIMPLE ON AND OFF CIRCUITS... JUST CONNECT A RESISTOR 100R TO RB0 OF PORTB THEN THE OTHER PIN OF THE RESISTOR TO THE POSITIVE OF THE LED THEN THE NEGATIVE OF THE LED GOES TO GROUND OF THE CIRCUIT...THAT'S ALL ABOUT THE DISCO BLINKING LED.... Circuit will be pasted soon

1 comment:

  1. A microcontroller is a single-chip computer. Like any other computer it needs to be programmed before it can do things. The programming is done via a circuit that connects your PC with a microcontroller. Think of it as a little circuit board connected by wires with your PC (to its parallel port, say) as shown in the following picture. There is a place in the circuit where you can insert the microcontroller to be programmed.microcontroller programming tutorial.

    ReplyDelete