السلام عليكم
لدى مشروع للتحكم فى إضاءة led's بالتتابع وذلك باستخدام pic16f84a
و74hc595 باستخدام مايكروسى .
صممت الدائرة والبرنامج بالبروتس والدائرة تعمل جيدا فى المحاكاة
لكن على ارض الواقع لاتعمل بصورة جيدة فاحيانا تعمل واحيانا لاتعمل
حتى انارة الليد المتتابعة غير التى فى المحاكاة
لااعرف اين المشكلة بالضبط مع العلم انى تاكدت من كل التوصيلات وكل الاعدادات
لقد اتبعت نفس الخطوات فى الدائرة التى شرحها المهندس احمد سمير فايد
كمافى الصورة التالية:

http://www.electvillage.com/upload//view.php?file=5b73b279f6
وهذا هو الكود الذى كتبه احمد سمير:
هذا الكود يعمل على أظهار المصفوفة على الLEDs
كود:
// how to expand the number of ouputs of microcontroller
//**this is a small example >> we will use 74hc595 shift refister serial in parallel out.
//**
//**Author : Ahmad Samir Fayed
//**Email : ahmad*fayedcom.com
// OR ahmad_s_f*hotmail.com
//
//
// note : I know that : this code is bad . but I wrote it like that to be easily understand for
// beginners.
//
//
// in this example
// we will send this value 100111101100001111001001 to new outputs.
// for each bit :first : we should make portb.f0=this bit
// second : send 0 then 1 via portb.f1
// by wirting this code portb.f1=0;portb.f1=1;
// third: repeat last two steps with all bits .(24 bits in this example)
// now , all data are stored but they are not the outputs.
// so we should send 0 then 1 via portb.f2 by wirting this code
// portb.f2=0;portb.f2=1;
// finally , enjoy.
// if you want to say "thank you" >> please pray for me better.
char data[24]={1,0,0,1,1,1,1,0,1,1,0,0,0,0,1,1,1,1,0,0,1,0,0,1};
char x;
void main()
{
trisb=0;
portb=0;
for(x=0;x<24;x++)
{
portb.f0=data[x].f0;
portb.f1=0;portb.f1=1;
}
portb.f2=0;portb.f2=1;
}