مصراوي للإلكترونيات وخدمات الصيانة
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.
مصراوي للإلكترونيات وخدمات الصيانة

lcd,tv,رسيفر,تليفزيون,شاشه,كمبيوتر,سوفت,برامج,بلازما.توشيبا,شحن فلاشه,


أهلا وسهلا بك زائرنا الكريم, أنت لم تقم بتسجيل الدخول بعد! يشرفنا أن تقوم بالدخول أو التسجيل إذا رغبت بالمشاركة في المنتدى

الربط بين الكمبيوتر والميكروكنتروللر

اذهب الى الأسفل  رسالة [صفحة 1 من اصل 1]

م/حسن المصري

م/حسن المصري
المدير العام


بسم الله الرحمن الرحيم
توجد طرق كثيرة للربط بين الكمبيوتر والميكروكونترولر منها عن طريق

منفذالطابعة و المنفذ التسلسلي ومنها عن طريق اليو اس بي

في هذا الدروس القادمة ان شاء الله سنتناول كيفية الربط بين المنفذ التسلسلي مع الكمبيوتر

وسوف نستخدم الفيجوال بيسك 6 لهذا الأمر ان شاء الله

المميزات بالنسبة للمنفذ التسلسلي عن منفذ الطابعة هو ان بعض المايكروكونتروللريحتوي على

هاردوير للإتصال المتسلسل والتي لا تحتوي علىهاردوير يمكن استخدام سوفت وير ليحل محله

احب ان اعرض هذه الدائرة على سبيل الحديث فى هذا الموضوع
وهى دائرة للتحكم فى اطراف الميكرو عن طريق الكمبيوتر وكيف يكون برنامج تشغيلهاالربط بين الكمبيوتر والميكروكنتروللر IO-PIC16F84

بالنسبة الى الدائرة السابقة توجد بها مشكلة ألا وهي أن الفولت الذي يخرج من المنفذ التسلسل من +10 الي +12 فولت و - 10 الى - 12 فولت وهو غير مناسب للتوصيل مباشرة بالمايكروكونترولر يجب استخدام IC بين الكمبيوتر و المايكرو كونترولر على سبيل المثال MAX232
كألموضح
7.10 Serial Communication

SCI is an abbreviation for Serial Communication Interface and, as a special subsystem, it exists on most microcontrollers. When it is not available, as is the case with PIC16F84, it can be created in software. الربط بين الكمبيوتر والميكروكنتروللر 42

As with hardware communication, we use standard NRZ (Non Return to Zero) format also known as 8 (9)-N-1, or 8 or 9 data bits, without parity bit and with one stop bit. Free line is defined as the status of logic one. Start of transmission - Start Bit, has the status of logic zero. The data bits follow the start bit (the first bit is the low significant bit), and after the bits we place the Stop Bit of logic one. The duration of the stop bit 'T' depends on the transmission rate and is adjusted according to the needs of the transmission. For the transmission speed of 9600 baud, T is 104 uS.

Pin designations on RS232 connector
الربط بين الكمبيوتر والميكروكنتروللر 43



1. CD(Carrier Detect)
2. RXD(Receive Data)
3. TXD(Transmit Data)
4. DTR(Data terminal Ready)
5. GND(Ground)
6. DSR(Data Set Ready)
7. RTS(Request To Send)
8. CTS(Clear To Send)
9. RI(Ring Indicator)



In order to connect a microcontroller to a serial port on a PC computer, we need to adjust the level of the signals so communicating can take place. The signal level on a PC is -10V for logic zero, and +10V for logic one. Since the signal level on the microcontroller is +5V for logic one, and 0V for logic zero, we need an intermediary stage that will convert the levels. One chip specially designed for this task is MAX232. This chip receives signals from -10 to +10V and converts them into 0 and 5V.
The circuit for this interface is shown in the diagram below: الربط بين الكمبيوتر والميكروكنتروللر 44Connecting a microcontroller to a PC via a MAX232 line interface chip

File RS232.inc contains a group of macros used for serial communication. الربط بين الكمبيوتر والميكروكنتروللر Rs232_inc
Using the macro for serial communication:


rs232initMacro for initializing the pin for transmitting data (TX-pin).
Example:RS232init


SendwSending ASCII value of data found in W register.
Example:movlw 't'

call Sendw


rs232textSending ASCII value of a specified text
Example:rs232 "mikroelektronika"


rs232byteSending ASCII value of decimal digits of 8-bit variable
Example:movlw .123

movwf TXdata

rs232byte TXdata ;Send '1', '2', '3'

When rs232.inc file is used, it is necessary to declare variables Rstemp and TXD at the beginning of the main program.
Example:
As a demonstration of a serial communication, we have an example which sends text and the content of variable cnt. Text is sent via macro rs232text, while variable cnt is sent via macro rs232byte. This operation repeats itself after 500ms, with incrementing cnt in the process. This example can be easily modified to have button(s) for sending specified data

ما بالنسبه للدائرة الأولى فليس بها مشكلة حيث تعمل

المقاومة 22 كيلو كأنترفيس بديل للمتكاملة وهى طريقه ارخص

ويمكن الاطلاع على تفاصيل هذه الدائرة والبرنامج من هذا الرابط



[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]


https://eioe.forum.st

الرجوع الى أعلى الصفحة  رسالة [صفحة 1 من اصل 1]

صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى