Help in designing a program for a LED sequence in PIC18f4520...

Status
Not open for further replies.

mohideen

Member level 2
Joined
Jan 19, 2011
Messages
45
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,580
Hi, just a small enquiry.

I am using the PIC18f4520.
It consist of 6 LEDs.
I am required to make a program, which creates a walking LED,
meaning each LED will light up concurrently
I am having a problem in creating the delay for the LEDs
I would like to know the program for this function.

Yr help would be much appreciated
 

Hi,

If that is the only thing your uC has to do, you may use a delay (otherwise you may use a timer);

First find time to operate one instruction cycle; Tcy (base on your oscillator speed for PIC18 it is; 4/(Osc speed) seconds);

Find value; how may instructions should be wasted to achieve delay-time;

Write a code to waste that much of instructions (you may load a value with one or few registers. Then decrease it to zero - a loop)

You can find lot of delay samples in this forum (and outside) for PIC; If you can write one, that is better for future use and your understanding.

Hope this tip helps you for coding.
 

Thanks.
Where can i find similar coding in this website.
Because i am quite new to this website.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…