EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Can I retarget 8051 MCU code to PIC18F or PIC16F series?

Can I retarget 8051 MCU code to PIC18F or PIC16F series?

|

Microcontroller › PIC › Can I retarget 8051 MCU code to PIC18F or PIC16F series?

  • This topic has 3 replies, 4 voices, and was last updated 12 years, 10 months ago by AJISH ALFRED.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 4, 2012 at 12:43 am #1527
    Johnson
    Participant

    Hi,

    please can I retarget a C source code originally written for 8051 microcontroller to PIC?

     

    Which IDE is the best for programming PIC

    April 4, 2012 at 7:30 am #7389
    anurudh tiwari
    Participant

    the register structure of the 8051 and pic series are different…. in the starting of code description of register and initialization does not match….if use chang these things ..then it may be possible..

    August 15, 2012 at 6:32 pm #8468
    chitra
    Participant

    hi Johnson

    of cource,u can retarget a C source code originally written for 8051 microcontroller to PIC.

     

    m using pic from 16F series n its working fine with some 8051 c code.in pic ,there are some advance features are available( in comparison with 8051).like built in adc,capture/compare  module etc…so when u are using ports as i/p or o/p, u have to disable all alternate features to use pin for particular operations.

    also u have to enable /disable different reset fun of pic according to ur appl..also choose perfect oscillator for program………..

    besides following all this, make initialization/declarations as per syntax of different PIC.

     

    best luck.

    August 19, 2012 at 6:14 pm #8483
    AJISH ALFRED
    Participant

     

    Hi,

    I think MPLAB is a nice IDE for PIC. Regarding retargeting, I don’t think its such an easy task. The logical part will work on any controller, but when you refer a particular peripheral like timer, uart etc. there will be lot of issues.

    If you are using only GPIO pins, then change their reference words as same as those declared in the PIC’s header file, and it may work. Replace the code for initial settings like clock settings etc. with normal PIC’s code itself.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Can I make two inputs from one?? June 21, 2025
  • Beats Solo 4 June 21, 2025
  • Behlke swich June 21, 2025
  • Is AI making embedded software developers more productive? June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise