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

PIC18F2550 CLOCK SETUP

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



Joined: 27 Apr 2008
Posts: 167

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

PIC18F2550 CLOCK SETUP
PostPosted: Wed Sep 29, 2021 10:36 am     Reply with quote

Hi.

I am developing a I2C communication between PIC18F2550 and PIC 16F628. Both circuits start with a full 7 segments lit, to test all the 7 segments displays, segments A-G and DP on. Them I wait a delay of 5000ms, and start with all displays with 0 value. This initial 5000 ms delay works very well on the PIC16F628, but not in PIC18F2550, in this last processor, the delay is much bigger than 5000 ms. I wonder if the FUSES is correctly configured, to use an 8Mhz internal clock.
Code:

#include <16f628A.h>
#fuses INTRC_IO, NOWDT, NOPROTECT, NOBROWNOUT, NOMCLR, NOCPD, PUT, NOLVP
#use delay(clock=4000000, RESTART_WDT)
#use I2C(SLAVE, SCL=PIN_B2, SDA=PIN_B1, ADDRESS=0x20)


Code:

#include <18F2550.h>
#fuses INTRC_IO, NOWDT, NOPROTECT, NOLVP, NODEBUG, VREGEN, PUT, FCMEN
#use delay(internal=8MHz)
#use I2C(MASTER, SDA=PIN_B0, SCL=PIN_B1)


Regards;
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 29, 2021 5:54 pm     Reply with quote

You have to add CPUDIV1 to the fuses for the 18F2550.

See this thread for an explanation:
http://www.ccsinfo.com/forum/viewtopic.php?t=53089
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Thu Sep 30, 2021 1:58 am     Reply with quote

Yes, this is a lovely little 'oddity', where the data sheet is wrong, and
the CCS default setup, follows the data sheet.... Eeek!...

It was brilliant work by PCM back in that older thread that actually
narrowed down what was happening.
However as outlined in that thread, using this PIC with the internal RC
is a very unusual way to work, since you are then paying for a USB
PIC that can't then do USB... Sad
rudy



Joined: 27 Apr 2008
Posts: 167

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

PostPosted: Thu Sep 30, 2021 6:45 am     Reply with quote

KKKKKK;

This PIC clock is really trick! It is not the first time that I suffer!

Thank you!
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