Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to overcome nested for loops for PIC 18f4520 programming...

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 all, i am useing a buzzer, a LED and a seven segment togather in a program...
And i want them to work togather but they are not due to nested for loops...
How do i solve this problem???
Thanks
 

mohideen,
Sounds like you need to break down the program into tasks. One task to handle each of the items, buzzer, LED and seven seg.
Then make main a loop that will service the tasks. I make lots of assumptions, like you are using a timer and interrupts. The interrupts can set flags that the main loop is sensitive to. An interrupt handler can set the flags.

Hope that helps some
Sckoarn
 

Another solution is to use a "Real Time Operating System".
The RTOS will handle the tasks simultaneously without any nested loops.

Hope this helps.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top