MPLAB IDE - The output window (Part 3)
Following on from my last post here
The Output Window
Ok once you have created your project with the project wizard you can actually build the project at this stage. Of course if you uploaded the code to your pic it won't do anything as it is just minimal code supplied by the template you selected earlier. But it will tell you if all the files necesary are there.
Assuming you have done the gooligum tutorials or read the datasheet for your device and understand the instruction set and registers you can now add some code into the template file. The one ending in .asm
Once you think you have your code complete and are ready to try it click the build button again and the compiler will got to work.
You should have the output window open(tick output under the view menu) and you will see the code being processed.
The output will then tell you whether the build was successful and if it wasn't what errors and warnings you have.
Starting with the benign but common warning message as you will see in the image below(click here for better quality)
You will see I've drawn a red line and circled the 3 places where the warning occurs. Mplab nicely tells you on which line the error or warning occurs.
Because of the architecture of the pic the registers are organised in banks and this message is warning you that the registers you are addressing are in a bank other than 0. As you can see regardless of whether you have selected the correct bank before changing a register the code will still build. However you can expect odd behaviour if you have not kept track of which bank you are in.
Here's an example of an error that will not build.
You might see the pattern in the output window now.
Error message: File Name/Location: Line number: Description
I have created Error by texting out the definition of Rx_STATUS in my variable declarations. You will see it is all in green. The same error will occur if you make a spelling mistake when referring to it or change case. Declarations are case sensitive.
Because this variable is referenced 11 times in the file and I hid the declaration we have an error at each line it is referenced. If you mispelt you may have only done it on one line so there will only be one error.
Mplab is so nice as to tell us the name we have used that it doesn't recognise(Rx_STATUS). You can see the third underline above.
Other error messages and warnings can be learnt about by using the MPLAB help and selecting mpasm assembler in topics. Type error in the search box and it will give a listing.
Or refer to DS33014(mpasm assembler User's Guide) I referenced in my first post on mplab.