L298 PIC16F628 Geri beslemeli motor kontrol pwm

| Mayıs 26, 2023 Tarihinde güncellendi
L298 PIC16F628 Geri beslemeli motor kontrol pwm

Devre L298 (köprü bağlantılı motor sürücü) ve pic16f628 mikro denetleyici üzerine kurulu durdur,ani dur,başlat,arttır,bitir,ileri,geri kontrolleri var fren konumunda ki motoru jeneratör durumuna düşmesi durumunda enerjiyi pile tekrar gönderiyor yazılım assembly dili ile hazırlanmış .asm .hex ve proteus isis .DSN dosyaları bulunmakta

PCBway Türkiye PCB Manufacturer PCB Assembly

Geribeslemeli sürücü devre şeması
geri-beslemeli-motor-surucu

ASM Yazılımı

LIST 		P=16F628A
INCLUDE		"P16F628A.INC"
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT &_MCLRE_ON & _BODEN_OFF & _LVP_OFF & _DATA_CP_OFF


BELLEK		EQU		H'20'

SAYAC1		EQU		H'21'
SAYAC2		EQU		H'22'

PWM_DEGER	EQU		H'23'
BASLANGIC	EQU		H'24'

		ORG		0
		CLRF		PCLATH
		goto		ANA_PROGRAM

PWM_BASLAT	
		MOVLW		D'7'			;PR2 DEGERİ
		BANKSEL		PR2
		MOVWF		PR2
		BANKSEL		CCP1CON	
		CLRF		CCPR1L
		MOVLW		D'7'			; TIMER2 000001(11) = 4 + 3 = 7
		BANKSEL		T2CON
		MOVWF		T2CON
		RETURN
		
PWM_AYARLA	
		BANKSEL		PWM_DEGER
		MOVF		PWM_DEGER,W
		ANDLW		D'3'			; CCP1X+CCP1Y
		MOVWF		BELLEK
		SWAPF		BELLEK,W
		ANDLW		H'F0'
		BANKSEL		CCP1CON
		MOVWF		CCP1CON
		IORLW		H'0C'
		MOVWF		CCP1CON
		MOVF		PWM_DEGER, w
		MOVWF		BELLEK
		RRF		BELLEK,F
		RRF		BELLEK,W
		ANDLW		H'3F'
		MOVWF		CCPR1L
		RETURN
PWM_BITIR	
		BANKSEL		T2CON
		CLRF		T2CON
		CLRF		CCP1CON
		BANKSEL		PORTB
		BSF		PORTB,3
		RETURN
PIC_AYAR
		BANKSEL		TRISA
		CLRF 		TRISB
		MOVLW		H'FF'
		MOVWF		TRISA
		BANKSEL		PORTB
		CLRF		PORTB
		MOVLW		H'07'
		MOVWF		CMCON
		RETURN
ANA_PROGRAM
		CALL		PIC_AYAR
		MOVLW		D'16'			; PWM DUTY CYCYLE (MAKSİMUM 32)
		BANKSEL		PWM_DEGER
		MOVWF		PWM_DEGER
BUT_BASLAT
		BANKSEL		PORTA
		BSF		BASLANGIC,0
		MOVLW		D'140'
		MOVWF		SAYAC1
		BTFSC		PORTA,0
		GOTO 		BUT_BASLAT
		CALL		PWM_BASLAT
		CALL		PWM_AYARLA
		BANKSEL		PORTA
BUT_YONI
		BTFSS		PORTA,4
		GOTO		BUT_YONG
		BTFSS		PORTB,0		;	PORTB'NİN 1.BİTİ 0 ISE KODLA
		GOTO		BUT_YONI2
		BTFSS		PORTB,1		;	PORTB'NİN 1 VE 2.BİTİ 1 İSE KODLA
		GOTO		BUT_YONG
BUT_YONI2
		BSF		PORTB,0
		BCF		PORTB,1
		CALL		PWM_BITIR
		BANKSEL		SAYAC1
		MOVLW		D'03'
		BTFSS		BASLANGIC,0
		MOVWF		SAYAC1		;	GECIKME AYAR
		BCF		BASLANGIC,0
		CALL		GECIKME
		CALL		PWM_BASLAT
		CALL		PWM_AYARLA			
BUT_YONG
		BANKSEL		PORTA
		BTFSC		PORTA,4
		GOTO		BUT_DUR
		BTFSC		PORTB,0		;	PORTB'NİN 1.BİTİ 1 ISE KODLA
		GOTO		BUT_YONG2
		BTFSC		PORTB,1		;	PORTB'NİN 1 VE 2.BİTİ 0 İSE KODLA
		GOTO		BUT_DUR
BUT_YONG2
		BCF		PORTB,0
		BSF		PORTB,1
		CALL		PWM_BITIR
		BANKSEL		SAYAC1
		MOVLW		D'03'	
		BTFSS		BASLANGIC,0
		MOVWF		SAYAC1		;	GECIKME AYAR
		BCF		BASLANGIC,0
		CALL		GECIKME
		CALL		PWM_BASLAT
		CALL		PWM_AYARLA
BUT_DUR
		BANKSEL		PORTA
		BTFSC		PORTA,1
		GOTO		BUT_ANIDUR
		BCF		PORTB,0
		BCF		PORTB,1
		CALL		PWM_BITIR
		GOTO		BUT_BASLAT
BUT_ANIDUR
		BTFSC		PORTA,6
		GOTO		BUT_ARTIR
		BSF		PORTB,0
		BSF		PORTB,1
		CALL		PWM_BITIR
		GOTO		BUT_BASLAT
BUT_ARTIR	
		BTFSC		PORTA,2
		GOTO		BUT_AZALT
		MOVLW		H'1F'			;PWM COZUNURLUK LOG((PR2 + 1)*(4)) / LOG(2)
		BCF		STATUS,C
		SUBWF		PWM_DEGER,W
		BTFSS		STATUS,C
		INCF		PWM_DEGER,f
		MOVLW		D'10'
		MOVWF		SAYAC1
		CALL		GECIKME
		CALL		PWM_AYARLA
BUT_ARTIR2	BTFSS		PORTA,2
		GOTO		BUT_ARTIR2
BUT_AZALT	
		BTFSC		PORTA,3
		GOTO		BUT_YONI
		MOVF		PWM_DEGER
		SUBLW		D'0'
		BTFSS		STATUS,C
		DECF		PWM_DEGER,f
		MOVLW		D'10'
		MOVWF		SAYAC1
		CALL		GECIKME
		CALL		PWM_AYARLA
BUT_AZALT2	BTFSS		PORTA,3
		GOTO		BUT_AZALT2
		GOTO		BUT_YONI
GECIKME
		MOVLW		D'80'
		MOVWF		SAYAC2
GECIKME2	
		DECFSZ		SAYAC2,F
		GOTO		GECIKME2
		DECFSZ		SAYAC1,F
		GOTO		GECIKME
		RETURN

		END
l298-pic16f628-geri-beslemeli-motor-kontrol-pwm

Şifre-Pass: 320volt.com

Yayım tarihi: 2009/04/04 Etiketler: , , , , ,



7 Yorum “L298 PIC16F628 Geri beslemeli motor kontrol pwm

  1. akrepkralphpakrepkralphp

    arkadaşlar devreyi çaşlıştırabilen var mı ? Simülasyonda hata mı var acaba ?! Starta basıp başlatınca CPU error diye hata verior

    CEVAPLA
  2. Yasin ErgeneYasin Ergene

    Geri beslemeden kasıt motor devrinin korunmasıdır?
    Eğer öyle ise herhangi bir alıcı sensör devrede görünmüyor…
    Nasıl yapılıyor geri besleme bu devrede.

    CEVAPLA
  3. emir28emir28

    arkadaşlar burada devrenin kendisi de güzel mantığı da harika diyebilirim … benim öğrenmek istediğim bir şey daha var. devre şeması üzerinde herhangi bir değişiklik yapılması kilitlenmiş bu da benim çok hoşuma gitti. bunun nasıl yapıldığı konusunda yardımcı olursanız çok memnun olurum …

    CEVAPLA
  4. gevvgevv Yazar

    @emir28 ilk başda ne demek istediğinizi anlamadım ama dosyayı farklı kaydetmek istediğimde isis bir uyarı verdi

    “”””
    the file xx.dsn is read only any work must be saved to a different desing file
    “”””

    uyarıya OK diyip masa üstüne kayıt ettim kayıt edilen dosyayı açıp düzenledim uyarı mesajı vermedi kayıt ettim yine mesaj gelmedi dosyayı açtım yaptığım değişiklikler olduğu gibi duruyordu

    sanırım değişiklik için bir koruma ama yeni versiyonda etkili olmamış

    kullanıcının ayarladığı bir durum sanırım isis help menüsünde library menüsünden bahsediliyor help menüsünde read only olarak arama yapın detaylı açıklamalar var

    Warning Message:

    Device ‘x’ was found in a read-only library ‘y’.
    Where ‘x’ is the name of the device you are packaging and ‘y’ is the name of a device library that is set as read-only.

    Cause:
    The device for which you are trying to assign packages exists in a library that is read-only. This is either because it is in a library supplied with the software, because you have specified one of your own libraries to be read-only, or because your user permissions prevent you from writing to the library.

    Solution:
    The purpose of this warning is to indicate that if you now store the part in a writable library, the same named device will be in two different libraries and this will may lead to ambiguities later on.
    At the stage of getting the warning message it is probably best to immediately store the newly packaged device in any suitable writable library and then resolve the issue as follows:

    · If the original part exists in one of the system libraries (i.e. a library supplied with the software) then use the Library Manager (launched from the Library menu) to change the name of the newly packaged device such that its name is unique.

    · If the part exists in one of your own user libraries which is set to read-only then use the Library Manager (launched from the Library menu) to temporarily remove the read-only setting on the library and to then move the part from the library you saved it in to your own library and then restore the read-only setting.

    · If your access permissions prevent you from writing to the library you will need to contact your Network Administrator to resolve the issue.

    The text at the top of a library list box indicates whether the specified library is read-only. Read-only libraries can only be used as a Source or Primary Library – you can still select a read-only library as a Destination (Secondary) Library, but the buttons that affect the library (e.g. Copy) will not be enabled. The text at the bottom of a library list box indicates the number of items in the library and the number of remaining entries in the library index.

    CEVAPLA

Yasin Ergene için bir yanıt yazın Yanıtı iptal et

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir