- This topic has 3 replies, 4 voices, and was last updated 10 years, 7 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › Can I retarget 8051 MCU code to PIC18F or PIC16F series?
Hi,
please can I retarget a C source code originally written for 8051 microcontroller to PIC?
Which IDE is the best for programming PIC
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..
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.
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.