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.
What have you tried to do? How are you going about it?
Can you show us your code?
What is it not doing and where (in your code) is it going wrong?
Have you looked at the Family Reference Manual examples? (The examples are in both C and assembler and it should be fairly straight forward to rework the assembler examples in C)
So what is stopping you from writing the code yourself. I have given you pointers to where to find example code and there are also many code examples that can be found with Google. Try CE027 for a start.
/*ITS CODE WHICH I HAVE TAKEN FROM MIKROC LIBRARY ITSELF AND IT RUNS WELL BUT WHEN TEST ON PROTEUS IT DOESNT DISPLAY THE DESIRED RESULT I CHANGE IT IN MANY WAYS AND RUNED OKAY BUT NOT GIVING THE WANTED RESULT*/
Apart from the fact that the 'main' program exists (and therefore will likely reset the device and restart), what does that code do that it is not supposed to?
You say it "...runs well..." so I'm not sure what the problem is.
You say there are problems with the Proteus simulator, but that could well be bugs in the simulator: does it work on real hardware?
Also, in what way is it wrong? What are you seeing displayed and what are you expecting to see?
Have you used a debugger to single step through the code to see which parts are working and where the errors are occurring? If so, what are the results of that?