Sunday, January 27, 2008

Programming the PIC in C/PIC C

First thing is to find a help file located anywhere in the compiler development environment .Then we have to understand the basic data types .Then the most important part in pic C programming is to understand the built-in functions and the port directives like" poke "in PICbasic .Then we have to write the code in the development environment,including the basic header files .For example in case of the picc compiler we may be including the "16f877.h",if we are using the 877 pic of the 16f series.but there is no such option in micro c as well,instead it requires some project file initialization i think!!
For the demonstration purpose i have written a code to make pinA0 high if pinB0 is high and then push pinA1 low.Else if the pinB0is low the pinA0must be 0 and pinA1must be 1. During this time the pinC0 will blink with a delay of 500ms
the code is given below

No comments: