MC68HC908QT4 Servo Sayısallaştırıcı Uzaktan Kumanda ASCII Veri Gönderimleri

| Haziran 14, 2023 Tarihinde güncellendi
MC68HC908QT4 Servo Sayısallaştırıcı Uzaktan Kumanda ASCII Veri Gönderimleri

Servo Sayısallaştırıcı, bir model uçak radyo uzaktan kumandası olan Futaba Skysport 4’ten gelen kontrol girdisini bir PC’de çalışan bir uçuş simülatörü programına kanalize etmek için geliştirilmiştir. Uzaktan kumandadan gelen darbe genişliği modülasyonlu bir sinyal çıkışını ASCII verilerine çevirir ve bunları bir RS-232 seri bağlantı noktası aracılığıyla PC’ye gönderir.

PCBway Türkiye PCB Manufacturer PCB Assembly

PC’deki bir uçuş simülatörü programı, PC’deki simüle edilmiş bir uçağı kontrol etmek için RS-232 portundan gelen verileri kullanabilir. Bu projenin yazılım bileşeni, sınırlı kaynaklara sahip bir mikrodenetleyici ile bir kaynak kodu modülerlik tekniğinin kullanımını göstermektedir.

servo-mc68hc908qt4-ascii-data-sends-tpc-rs-232-serial-port

Servo Sayısallaştırıcı, giriş darbelerinin genişliklerini ölçmek için mikrodenetleyicinin giriş yakalama özelliğini kullanır. Mikrodenetleyicinin çıktı karşılaştırma özelliği kullanılarak bir seri bağlantı noktası simüle edilir. Servo Sayısallaştırıcı, çıktı ASCII metnini 18 ms içinde PC’ye iletmelidir, bu nedenle doğru baud hızının seçilmesi çok önemlidir.

Donanım, bir güç kaynağı, MC68HC908QT4 mikrodenetleyici ve RS-232 alıcı-vericilerden oluşur. Bir DIN6 konektörü, kartı, karta güç sağlamak için 0-4V giriş sinyali ve 9V DC pil sağlayan Futaba model uçak uzaktan kumandasına bağlar. Doğrusal regülatör, sistemin geri kalanına 5V DC güç sağlar. Sistem saati 24 MHz’lik bir kristalden gelir. Çıkışı bir PC’ye göndermek için bir dişi DB9 konektörü kullanılır.

servo-mc68hc908qt4-futaba-skysport-flight-simulator-program

Bu proje için özel bir yazılım çerçevesi oluşturulmuştur. Çerçeve, kaynak kodunu kod modülünün katmanları halinde düzenlediği için yazılımın ayrılmaz bir parçasıdır. Yazılım, Metrowerks CodeWarrior geliştirme ortamı kullanılarak tamamen C dilinde yazılmıştır. Kaynak kodu, üç soyutlama katmanında düzenlenmiştir. Üç katman Başlangıç, Dağıtıcı ve İşlem katmanlarıdır.

Bir katman bir veya daha fazla modülden oluşur. Her modülün özel bir görevi vardır ve yalnızca aynı veya farklı katmanlardaki diğer modülleri önceden tanımlanmış bir şekilde ifade eder. Mümkün olduğunda çerçeve, kodun ve verilerin farklı dosyalara ayrılmasını teşvik eder.

Modüllerin yeni bir ortam için değiştirilmesi gerektiğinde, gerekli parametrelerin çoğu veya tamamı veri dosyasında (.h dosyası) bulunurken, kaynak dosyada (.c) çok az değişiklik olur veya hiç değişiklik olmaz. Yazar: Sitti Amarittapark

convert-pulse-ascii-text-step-mc68hc908qt4-mcu

osiloskop-measurement

The Servo Digitizer is developed to channel control input from a model airplane radio remote control, the Futaba Skysport 4, to a flight simulator program running in a PC. It translates a pulse-width modulated signal output from the remote control into ASCII data and sends them to the PC via an RS-232 serial port. A flight simulator program in PC can use the data from the RS-232 port to control a simulated airplane in the PC. The software component of this project demonstrates the use of a source code modularity technique with a microcontroller that has limited resources.

The Servo Digitizer uses input capture feature of the microcontroller to measure widths of the input pulses. A serial port is simulated using output compare feature of the microcontroller. The Servo Digitizer must transmit the output ASCII text to the PC within 18ms, therefore selecting a correct baud rate is crucial.

The hardware consists of a power supply, the MC68HC908QT4 microcontroller, and the RS-232 transceivers. A DIN6 connector connects the board to Futaba model airplane remote control, which provides 0-4V input signal and a 9V DC battery to power the board. A linear regulator provides 5V DC power to the rest of the system. The system clock comes from a 24MHz crystal. A female DB9 connector is used to send the output to a PC.

A special software framework is created for this project. The framework is an integral part of the software as it organizes the source code into layers of code module. The software is written entirely in C language using Metrowerks CodeWarrior development environment. The source code is organized into three abstraction layers. The three layers are Startup, Dispatcher, and Operation layers. A layer consists of one or more modules. Each module has dedicated task and only refers to the other modules, in the same or different layers, in a predefined way. When possible, the framework encourages the separation of code and data into different files. When the modules need to be changed for a new environment, most or all of the needed parameters reside in the data file (.h file), while there is little or no change in source file (.c). Author: Sitti Amarittapark

mc68hc908qt4-servo-digitizer-remote-control-ascii-data-sends

Şifre-Pass: 320volt.com

Yayım tarihi: 2012/07/09 Etiketler: ,



Bir yanıt yazın

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