
328 EMBEDDED SYSTEMS
TR1 = 1; //Starting the Timer 1
}
int main(void)
{
Initialise_UART();
while(1);
}
9.2 | PIC Programming Using MPLAB
Next , three programs written for PIC 18F458 are included. Due to space limitations, it is
not possible to include the details of the architecture of PIC in this book. However,these
programs are presented here to show the structure of embedded C programs for another
processor, besides 8051. For PIC, the most popular IDE is MPLAB, and this program
has been tested in the C compiler of MPLAB.
Example 9.15
In this, the 8-bit Timer 2 is programmed to operate in the interrupt mode to generate a
square wave on all pins ...