You’ve seen that we have already used some PICs (that colour sensor video some posts ago?), so we have programmed them. You’ve seen, too, that we have made a program (in Perl) that generates some assembly code to load the information of a sudoku into memory.
But, we haven’t really got into programming yet, have we?
Since we have already coded a first version of our sudoku solving program (and a second version too, actually), the time for a ’source code’-post is not far. But before that, let’s get ready to code!
In this post, we’ll explain how to set some tools up to ease the coding process.
Firstly, we will need PIC Simulator to test our programs. Let’s explain a bit how it works.

That’s what it looks like when you start PIC Simulator. You can select there which microcontroller you are going to be working with, and at which clock speed. Also, note the section dedicated to General Purpose Registers (GPRs).
If you go to Tools -> Assembler, a text editor will open. Here’s where you are supposed to write the code. Or you can File -> Open another .asm file. Then, Tools -> Assemble & Load and the program gets loaded and ready to be run.
At this point, one basically uses Simulation and Rate tabs at the main window of the program.
The breakpoints manager (Tools -> Breakpoints Manager) is also very helpful (particularly, if you are bug-hunting). This is how it looks:

So far, so good. But the editor that comes with PIC Simulator kind of sucks, and you do realize that when you are writing a program with many lines of code.
We didn’t like it’s poor color-coding, or the fact that it didn’t have code regions. So we decided to move on to an editor that had it all: Notepad++.
It’s a great text editor and, best of all, allows you to define your own languages (user defined languages, yay!).
So we defined a PIC16F language, and that way we had colour coding that we liked, and regions! (They start with the keyword ‘;region’ and end with ‘;endregion’)
If you want to use yourself this language with Notepad++, you just have to download the userDefineLange.xml file and paste it into the folder that opens when you type ‘%APPDATA%\Notepad++’ and press OK at Start->Run.
Well, I think that’s all. You learnt how to use the basic functionality on PIC Simulator and you have a powerful editor to program in. Next, we’ll give you some source code to play around. Later dudes and dudettes!