Aslam Jallali wrote: > sorry - I meant to write from: www.golovchenko.org/cgi-bin/delay > this site has a delay generator. I haven't tested the generated code > yet I will do this tonight let you know if it was working or not. > Now, as for application: I try to simulate irish lighthouses for a > decorative map. Each lighthouse is represented by a LED on the map. > Each lighthouse has a different flashing sequence for example the > Kish Lighthouse, east of Dublin Bay, has a character of Fl (2) W 20s, > this according to chart means 0.4 second of light, followed by 3.6 > seconds eclipse, followed by another 0.4 seconds of light and 15.6 > seconds eclipse. This sequence is repeated every 20 seconds (fl 0.4, > ec 3.6, fl 0.4, ec 15.6 = 20s.) > and the next lighthouse "Tory Island" is > Fl (4) W 30s (fl 0.2, ec 4.8, fl 0.2, ec 4.8, fl 0.2, ec 4.8, fl 0.2, > ec > 14.8 = 30s). > and so on..... > The flashes are either 0.2, 0.4, 0.5 or 1s. Sofar I found 21 delay > routine that are common amongst 20 lighthouses. Yes I suppose there > is a common time base but I thought of 21 delay routine first!I > thought that was the more suitable (easier!)option > I will spare you the hardware setup just that I bought a PIC16877 > because that is the one that I can Program. What is the smallest resolution needed for each on or off time? All the times you described so far only need 100mS resolution. If that works all the way thru, run a routine that re-evaluates each light every 100mS. That way you can do them all in parallel and there is no need for explicit delays. There should also be plenty of processor time left over since updating all the LEDs probably doesn't even take 1mS. Even with 4MHz oscillator that's 1000 instructions. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics