Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can portions of code for a PIC16F877 be used in a PIC12F683?

Status
Not open for further replies.

eetrit

Electrical
Aug 1, 2002
11
I am wondering if anyone has used portions of their code for a 16F8XX in a PIC12F6XX. I have a project which we are expanding and I am using the 16F877 as the main controller loaded with the main program and the user interface and we plan on using the 12F683 as the peripheral controller to run a sub program and report measurements to the 16F877. I am wondering if it is worth my time to try and use these 2 controllers are use a lower level 16Fxxx instead of the 12Fxxx?
 
Replies continue below

Recommended for you

Yup. Sure looks like the good old familiar instruction
set of the 16FXXX chips. You most likely will be able
to lift large portions of the code from the 877 to
the 683.

I/O will most likely be different as well as feature set,
but simple program flow operations will most likely match.

I've done a lot of code leveraging between 16FXXX pics
and 12F675'ish pics without problem. In fact, I've lately
been playing with the 10F20X pics and using code designed
for the 16F (all be it with limitations) on the itty bitty
pics.

Cheers,

Rich S.
 
The memory pages are going to be more of an issue with the 12 series than they were with the 18, so be on the lookout for that as you're transporting code. Other than that, most of the mnemonics are going to be similar.


Dan
Owner
 
...and, of course, #define statements available in a header file or at the top of the code are always good for making code portability from micro to micro much more convenient - all you have to do is copy the code from micro to micro and update the #define statements...
 
Why not move to a 18F and run at a faster rate....collect your data in an ISR and run the main program?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor