Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC 18F portability issues

Status
Not open for further replies.

Electrix

Member
Hi

I've been using the PIC 18F2520 for my development.. we've been using the chip for quite a while and the software that we ship is well-tested. Now I'd like to upgrade the controller to PIC18F25k22 for cost reasons. An important requirement is that the software should be completely portable.

So I programmed the PIC18F25k22 with the new hex file (using ICD2) and, straight off the bat, we observed that the software was not doing what its supposed to. The hex file that I have is code-protected so I cant read back whats burnt to verify if that particular hex file was flashed correctly.. BUT..I did a small experiment with a flashing LED program to double check if my micro was fine...sure enough my 'hello world' code did what its supposed to.

So far, I have been going over the datasheets to find information that would hint some portability issues.. There are of-course newer features (like additional timers, higher max oscillator freq) but none of these suggest any thing that would break my existing code.. My question is, have any of you faced similar portability issues within the PIC 18F series. I'm looking for pointers/red flag areas that are worth checking for .. I can then use this to dig deeper into my code.

Thanks in advance.

Electrix
 
I wish it were that easy. Some of the configuration options and registers for modules are different.
 
You're looking at a different chip!

The basic core of the code is probably "ok". But, some differences:
1. Fuse bits will probably be different
2. The analog/digital config bits may be different
3. The module (adc, PWM, etc) may function differently

Any developer who made the 2520 software should have no problem porting to the 25k22. It requires a bit of time, the job doesn't do itself here, but frankly this is not rocket science.

"does anyone have similar issues"? Actually, everyone does. Everyone who ports a project from one chip to another at the very least has to rebuild. But unless you're just using the exact same part with more memory (which generally does require a rebuild), some porting work must be done.

Wait, you have the source code, right? Why are you burning a copy with the write-protect fuses set? Just change the fuse bits to unprotected and rebuild...
 
Wait, you have the source code, right? Why are you burning a copy with the write-protect fuses set? Just change the fuse bits to unprotected and rebuild...

Or, load the hex file into MPLAB and then set the fuse values.

Mike.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top