Home Price List Order Info Microcontrollers Assembler C and C++

Simple Changes


I recently received an email from a frustrated customer who was trying to make a PIC16F84 programme run in a PIC16F877. His first email seemed to suggest that he did not know the simple changes that are needed to change 84 code into 877 code. My first reply was no help to him as he already knew what to do so he sent me a listing of the programme which did not work.

Finding an error in code someone else has written is a near impossible task. I did glance over the code and it was immediately apparent that it would not run in a PIC16F84 as it used port C and port E.

This illustrates one of the most common problems in all forms of programming. This customer had a programme working then instead of making the simple adjustments to get it running in the 877 he has rewritten the programme, found that it does not work and assumed that it is because he is now using the 877.

The message is this. Once you get a programme working make only one change at a time and test the code after each change. It sounds so obvious that I should not need to write it.