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.
first of all there isnothing called general compiler for embedded systems. all cross compilers are specific. and embedded C is a derivative of C , so all compilers support C languages. but some commands and syntax are supported by specific compilers.... So there is no standard book for embedded C.. Whatever you get is covering for C concepts... Embedded C syntax is different for different compilers as some support some features , other compilers do not support those features....
the best help you can get is the help of the compiler you use.. as that compiler will talk of only those commands that it supports.. same commends in other compilers may or may not be supported as architecture of controllers are different,...............
Hi Shivram,
Hope you can remember me. I'm very new to PIC C programming. What does it mean by " set_timer0(42);"
Looking forward to hear from you soon.
it looks like an function to load the value of timer0
So you are setting the timer0 value to run for 42millisecs.. the 42 depends on the parameter the function is taking.. it can be in msec, or sec depending on the function prototype.....
while(1) // Do forever
{
while (input(Start) ) // Wait for start signal - mag switch
{
stop_seconds = 1; // Seconds count disabled
output_low(left); // Set lamps off
output_low(right);
seconds = 0; // Ensure seconds start at 0
}
while (!input (Start)) // Activate TAFLU
{
delay_ms(5);
if (!input (start));
{
//Switch_set(); // Get Delay time
output_high (Left); // Set one Lamp on
output_low (right);
stop_seconds = 0; // Enable seconds count
enable_interrupts(INT_TIMER0); // Start Timer0
enable_interrupts(GLOBAL); // enable interupts
Stop_Blink = 0;
/*****************************************************************************/
// Loop here until Seconds = minutes or switch is pressed
/*****************************************************************************/
do
{
Delay_Ms(1000); // Make sure Switch released
if (!input (Start)) // See if switch Activated
Seconds = Minutes; // Set seconds = minutes
} // to stop flash
while (seconds < minutes); // until the seconds = mins
}
}
/************************* Time expired **************************************/
{
stop_seconds = 1; // stop the seconds
stop_Blink = 1; // stop the flasher toggle
disable_interrupts(INT_TIMER0); // Disable timer interupt
disable_interrupts(GLOBAL); // Disable global interupt
output_low(left); // Turn lamps off
output_low(right);
}
Delay_Ms(1000);
/***************************** End of main loop ******************************/
}
/**************************** Main Function End ******************************/
}
/*****************************************************************************/
I could not understand the values in it "if (mSec == 4003) " & "if (Blink == 3007)" where did they drive these values(4003 and 3007) from?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.