PIC18F26j11 ASM to C18

The Pic18f26j11 was chosen by a lecture as a model for micro-controllers programming using assemble language.  The Pic18f26j11 was used for the past year and a half in various small projects; semaphore and password door control.

It was decided to begin the Robot-arm by using the door control project as a beginning structure point. The problem this project had a few faults the project was finish in a week time since the pic18 was given really late, students had to share resources for this project.

Table for codec to control motors………………… to be added

The main problem was that the project was never really finished, when approaching the deadline it had to be completed to a working solution. The result product did work within his minimum requirements.

  • It was not one hundred percent stable; it will stop working it user press the code panel many times to fast.
  • The PIC18 did not really interpreted the code received for OPEN/CLOSE gate; One of the options was using indirect addressing and a possible further development into this project. The way to read OPEN instruction was created by sending two line of code save into an indirect addresses, the CLOSE gate will only send one line of code. The project used a counter to count how many indirect addresses where save and then OPEN/CLOSE the gate, in this case and LED green for open and red for close/wrong code will demonstrated that the PIC18 worked.

Since the arm-robot project required to understand the different instructions received from the computer, the issue refer in the gate system  project needed to be resolve. The assembly programming has demonstrated its advantages since you get to understand how the micro-controller works, having this knowledge and a base of C programming the best solution was to use C18 compiler and its libraries.

A library is a collection of functions grouped for reference and ease of linking…The processor-specific library files contain definitions that may vary across individual members of the PIC18 family. This includes all of the peripheral routines and the Special Function Register (SFR) definitions. (Microchip, 2005)

C18 is a Microchip compiler to program in C language for MPLAB IDE software. The advantage of C18 is that you can find a vast number of examples in their website but further understanding in the use of its libraries is required.

The disadvantages of the Pic18f26j11 is that there are not examples which particular use this micro-controller and some mistakes can be easily made when using other pic18 examples as reference.

Leave a Reply

Your email address will not be published. Required fields are marked *