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.

Continuously running C Code on PIC

Status
Not open for further replies.

knmaheshy2k

Member level 1
Joined
Oct 14, 2005
Messages
37
Helped
7
Reputation
14
Reaction score
5
Trophy points
1,288
Activity points
1,657
Hey pals..i'm little new to PIC C Codin.. i got a silly doubt.. pls clarify..
When we code in assembly to make the program run continuously we give a CALL/JUMP to START at the end of the code ... but when we code in C using CCS compiler is it necessary to loop it or does the compiler loops itself automatically?? I've to run a code continuously on PIC.. Pls clarify this...
 

init tasks...
...
...
for (;;)
{
your code
}


or

init tasks...
...
...
do
{
your code
}while(TRUE);

attached is a source code i made for testing an array of pots for comvdd project
 

Oh!!!!! i cant ask a more stupid question that tat... really it was very stupid.. thanks mate.. sometimes mind goes blunt.. :-(
 

ahh i see your there

no probs

i had to find this out also many many years ago {1980 pet computer}

its worth adding the second method is escapable for reinit or to allow change in pin function secuirty check etc etc second main

you just add FALSE

and add a variable

like

int x,y,z;
//main1
do
{
x=FALSE; //escape
}while(x);

//main2
do
{
y=FALSE; //escape
}while(y);

//main2
do
{
z=FALSE; //escape
}while(z);




but youll need to type define or bool is hard

look to the sources above
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top