Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help required to migrate from pic16f84 to pic18f452

Status
Not open for further replies.

waqas_uet

Newbie level 4
Joined
Sep 29, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
i am using pic18f452.but i have code for pic16f84.i read that pic16 is compatible with pic18.so i run the program of pic16 by replacing .INC file to p18f452.inc.when i run the program in MPlab,it gives error that RP0 is not defined previously.now help me what should i do that is what are the changes i should make in program.i am uploading the coad,plz help me sooooooon.i think it is problem with bank selection.help me
 

Attachments

  • pic16.txt
    4.4 KB · Views: 44

Hi,

The 18F banks are a bit different to the 16F, for now your registers are fine, just remove all the RP0 instructions.
Niether is there any need for the Banksels , again all the system registers are in one fixed area.

Have not tried your code , so after removing the above instructions build your code again and see if any errors occur - then check the 16 and 18 datasheets to see what the reason is.
 

i replaced this instruction by writing bsf status 03h,5
it was built success fully.but when i include its hex file in proteus,it does not give output.the lcd should show rpms.but it doesnot do so.i am uploading the design and new code.plz help me
 

Attachments

  • waqas rpm.rar
    15.5 KB · Views: 69

Hi,

Well no idea how you sucessfully built the code, it would not do it for me ?

I meant remove that entire instruction BSF STATUS,RP0 and Banksel.
After taking them out it does give several other errors which I have corrected.

Have also added a CONFIG line which tells it what oscillator to use - a xtal.

When the code is run it does not like that switch being used on the lcd line ??

Also note that you do not need the xtal on the diagram as long as you edit properties and specify the right clock speed of 4meg - if thats correct ?
The contrast pot on the lcd is not needed either.


Am not going through your code line by line to find the problem, think you would be better simulating the program and design as the 16f84 and proving that actually works before you try porting it to another chip.

A lot of web based programs never work without corerection etc.
 

Attachments

  • waqasrpm.rar
    14.7 KB · Views: 71

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top