|
السلام عليكم
اخ حسن
1- التعديل اصبخ يعمل جيدااا
2- لم استطع فتنح الملف كالعادة ( TEST DISPLAY.mcppi )
يفتح و لاكن يحولني الى .سي .سي
الرجاء اعادة الرفع و عند الفتح يفتح البرنامج كالعادة
3- هناك لغة لم افهمها مثلا
if(ggg>30 && kk==255 && messge==0){ggg=0;update_data(); } // ÞÑÇÁå ÇáæÞÊ æÇáÊÇÑíÎ ; ßá 10 ãáí ËÇäíå
عند فتح الميكرو سي اجد امام التعليمة شرح بهده الغة فما الخل
4-اخي هل عمل فواصل امر صعب
مثلا فواص بالنقاطك بالنسبة عرض السنة و الشهر
12.05.14
و بالنسبة لكود الوقت هل ممكن عمل ديود ليد يقوم تعداد الثواني ينطفء و يشتعل كل ثانية
5-وجدة مشروع مكتوب بلغة السي و اريد ان ارفقه كما هو مع مشروع الساعة
ولاكن التعديل سيكون على العرض على سيفنسيغمون
لم استطع الرفع على الرابط .... المحاولة جارية
|
السلام عليكم
بالنسبه لعمل ليد ينطفئ ويشتغل كل ثانيه فهذا يمكن توليده من ايسي ds1307 فهي تحتوي على ريجيستر يقوم بتوليد موجه مربعه ويمكننا ضبط ترددها عند 1 هيرتز عندها ينطفئ ويشتغل
سأرفق لك نفس مشروع
التعديلات هي في بروتيس اضافه ليدات (( حاول تربطها عبر ترانزستور لحمايه متكامله ))
وكذلك اضافه هذا الكود ضمن المكتبه DS1307
كود:
Soft_I2C_Write(0x90); // enable square wave frequncy 1HZ
طبعا هذا الكود قبل التعديل (( خاص بمكتبه ))
=================================
كود:
/**************************************************************************************************
* Write time to RTC DS1307
* input : variables with RTC data
**************************************************************************************************/
static void Write_Time(unsigned char c_hours, unsigned char c_minutes, unsigned char c_seconds,
unsigned char c_day, unsigned char c_week, unsigned char c_month, unsigned char c_year)
{
Soft_I2C_Init(); // Initialize I2C bus for communication with RTC
soft_I2C_Start(); // issue start signal
Soft_I2C_Write(RTC_ADDR); // address DS1307
Soft_I2C_Write(0); // start from word at address (REG0)
Soft_I2C_Write(0x80); // write $80 to REG0. (pause counter + 0 sec)
Soft_I2C_Write(c_minutes); // write minutes word to (REG1)
Soft_I2C_Write(c_hours); // write hours word (24-hours mode)(REG2)
Soft_I2C_Write(c_week); // write Monday (REG3)
Soft_I2C_Write(c_day); // write date word (REG4)
Soft_I2C_Write(c_month); // write month word (REG5)
Soft_I2C_Write(c_year); // write year word (REG6)
soft_I2C_Stop(); // issue stop signal
soft_I2C_Start(); // issue start signal
Soft_I2C_Write(RTC_ADDR); // address DS1307
Soft_I2C_Write(0); // start from word at address 0
Soft_I2C_Write(0 | c_seconds); // write 0 to REG0 (enable counting + 0 sec)
Soft_I2C_Stop(); // issue stop signal
}
==============================
هذا بعد أضافه كود توليد موجه مربعه بتردد 1 هيرتز
كود:
/**************************************************************************************************
* Write time to RTC DS1307
* input : variables with RTC data
**************************************************************************************************/
static void Write_Time(unsigned char c_hours, unsigned char c_minutes, unsigned char c_seconds,
unsigned char c_day, unsigned char c_week, unsigned char c_month, unsigned char c_year)
{
Soft_I2C_Init(); // Initialize I2C bus for communication with RTC
soft_I2C_Start(); // issue start signal
Soft_I2C_Write(RTC_ADDR); // address DS1307
Soft_I2C_Write(0); // start from word at address (REG0)
Soft_I2C_Write(0x80); // write $80 to REG0. (pause counter + 0 sec)
Soft_I2C_Write(c_minutes); // write minutes word to (REG1)
Soft_I2C_Write(c_hours); // write hours word (24-hours mode)(REG2)
Soft_I2C_Write(c_week); // write Monday (REG3)
Soft_I2C_Write(c_day); // write date word (REG4)
Soft_I2C_Write(c_month); // write month word (REG5)
Soft_I2C_Write(c_year); // write year word (REG6)
Soft_I2C_Write(0x90); // enable square wave frequncy 1HZ
soft_I2C_Stop(); // issue stop signal
soft_I2C_Start(); // issue start signal
Soft_I2C_Write(RTC_ADDR); // address DS1307
Soft_I2C_Write(0); // start from word at address 0
Soft_I2C_Write(0 | c_seconds); // write 0 to REG0 (enable counting + 0 sec)
Soft_I2C_Stop(); // issue stop signal
}
طبعا يجب وضعه بعد ريجيستر السنه لانه موقع السنه year بالذاكره هو 6 ورجيستر كونترول موقعه في ذاكره هو 7
لهذا سبب وضعته كود بعد كود كتابه في ريجيستر year
http://arabsh.com/files/0c334c4367f2...ه-بتردد-1.html