13 Eylül 2010 Pazartesi

Pic ile Bipolar Step Motor Kontrolü

Pic ile Bipolar Step Motor Kontrolü



 
pic ile bipolar step motor kontrolü
İleri Yönde hareketGeri Yönde hareket
Step#Q2-Q3Q1-Q4Q6-Q7Q5-Q8
Step 1ONOFFONOFF
Step 2OFFONONOFF
Step 3OFFONOFFON
Step 4ONOFFOFFON
Step#Q2-Q3Q1-Q4Q6-Q7Q5-Q8
Step 1ONOFFOFFON
Step 2OFFONOFFON
Step 3OFFONONOFF
Step 4ONOFFONOFF


ASM kodu

        list    p=PIC16C84
        __config h´3ff9´
        org    0x2008
        dw     h´0001´
        include
       
count   equ     0x0c              
dly1    equ     0x0d
dly2    equ     0x0e
        org     0               ;reset vector
        goto    start           ;go to beginning of program on reset
        org     5               ;start of code space

start   bsf     STATUS,RP0      ;_select_register bank 1
        movlw   0xf0            ;rb0-rb3 output (stepper), rb4-rb7 input (switch)
        movwf   TRISB           ;portb all output
        bsf     OPTION_REG,NOT_RBPU ;disable pullups
        bcf     STATUS,RP0      ;_select_register bank 0
        movlw   0x00            ;start with everything off
        movwf   PORTB

loop    call    gofwd
        call    gobwd
        goto    loop

gofwd   movlw   d´6´
        movwf   count
loopf
        movlw   0x0a            ;q2-q3 on, q1-q4 off, q6-q7 on, q5-q8 off
        movwf   PORTB
        call    delay
        movlw   0x06            ;q2-q3 off, q1-q4 on, q6-q7 on, q5-q8 off
        movwf   PORTB
        call    delay
        movlw   0x05            ;q2-q3 off, q1-q4 on, q6-q7 off, q5-q8 on
        movwf   PORTB
        call    delay
        movlw   0x09            ;q2-q3 on, q1-q4 off, q6-q7 off, q5-q8 on
        movwf   PORTB
        call    delay
        decfsz  count,1
        goto    loopf
        return

gobwd
        movlw   d´6´
        movwf   count
loopb
        movlw   0x09            ;q2-q3 on, q1-q4 off, q6-q7 off, q5-q8 on
        movwf   PORTB
        call    delay
        movlw   0x05            ;q2-q3 off, q1-q4 on, q6-q7 off, q5-q8 on
        movwf   PORTB
        call    delay
        movlw   0x06            ;q2-q3 off, q1-q4 on, q6-q7 on, q5-q8 off
        movwf   PORTB
        call    delay
        movlw   0x0a            ;q2-q3 on, q1-q4 off, q6-q7 on, q5-q8 off
        movwf   PORTB
        call    delay
        decfsz  count,1
        goto    loopb
        return
delay   swapf   PORTB,0        
        andlw   0x0f           
        movwf   dly1
delay1  clrf    dly2
delay2  nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        decfsz  dly2,1
        goto    delay2
        decfsz  dly1,1
        goto    delay1
        return
        end

ASM kodu sonu.

Hiç yorum yok:

Yorum Gönder

İzleyiciler

LED DİRENÇ HESAPLAMA

All LEDs require current limiting, without a current limiting mechanism the LED will usually burn out in under a second. Adding a simple resistor is the easiest way to limit the current. Use the calculator below to find out the value of resistor you require.

For example if you are wanting to power one of our_blank">red LEDs in an automotive application you would see that the typical forward voltage is 2.0 Volts and the maximum continuous forward current is 30mA. Therefore you would enter 14.5, 2.0 and 30 into the Single LED calculation box. After calculating you get 470ohm 1 watt as the result. Here is a that allows you to enter a resistor value and generate the corresponding color code.

Note: For automotive applications use the actual system voltage, not 12 Volts. Most 12 Volt system actually operate at around 14.5 Volts.

Supply Voltage
VOLTS
Voltage Drop Across LED
VOLTS
Desired LED Current
MILLIAMPS



Calculated Limiting Resistor
OHMS
Nearest higher rated 10% resistor

Calculated Resistor Wattage
WATTS
Safe pick is a resistor with
power rating of (common values are .25W, .5W, and 1W)
WATTS

LEDs in series

Several leds in series with one resistor
Supply Voltage
VOLTS
Voltage Drop Across LED
VOLTS
Desired LED Current
MILLIAMPS
How many LEDs connected




Calculated Limiting Resistor
OHMS
Nearest higher rated 10% resistor

Calculated Resistor Wattage
WATTS
Safe pick is a resistor with
power rating of (common values are .25W, .5W, and 1W)
WATTS
LM317 UYGULAMA DEVRELERİ HESAPLAMASI

 




Çıkış Voltajı
R1 resistor

R2 resistor

R1 resistor
R2 resistor

Çıkış Voltajı


Lm317 uygulama devreleri ve detayli bilgiye Buradan ulasabilirsiniz

LM555 - ASTABLE OSCILLATOR CALCULATOR

LM555 - ASTABLE OSCILLATOR CALCULATOR
Value Of R1 Ohms Value Of R2 Ohms
Value Of C1 Microfarads
Output Time HIGH SECONDS Output Time LOW SECONDS Output Period HIGH + LOW SECONDS Output Frequency HERTZ Output Duty Cycle PERCENT
Resistor values are in Ohms (1K = 1000) - Capacitor values are in Microfarads (1uF = 1)

NOTE: The leakage currents of electrolytic capacitors will affect the actual output results of the timers. To compensate for leakage it is often better to use a higher value capacitor and lower value resistances in the timer circuits.

LM555 Astable Oscillator Circuit Diagram


LM555 - ASTABLE CAPACITOR CALCULATOR

The next calculator can find the capacitance needed for a particular output frequency if the values of R1 and R2 are known.

Value Of R1 Ohms Value Of R2 Ohms
Frequency Desired Hertz
Capacitance uF
s

VOLT AMPER OHM ve WATT HESAPLAMA

Current:
kA (kiloamps) A (amps) mA (milliamps) µA (microamps)
Voltage:
kV (kilovolts) V (volts) mV (millivolts) µV (microvolts)