> Hello! > I have to program the PIC16C84 microcontroller for my graduation > project and I never wrote an assembly code before. > After long time wasted on reading useless staff doing search on > internet and studying datasheet I wrote and simulate 250 lines of assembly > code which proved to be wrong. Could you be more specific about the problem you are having? Creating a PIC project is difficult because you need to really be sure whether the problems that you are experiencing are at the hardware or software level. I spend alot of time making sure the hardware portion of the project is bug free before really going at the code section. Small programs to test the hardware early in development are critical. Keep a copy of the test code, so if the hardware changes, it is relatively easy to requalify it. You need to break down your assembly language into smaller chunks. Few people can bang out 250 lines of assembler correct the first time. MPLAB is also has some problems with simulation. > Now I dont know how to proceed. I will be grateful if you show me the > way. Maybe you would advise me a good book about PIC programming or a > manual on internet or whatever way to learn PIC. Sounds like you don't need more books, usually the datasheet is enough. Without more info on the specific problem, I can't offer specific help. 1--Make sure the hardware works as expected 2--Write your code in smaller segments and debug it before adding to it 3--Create some sort of revision control disipline and document as you change the code 4--Create a "Lessions Learned" file, so you don't keep solving the same problem over and over again. This file is also useful when proofing the code, so similar bugs don't slip by.