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 CCS Technical Support

problem with 18f26j50

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



Joined: 18 Jun 2010
Posts: 27

View user's profile Send private message

problem with 18f26j50
PostPosted: Sun Aug 07, 2011 7:18 am     Reply with quote

Hello, it is the first time that I use 18f26j50. I used before 18f4550, it
wasn't so complicated.

Code:

#include "18f26j50.h"
#fuses HSPLL,NOWDT,NOCPUDIV,PLL5
#use delay(clock=48M)

void main()

   SETUP_ADC(ADC_OFF);
   SETUP_ADC_PORTS(NO_ANALOGS);
   output_b(0x00);
   set_tris_b(0x00);
   while(1)
   {
      output_b(0x00);
      delay_ms(1000);
      output_b(0b00111111);
      delay_ms(1000);
   }
}


I have problems to make choice for the fuses because I don't know enough about them.
In the data sheet I took a look in the oscillator diagram they mentioned. As I understand: I have to fix the PLLDIV, CPDIV, the use of external or internal oscillator.
I have to fix this problem.

Thanks for everybody.
Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Aug 07, 2011 12:42 pm     Reply with quote

What's your CCS compiler version ?

What is the frequency of your external crystal ?
farouk_baya



Joined: 18 Jun 2010
Posts: 27

View user's profile Send private message

PostPosted: Sun Aug 07, 2011 5:12 pm     Reply with quote

hello,

20 MHz external crystal

ccs c 4.110
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Aug 07, 2011 9:08 pm     Reply with quote

I think this setup will work with your version:
Code:

#include <18F26J50.h>
#fuses HSPLL, NOWDT, PLL5
#use delay(clock=48M)

//============================
void main()
{
setup_oscillator(OSC_PLL_ON);

while(1);
}
farouk_baya



Joined: 18 Jun 2010
Posts: 27

View user's profile Send private message

PostPosted: Mon Aug 08, 2011 4:28 am     Reply with quote

Thanks for you help.
It works very fine.
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