Wednesday, 23 January 2013

First Program


Hello Program :

1-      Open  Mikroc  Program  .


2-Project tab -> new project .



1-      Change project name ,browse for choose where project will saved.
2-      Clock choose 000.8000
3-      Press default and OK .









5-Code :


















Line 1:main function which any program  must be beginning with it.
Line5:TRISC :is register  which used to select  pin state whether  input or output
So ,if TRISC = 0 ,that means  pin C is output port ,if TRISC = 1 that mean PORTC is input.
Line:6 PORTC =0 means  signal of zero in PORTC.
Line7: while(1)is infinite loop or may can use for(;;)
Line10: toggle PORTC which is on and off in continue .
Line11: delay_ms (1000) is function use for delay
Value 1000 in ms so equal 1 sec.

6- Project tab - > build ,here will process  HEX file which use in microcontroller circuit .


No comments:

Post a Comment