1 / 22

Hoş Geldiniz

ORT – 104. Hoş Geldiniz. Pic Programlama. Giriş PIC Mikrodenetleyiciler 16F877A & 16F628A Programlama Mantığı PicBasic Pro Değişkenler & Temel Komutlar Koşullar Döngüler Özel Komutlar. Giriş. Giriş. PIC Mikrodenetleyiciler. Yaygın kullanım Yeterli özellikler

muncel
Télécharger la présentation

Hoş Geldiniz

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ORT – 104 Hoş Geldiniz

  2. Pic Programlama • Giriş • PIC Mikrodenetleyiciler • 16F877A & 16F628A • Programlama Mantığı • PicBasic Pro • Değişkenler & Temel Komutlar • Koşullar • Döngüler • Özel Komutlar

  3. Giriş

  4. Giriş

  5. PIC Mikrodenetleyiciler • Yaygın kullanım • Yeterli özellikler • Kolay programlama • Uygun fiyat • Yazılı kaynaklar

  6. PIC 16F877A – 16F628A • Program Hafızası: 3.5 K • RAM: 224 Bytes • EEPROM: 128 Bytes • I/O: 16 • 1 HPWM • Program Hafızası: 14 K • RAM: 368 Bytes • EEPROM: 256 Bytes • I/O: 33 • 2 HPWM

  7. PIC 16F877A – 16F628A

  8. Programlama Mantığı Kod Derleyicisi Hex Kodu Pic Programlayıcı Yazılımı

  9. PicBasic Pro Basic Hex • Kullanımı yaygın • Örnek kodlar çok • ASM’ye göre kullanışlı • Öğrenmesi kolay

  10. Değişkenler 1 bit [0,1] 8 bit [0,255] 16 bit [0,65535] • BIT • BYTE • WORD counter VAR BYTE acik VAR BIT

  11. Sabit Sayılar • %11111010 • 250 • $FA Binary (2’lik sistem) Decimal (10’luk sistem) Hexadecimal (16’lık sistem) Örnek: portb = 250 portb = $FA portb = %11111010

  12. Input - Output TRIS bir portun i/o pinlerini tanımlar INPUT OUTPUT bir pini input veya output yapar

  13. High - Low Pin 5 Volt’a çekilir 500 ms beklenir Pin toprağa çekilir HIGH PortB.0 PAUSE 500 LOW PortB.0

  14. If - Else IF porta.1 = 1 THEN HIGH portb.1 IF porta.1 = 0 THEN LOW portb.1 IFporta.1 = 1THEN HIGH portb.1 ELSE LOW portb.1 ENDIF

  15. For - Next FOR i = 0TO 7' 0’dan 7’e kadar say    HIGH PORTC.0 ' PortC.0 5V PAUSE 10 ' 10 ms bekle LOW PORTC.0 ' PortC.0 0V PAUSE 10 ' 10 ms bekle NEXT i' i’yi arttır, başa dön

  16. PWM • Pulse Width Modulation • PWM Pin,Duty,Cycle % 50 DutyCycle x y PWM PortB.0,127,1000 20Mhz: 1ms 4Mhz: 5ms Döngü sayısı 127/255 Pin Duty cycle

  17. HPWM Portb.3 pini 1. PWM pini olarak tanımlandı DEFINE CCP1_REG PORTB DEFINE CCP1_BIT 3 HPWM 1,127,1000 PWM Frekansı 127/255 1. pin Duty cycle

  18. Pulse • Servo motor sürmek için PULSOUT • komutu kullanılabilir • PULSOUT Pin,Period • Darbe süresi önemlidir • PULSOUT PORTB.5,100 ‘1ms’lik pulse gönder (4mhz) 20Mhz: 2us 4Mhz: 10us

  19. Örnek Kod DEFINE OSC 20 i VAR WORD TRISD=%11111100 MAIN: FORi = 10 TO500 STEP10 IF PortD.3 = 0 THEN HIGHPORTD.0 ELSE LOW PortD.0 ENDIF PAUSE i NEXT GOTO MAIN END

  20. Sorular ?

  21. Projeler • Ginger • Quadropod • Roboweb • ...

  22. Teşekkürler İletişim: e.m.r.e.a.k.g.u.l.eee@gmail.com ishakelmas@gmail.com

More Related