Microprocessors and Programming Department of Mechatronics Engineering

Slides:



Advertisements
Benzer bir sunumlar
I ASİMO I ASİMO PREPARED: CENGİZ MURAT TEKİNBÜĞRÜ English Course Presentation TURKEY Mechatronics Engineering at SAKARYA UNIVERSITY PREPARED: CENGİZ.
Advertisements

Üniversitemiz Öğrenci Bilgi Sistemine Kullanıcı Adı (Öğrenci Numarası ) ve tarafınızdan belirlenen Şifre ile giriş yapılır; You can have access to Student.
Atama ve eşleme (eşleştirme) problemleri (Matching and Assignment problems)
Logical Design Farid Rajabli.
Bir Problemin Programa Dönüştürülme Süreci
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets, 5e By Douglas E. Comer Lecture PowerPoints.
Hareket halindeki insanlara ulaşın.Mobil Arama Ağı Reklamları Reach customers with Mobile Search Network.
.NET Framework 2.0 Öğr. Gör. Dr. Mustafa Cem Kasapbaşı Hafta 1 Ref Beginning ASP.NET 2.0 in C# 2005 From Novice to Professional İnternet Programlama Dilleri.
Bağımlı talep için envanter sistemleri (MRP sistemi)
Bilgisayarlar kodu nasıl işler?
COMPANY Veritabanı Örneği (Gereksinimler)
INTRODUCTION TO JAVASCRIPT. JAVASCRIPT ► JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies,
Programlama Fonksyionları
COSTUMES KILIKLAR (KOSTÜMLER)
Doç. Dr. Cemil Öz SAÜ Bilgisayar Mühendisliği Dr. Cemil Öz.
Veri Yapıları ve Algoritmalar
BM-305 Mikrodenetleyiciler Güz 2015 (6. Sunu) (Yrd. Doç. Dr. Deniz Dal)
Yapısal Programlama Yüksek Düzeyli Dillerin Gelişim Süreci – , Fortran (by IBM), for creating scientific and engineering applications, first commercial.
S ÜLEYMAN Ş AH ÜN İ VERS İ TES İ DERS KAYIT İŞ LEMLER İ / COURSE REGISTRATION PROCESS.
21/02/2016 A Place In My Heart Nana Mouskouri « Istanbul « (A Different Adaptation)
Kayhan DURSUN Mantıksal Devre Tasarımı Dersi 6.Bölüm Cevapları
GPIO Burhan Baraklı.
  Shifting deictic centre as source of ambiguity: (20) [on the phone]: There’s a hospital at the opposite end of town.  (21) [letter.
AVRUPA BİRLİĞİ GUNDTVİG ÖĞRENME ORTAKLIĞI ‘ALTIN ÇOCUKLAR ALTIN EBEVEYNLER’ PROJESİ EUROPEAN UNION GRUNDTVIG LEARN PARTNERSHIP GOLDEN PARENTS FOR GOLDEN.
Improvement to Rankine cycle
CHILD PORNOGRAPHY IŞIK ÜNİVERSİTESİ
Microsoft Azure IoT ve hayatımıza etkileri
INTRODUCTION TO JAVASCRIPT
Self-Registration on the Coats Supplier Portal
İSTATİSTİK II Hipotez Testleri 1.
Paralel Programlamaya Giriş
Motor Sürücü Devresi ile Kontrol
INTRODUCTION TO JAVASCRIPT
BM-305 Mikrodenetleyiciler Güz 2016 (7. Sunu)
Mekatronik Mühendisliği
TREATMENT/TRETMAN.
GÜÇ ELEKTRONİĞİ II Anahtarlamalı Mod DC-AC Inverterler
LEFM and EPFM LEFM In LEFM, the crack tip stress and displacement field can be uniquely characterized by K, the stress intensity factor. It is neither.
MİkroİŞlemcİler ve programlanmasI Mekatronik Mühendisliği Bölümü
Mikroişlemci Sistemleri
Ac POWER ANALYSIS Part III..
Bilgisayarlar kodu nasıl işler?
MİkroİŞlemcİler ve programlanmasI Mekatronik Mühendisliği Bölümü
MİkroİŞlemcİler ve programlanmasI Mekatronik Mühendisliği Bölümü
Bir Problemin Programa Dönüştürülme Süreci
Microprocessors and Programming Department of Mechatronics Engineering
Ders 7 Arduino Genel Amaçlı Giriş-Çıkış Bacakları
INTRODUCTION TO JAVASCRIPT
taşınabilir Akilli Tahta Kullanım kılavuzu
Sayı sistemleri Dijital elektroniğin öğrenilmesi için ilk olarak sayı sistemlerini çok iyi bir şekilde bilmesi gerekir. Sayı sistemleri Dijital Elektroniğin.
Döngüler ve Shift Register
NİŞANTAŞI ÜNİVERSİTESİ
NİŞANTAŞI ÜNİVERSİTESİ
The Need for Program Design
“am, is, are”.
BİLL GATES Şule Eslem ÖZTÜRK NUN OKULLARI Prep-A.
NİŞANTAŞI ÜNİVERSİTESİ
(Dr. Öğr. Üyesi Deniz Dal)
Yapısal Programlama Yüksek Düzeyli Dillerin Gelişim Süreci
Chapter 5 – Balancing of accounts
Chapter 4 - The effect of profit or loss on capital and double entry system for expenses and revenues Bölüm 4 – Kâr ve zararın sermaye üzerindeki etkisi.
Imagine that you are a teacher and you are taking your 20 students to England for the summer school.
THE MYSTERIOUS ISLAND JULES VERNE. INFORMATION ABOUT THE BOOK  Name of the book: The Mysterious Island  Author: Jules Verne  Type: Adventure  Number.
Bilgisayarlar kodu nasıl işler?
SUBJECT NAME Prepeared by Write the names of group members here
NİŞANTAŞI ÜNİVERSİTESİ
pnpn Yapılı Elektronik Elemanlar ve Diğerleri
Microprocessors and Programming Department of Mechatronics Engineering
MİkroİŞlemcİler ve programlanmasI Mekatronik Mühendisliği Bölümü
TWINSPACE Anthony RIOU Coşku AKER TR Teacher Multilateral Contact Seminar, İ zmir, April 2019.
Sunum transkripti:

Microprocessors and Programming Department of Mechatronics Engineering Lecture 1 1 Microprocessors and Programming Dr. Kadir ERKAN Department of Mechatronics Engineering Fall : 2017 9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

Synchronous communication When using the synchronous communication – the information is transmitted from the transmitter to the receiver: in sequence bit after bit with fixed baud rate and the clock frequency is transmitted along with the bits That means that the transmitter and the receiver are synchronized between them by the same clock frequency. The clock frequency can be transmitted along with the information, while it is encoded in the information itself, or in many cases there is an additional wire for the clock. This type of communication is faster compare to the asynchronous communication since it is "constantly transmitting” the information, with no stops. 9/11/2018

Asynchronous communication When using the asynchronous communication - the transmitter and the receiver refraining to transmit long sequences of bits because there isn't a full synchronization between the transmitter, that sends the data, and the receiver, that receives the data. In this case, the information is divided into frames, in the size of byte. Each one of the frame has: “Start” bit marks the beginning of a new frame. “Stop” bit marks the end of the frame. Frames of information must not necessarily be transmitted at equal time space, since they are independent of the clock. 9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

"Bir şeyin ters gitme olasılığı varsa, ters gidecektir." Murphy Kanunları , Amerikalı mühendis Edward A. Murphy, jr. tarafından, başarısızlıklar ve hata kaynaklarının karmaşık sistemlerde incelenmesi üzerine ortaya konan özdeyişlerdir. "Bir şeyin ters gitme olasılığı varsa, ters gidecektir." "Bir şeyin birkaç şekilde ters gitme olasılığı varsa, hep en kötü sonuç doğuracak şekilde ters gidecektir." "Bir şeyin ters gidebileceği olasılıkları engelleseniz bile, anında yeni bir olasılık ortaya çıkacaktır." "Bir şeyin olma olasılığı, isteme olasılığı ile ters orantılıdır." "Er ya da geç olası en kötü koşullar zincirlemesi vuku bulacaktır." "Ne zaman bir şeyden vazgeçseniz, vazgeçtiğiniz o şey size geri gelir." "Olmuyorsa zorlayın, kırılırsa zaten değişmesi gerekirdi." "Ne kadar beklersen bekle istenmediği zaman gelecektir." "Çözülen her problem yeni problemler yaratır." "Her şey yolunda gidiyorsa, kesin bir terslik vardır." 9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

9/11/2018

USART in PIC The Universal Synchronous Asynchronous Receiver Transmitter (USART) module is one of the two serial I/O modules. (USART is also known as a Serial Communications Interface or SCI.) The USART can be configured as a full-duplex asynchronous system that can communicate with peripheral devices, such as CRT terminals and personal computers, or it can be configured as a half-duplex synchronous system that can communicate with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs, etc. The USART can be configured in the following modes: • Asynchronous (full-duplex) • Synchronous – Master (half-duplex) • Synchronous – Slave (half-duplex) 9/11/2018

9/11/2018

9/11/2018

TXSTA: TRANSMIT STATUS AND CONTROL REGISTER (ADDRESS 98h) 9/11/2018

RCSTA: RECEIVE STATUS AND CONTROL REGISTER (ADDRESS 18h) 9/11/2018

interrupts #USE RS232(constant1, constant2,…) This directive tells the compiler the baud rate and pins used for serial I/O. This directive takes effect until another RS232 directive is encountered. The #USE DELAY directive must appear before this directive can be used. This directive enables use of built-in functions such as GETC, PUTC, and PRINTF. The functions created with this directive are exported when using multiple compilation units. To access the correct function use the stream identifier. When using parts with built-in SCI and the SCI pins are specified, the SCI will be used. If a baud rate cannot be achieved within 3% of the desired value using the current clock rate, an error will be generated. #INT_RDA RS232 receive data available #INT_TBE RS232 transmit buffer empty interrupts 9/11/2018

#USE RS232 9/11/2018

set_uart_speed( ) Changes the baud rate of the built-in hardware RS232 serial port at run-time. This function is only available on devices with a built in UART. set_uart_speed (baud, [stream, clock]) baud is a constant representing the number of bits per second. stream is an optional stream identifier. clock is an optional parameter to indicate what the current clock is if it is different from the #use delay value // Set baud rate based on setting of pins B0 and B1 switch( input_b() & 3 ) { case 0 : set_uart_speed(2400); break; case 1 : set_uart_speed(4800); break; case 2 : set_uart_speed(9600); break; case 3 : set_uart_speed(19200); break; } 9/11/2018

RS232 Serial Port Functions 9/11/2018

Example Code 9/11/2018

Example Code /****************************************************** RS232 Serial Communication Sample *******************************************************/ #include <16f877.h> #fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD #use delay (clock=4000000) #define use_portb_lcd TRUE #include <lcd.c> #use rs232 (baud=9600, xmit=pin_C6, rcv=pin_C7, parity=N, stop=1) char klavye[80]; #int_rda void serihaberlesme_kesmesi () { disable_interrupts(int_rda); output_high(pin_c5); gets(klavye); printf("\n\rYazdiginiz Metin> %s\n",klavye); printf(lcd_putc,"\f%s",klavye); output_low(pin_c5); printf("\n\rKlavyeden bir metin giriniz ve enter tusuna basiniz>"); } 9/11/2018

Example Code void main ( ) { setup_psp(PSP_DISABLED); setup_timer_1(T1_DISABLED); … output_low(pin_c5); lcd_init(); printf("\r**************** Merhaba *********************"); printf("\n\rKlavyeden girdiginiz bilgiler LCD'de gorunecektir\n\n"); printf("\n\rKlavyeden bir metin giriniz ve enter tusuna basiniz>"); enable_interrupts(GLOBAL); while(1) enable_interrupts(int_rda); } 9/11/2018

Parallel Slave Port The parallel slave port on the PIC16F877 chip is designed to allow parallel communications with an external 8-bit system data bus or peripheral. Port D provides the 8 I/O data pins, and Port E three control lines: Read, Write, and Chip Select. If data are to be input to the port, the pin data direction is set accordingly and data presented to Port D. The chip select input must be set low and the data latched into the port data register by taking the write line low. Conversely, data can be read from the port using the read line. Either operation can initiate an interrupt. 9/11/2018

Parallel Slave Port Registers 9/11/2018

Parallel Slave Port Pin Structure 9/11/2018

9/11/2018

setup_psp(mod) Configures various options in the PMP/EPMP module. The options are present in the device.h file and they are used to setup the module. The PMP/EPMP module is highly configurable and this function allows users to setup configurations like the Slave mode, Interrupt options, address increment/decrement options, Address enable bits and various strobe and delay options. MOD: PSP_ENABLED PSP_DISABLED 9/11/2018

PSP_INPUT_FULL(), PSP_OUTPUT_FULL(), PSP_OVERFLOW() 9/11/2018

Example Code 9/11/2018

Example Code /****************************************************** PSP Application *******************************************************/ #include <16f877A.h> #fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD #use delay (clock=4000000) void main ( ) { setup_timer_1(T1_DISABLED); // T1 zamanlayıcısı devre dışı setup_timer_2(T2_DISABLED,0,1); // T2 zamanlayıcısı devre dışı … setup_psp(PSP_ENABLED); while (1) { output_b(PSP_DATA); } 9/11/2018

Example Code 9/11/2018

Example Code 9/11/2018