منتدى كلية الهندسة الألكترونيه

هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

شارك تعلم استمتع حيث العلم والفائده


2 مشترك

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 3:30 am


    PIC Circuits Gallery
    LED flasher
    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Line_001


    I made LED flash circuit which is often used as the PIC software making practice.
    This circuit controls the blink of eight LEDs with the software of PIC.
    The blinking pattern can be changed with five switches.









    Pattern 1LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11v
    Pattern 2LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11w
    Pattern 3LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11x
    Pattern 4LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11y
    Pattern 5LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11z


    عدل سابقا من قبل في 23/11/2007, 10:48 am عدل 2 مرات
    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 3:31 am

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_12 LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_13
    SpecificationPICProcessor FrequencyLEDBlink pattern
    PIC16F84A
    10MHz
    High brightness LED x 8
    Five kinds
    شكل الدائره من أعلى
    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11


    عدل سابقا من قبل في 21/11/2007, 4:17 am عدل 1 مرات
    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 3:37 am



    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11a

    <hr width="50%" noShade>


    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Blank_1
    Pattern drawing of LED flasher
    (Wiring side)

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_11b
    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 3:41 am

    Circuit explanation of LED flasher
    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Line_001

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Bol_grn Key-in circuit

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_121
    Five pins from RA0 to RA4 are used as the input pin.
    These pins are pull-uped with 10K ohm resisters. So, when a switch isn't pushed, the input becomes H level ( +5V ). and when a switch is pushed, it will become L level ( 0V ). When the switch closes, the chattering occurs. The chattering is the phenomenon which occurs with the bound of the point of contact. The opening and shutting of a point of contact is repeated in short time..
    I don't put the prevention circuit of the chattering at the circuit this time. When the software detects that the switch is closed once, the blink processing of LEDs are executed in the time which is longer than the chattering.



    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Blank_1
    <hr width="50%" noShade>

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Bol_grn LED control circuit

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_122
    Eight pins from RB0 to RB7 are used for the output pin.
    The anode side of the LED is connected with +5 V and the cathode side is controlled by PIC via the resistor. So, when the output of PIC is H level (+5V), the LED goes out and when the output of PIC is L level (0V), the LED lights up. I am using high brightness type LED to make an current flow little.



    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Blank_1
    <hr width="50%" noShade>

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Bol_grn Clock generator circuit

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_123
    This is the circuit which used 10-MHz resonator.
    It is very simple.



    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Blank_1
    <hr width="50%" noShade>

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Bol_grn Power supply circuit

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_124
    3 terminal regulator is used to get +5V output from +12V power in.
    Because it is suppressing the current of the LED, a 100 mA-type regulator is enough.


    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 3:44 am

    Software flow chart of LED flasher
    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Line_001


    This is the flow chart which showed the outline of the software processing.
    In case of the software with scale this time, there is no need to make a flow chart.
    The whole processing can be understood only by the list.
    I made this flow chart as the practice.
    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pic6_14e
    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 3:58 am

    ;********************************************************
    ;
    ; The LED flash control processing
    ;
    ; Author : Seiichi Inoue
    ;********************************************************
    list p=pic16f84a
    include p16f84a.inc
    __config _hs_osc & _wdt_off & _pwrte_on & _cp_off
    errorlevel -302 ;Eliminate bank warning
    ;**************** Label Definition ********************
    ra0 equ 00 ;RA0 bit
    ra1 equ 01 ;RA1 bit
    ra2 equ 02 ;RA2 bit
    ra3 equ 03 ;RA3 bit
    ra4 equ 04 ;RA4 bit
    cnt500u equ 0c ;500usec counter Address
    cnt1m equ 0d ;1msec counter Address
    cnt100m equ 0e ;100msec counter Address
    cnt500m equ 0f ;500msec counter Address
    cnt1s equ 10 ;1sec counter Address
    ;************* Pattern Data Definition ****************
    ; '1':OFF '0':ON
    ;****** Pattern 0 ******
    p00 equ b'11111110'
    p01 equ b'11111101'
    p02 equ b'11111011'
    p03 equ b'11110111'
    p04 equ b'11101111'
    p05 equ b'11011111'
    p06 equ b'10111111'
    p07 equ b'01111111'
    ;****** Pattern 1 ******
    p10 equ b'01111111'
    p11 equ b'10111111'
    p12 equ b'11011111'
    p13 equ b'11101111'
    p14 equ b'11110111'
    p15 equ b'11111011'
    p16 equ b'11111101'
    p17 equ b'11111110'
    ;****** Pattern 2 ******
    p20 equ b'01111110'
    p21 equ b'10111101'
    p22 equ b'11011011'
    p23 equ b'11100111'
    p24 equ b'11011011'
    p25 equ b'10111101'
    p26 equ b'01111110'
    ;****** Pattern 3 ******
    p30 equ b'11111110'
    p31 equ b'11111101'
    p32 equ b'11111010'
    p33 equ b'11110101'
    p34 equ b'11101010'
    p35 equ b'11010101'
    p36 equ b'10101010'
    p37 equ b'01010101'
    p38 equ b'10101011'
    p39 equ b'01010111'
    p3a equ b'10101111'
    p3b equ b'01011111'
    p3c equ b'10111111'
    p3d equ b'01111111'
    ;****** Pattern 4 ******
    p40 equ b'00000000'
    p41 equ b'11111111'
    p42 equ b'00000000'
    p43 equ b'11111111'
    p44 equ b'00000000'
    p45 equ b'11111111'
    p46 equ b'00000000'
    p47 equ b'11111111'
    p48 equ b'00000000'

    ;**************** Program Start ***********************
    org 0 ;Reset Vector
    goto init
    org 4 ;Interrupt Vector
    goto init
    ;**************** Initial Process *********************
    org 5
    init bsf status,rp0 ;Change to Bank1
    movlw h'ff' ;Set input mode data
    movwf trisa ;Set PORTA to Input mode
    clrf trisb ;Set PORTB to Output mode
    bcf status,rp0 ;Change to Bank0
    movlw h'ff' ;Set LED off data
    movwf portb ;Output data
    ;**************** Key Scan Process ********************
    keyscan btfss porta,ra0 ;RA0 ON(Low lebel) ?
    call ptn0 ;Yes. Call Pattern 0
    btfss porta,ra1 ;RA1 ON ?
    call ptn1 ;Yes. Call Pattern 1
    btfss porta,ra2 ;RA2 ON ?
    call ptn2 ;Yes. Call Pattern 2
    btfss porta,ra3 ;RA3 ON ?
    call ptn3 ;Yes. Call Pattern 3
    btfss porta,ra4 ;RA4 ON ?
    call ptn4 ;Yes. Call Pattern 4
    goto keyscan ;Retry
    ;*********** Pattern 0 Output Subroutine ***************
    ptn0 movlw p00 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p01 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p02 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p03 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p04 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p05 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p06 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p07 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw h'ff' ;Set LED off data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    return
    ;*********** Pattern 1 Output Subroutine ***************
    ptn1 movlw p10 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p11 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p12 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p13 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p14 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p15 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p16 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p17 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw h'ff' ;Set LED off data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    return
    ;*********** Pattern 2 Output Subroutine ***************
    ptn2 movlw p20 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p21 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p22 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p23 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p24 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p25 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p26 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw h'ff' ;Set LED off data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    return
    ;*********** Pattern 3 Output Subroutine ***************
    ptn3 movlw p30 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p31 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p32 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p33 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p34 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p35 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p36 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p37 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p38 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p39 ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p3a ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p3b ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p3c ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw p3d ;Set pattern data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    movlw h'ff' ;Set LED off data
    movwf portb ;Output data
    call t100m ;Wait 100msec
    return
    ;*********** Pattern 4 Output Subroutine ***************
    ptn4 movlw p40 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p41 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p42 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p43 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p44 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p45 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p46 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p47 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw p48 ;Set pattern data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    movlw h'ff' ;Set LED off data
    movwf portb ;Output data
    call t1s ;Wait 1sec
    return
    ;********************************************************
    ; Timer Subroutine for 10MHz clock
    ;********************************************************
    ;************* 1msec Timer Subroutine *****************
    t1m movlw d'2' ;(1) Set loop cnt1
    movwf cnt1m ;(1) Save loop cnt1
    tm1lp1 movlw d'249' ;(1)*2 Set loop cnt2
    movwf cnt500u ;(1)*2 Save loop cnt2
    tm1lp2 nop ;(1)*249*2 Time adjust
    nop ;(1)*249*2 Time adjust
    decfsz cnt500u,f ;(1)*249*2 cnt500u-1=0 ?
    goto tm1lp2 ;(2)*248*2 No, continue
    decfsz cnt1m,f ;(1)*2 cnt1m-1=0 ?
    goto tm1lp1 ;(2) No. Continue
    return ;(2) Yes. Cnt end
    ;Total 2501*0.4usec=1msec
    ;************* 100msec Timer Subroutine ***************
    t100m movlw d'100' ;Set loop counter
    movwf cnt100m ;Save loop counter
    tm2lp call t1m ;1msec subroutine
    decfsz cnt100m,f ;cnt100m - 1 = 0 ?
    goto tm2lp ;No. Continue
    return ;Yes. Count end

    ;************* 500msec Timer Subroutine ***************
    t500m movlw d'5' ;Set loop counter
    movwf cnt500m ;Save loop counter
    tm3lp call t100m ;100msec subroutine
    decfsz cnt500m,f ;cnt500m - 1 = 0 ?
    goto tm3lp ;No. Continue
    return ;Yes. Count end
    ;************** 1sec Timer Subroutine *****************
    t1s movlw d'2' ;Set loop counter
    movwf cnt1s ;Save loop counter
    tm4lp call t500m ;500msec subroutine
    decfsz cnt1s,f ;cnt1s - 1 = 0 ?
    goto tm4lp ;No. Continue
    return ;Yes. Count end

    ;********************************************************
    ; END of LED flash control processing
    ;********************************************************
    end


    عدل سابقا من قبل في 21/11/2007, 4:13 am عدل 2 مرات
    Admin
    Admin
    Admin
    Admin


    ذكر
    عدد الرسائل : 699
    العمر : 38
    الكليه/الفرقه/العمل : طالب في كلية الهندسه الألكترونيه الفرقهالرابعه قسم تحكم
    المزاج : LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Pi-ca-20
    تاريخ التسجيل : 03/09/2007

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف Admin 21/11/2007, 4:02 am

    للتحمييييييييييييييييييييييييييييييييييييييييييييييييييييييييييييل أضغط هنا



    led_source.zip
    led_hex.zip

    the lion
    the lion


    ذكر
    عدد الرسائل : 3
    العمر : 33
    تاريخ التسجيل : 12/02/2008

    LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي Empty رد: LED FLASHER الدائره مطبوعه_نظريه_المكونات_البرنامج بالأسمبلي

    مُساهمة من طرف the lion 4/9/2009, 4:18 am

    ماشاء الله
    مجهود رائع
    ولكن هل من مزيد

      الوقت/التاريخ الآن هو 29/3/2024, 12:14 pm