CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

16F877 to 18F425 migration problems

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Henk



Joined: 22 Mar 2004
Posts: 6
Location: JOHANNESBURG, SOUTH AFRICA

View user's profile Send private message Send e-mail

16F877 to 18F425 migration problems
PostPosted: Thu Nov 11, 2004 6:23 am     Reply with quote

Hi.
I have run out of program space on a pic16F877 , so have loaded the code into a pic18f425, same hardware, including 4mhz xtal.
The code compiled and loaded (using MPLAB ICD 2) with no errors, but doesn't execute. I have checked the clock with a scope, and even tried setting to HS (this still OK for 18F425 at 4mhz). Only activity on the chip is the clock inputs, no other pins change state. Any ideas?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Nov 11, 2004 7:28 am     Reply with quote

Quote:
The code compiled and loaded (using MPLAB ICD 2) with no errors, but doesn't execute.


This is with the PCH compiler, right?

Quote:
and even tried setting to HS (this still OK for 18F425 at 4mhz).

No, should be XT

Write a small "test" program with the new chip and see if it does anything.

Also make sure that you have NOLVP in the fuses. I believe the LVP pin changed on the 18's and this will cause you problems if you don't disable it.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Nov 11, 2004 8:35 am     Reply with quote

These are totaly different processors,.. Did you change the references to port locations and OTHER processor specific items?

ie: port A on 16F877A = 0x005
port A on 18F452 = 0xF80

There are alot of things that might need to be changed.

Did you change these??
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Nov 11, 2004 8:50 am     Reply with quote

Timer0 is 16bits also but has an 8bit mode as well.
Henk



Joined: 22 Mar 2004
Posts: 6
Location: JOHANNESBURG, SOUTH AFRICA

View user's profile Send private message Send e-mail

PostPosted: Thu Nov 11, 2004 2:24 pm     Reply with quote

Thanx Mark. As advised, a simple test program runs correctly on the existing hardware.
Seems, however, to be some incompatibility with the running of the LCD routine on the new processor, although it runs perfectly on the 877. Addressing is taken care of in the include file 18F452.h, which I also checked against the data sheets.My application program code begins with messages to a 2x16 display, so this gave the impression that the processor was not running. Is this a known problem with the 452?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Nov 11, 2004 2:43 pm     Reply with quote

Only the problems mentioned hear are the ones that I have seen. Take a baby step and write a simple program to write to the display to make sure those routines are good.
Henk



Joined: 22 Mar 2004
Posts: 6
Location: JOHANNESBURG, SOUTH AFRICA

View user's profile Send private message Send e-mail

PostPosted: Sat Nov 13, 2004 12:44 am     Reply with quote

Got it. You were both right. Clever Henk deleted some lines in the standard LCD.C routine to save code space, and set portD address at 8 for 16F877.

thanks again.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group