Nick';797008
Here is my second problem. I am using pickit2 and i would like to debug the code. I went to the debug and select my device(pickit2). I got an error said:
You don't debugg using the PICkit 2. In Mslab you debug by selecting the 'debugger' heading, then 'select tool' then select '4 MSLAB SIM.
In the upper right hand corner a new toolbar will appear.
Go to view> watch. A new box will appear. Oh, gosh, this is getting complicated.
There are two sections to the box. On the right side, click on the down arrow, which will give you a whole list of the innards of the chip you are using. Scroll down until you find your variables, then, one by one highlight them and click. They will appear, seperately, in the heading. Click add.
'
Then, back under debugger, click on 'step into'.
Watch the screen where your program is and each time you click 'step into' you will see a bar on the left side step through each line of your program. At the same time, as each variable is acted upon, you will see change in the watch window.
Whew! That's as simple as I can make it. Hope you can follow.
NOTE: This procedure is only for debugging the program. It will not help you debug the hardware.