قسم الميكروكنترولر والروبوت ودوائر الاتصال بالحاسب الالي قسم المتحكمات الـ microcontroller و المعالجات microprocessor و التحكم الرقمي بالكمبيوتر CNC والانظمة الآلية والروبوت Robots

أدوات الموضوع

الصورة الرمزية mahmosha
mahmosha
:: مهندس جيد ::
تاريخ التسجيل: Sep 2011
الدولة: مصر
المشاركات: 213
نشاط [ mahmosha ]
قوة السمعة:0
قديم 20-03-2012, 08:37 PM المشاركة 1   
افتراضي how to decode the first pulse using mikroc? Twitter FaceBook Google+



hi all i was wondering about how to make a code that calculates remote control tv /AC but the problem always how to make the decode for the first pulse time????
i decided to use timer0 as a pulse calculator and timer1 as a time decoder (for the first pulse)
the idea of the program is setting timer0 = 255 at the start of the code so when a pulse come it goes to interrupt and make timer1 start counting as a timer but the proplem is that it wont stop except for its interrupt how to make timer1 stop counting as a timer when the pulse ends? i though about making timer0 =255 when the interrupt happens it goes 255 so the next pulse's interrupt will make the timer1 stop counting but the problem that the timer zero counts on the Falling edge according for the receiver which becomes low with a signal so it will be a mismatch in the time because it takes about 13us to go from hight to low correct me if i am mistaking but i really need help if you can help me please do Greeting...

اعلانات

ماجد عباس محمد
:: نائب المشرف العام
::
تاريخ التسجيل: Jun 2009
الدولة: القاهرة - مصر
المشاركات: 12,214
نشاط [ ماجد عباس محمد ]
قوة السمعة:408
قديم 21-03-2012, 06:58 AM المشاركة 2   
افتراضي


hi all i was wondering about how to make a code that calculates remote control tv /AC but the problem always how to make the decode for the first pulse time????
i decided to use timer0 as a pulse calculator and timer1 as a time decoder (for the first pulse)
This is called "Learn Mode" so the micro will have no other job but to decode the incoming signal, which is a small time.
So it is better to let the interrupt routine just checks when the input signal ends then go back to main program to read the counter and save it somewhere and reset it prepare for next one and do what it has to do till the next interrupt
the idea of the program is setting timer0 = 255 at the start of the code so
when a pulse come it goes to interrupt and make timer1 start counting as a timer but the proplem is that it wont stop except for its interrupt how to make timer1 stop counting as a timer when the pulse ends? i though about making timer0 =255 when the interrupt happens it goes 255 so the next pulse's interrupt will make the timer1 stop counting but the problem that the timer zero counts on the Falling edge according for the receiver which becomes low with a signal so it will be a mismatch in the time because it takes about 13us to go from hight to low correct me if i am mistaking but i really need help if you can help me please do Greeting...
it is difficult this way as the pulse has some time HI and another time LO and you either interested in the HI period OR LO ONLY not both depending on the schematic you use

اعلانات اضافية ( قم بتسجيل الدخول لاخفائها )
  
إضافة رد

العلامات المرجعية

«     الموضوع السابق       الموضوع التالي    »
أدوات الموضوع

الانتقال السريع إلى


الساعة معتمدة بتوقيت جرينتش +3 الساعة الآن: 12:42 PM
موقع القرية الالكترونية غير مسؤول عن أي اتفاق تجاري أو تعاوني بين الأعضاء
فعلى كل شخص تحمل مسئولية نفسه إتجاه مايقوم به من بيع وشراء وإتفاق وأعطاء معلومات موقعه
التعليقات المنشورة لا تعبر عن رأي موقع القرية الالكترونية ولايتحمل الموقع أي مسؤولية قانونية حيال ذلك (ويتحمل كاتبها مسؤولية النشر)

Powered by vBulletin® Version 3.8.6, Copyright ©2000 - 2025