×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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?

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

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.

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

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
http://www.Hi-TecDesigns.com

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

...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...

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

Why not move to a 18F and run at a faster rate....collect your data in an ISR and run the main program?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources