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

PIC18F2550 INT_RC

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



Joined: 07 Jan 2017
Posts: 16

View user's profile Send private message

PIC18F2550 INT_RC
PostPosted: Fri Jan 27, 2017 6:23 am     Reply with quote

Hi lads, I want to use the internal oscillator on 18f2550 but delays are not ok. Delays are critical in my project cause I need to use a range with delay_us.

Code:

#include <18F2550.h>
#fuses NOMCLR INTRC_IO
#use delay(clock = 8000000)
#use fast_io(A)


void main() {
  output_a(0);
  set_tris_a(8);

  while(TRUE){
 
     output_high(pin_A0);
     delay_ms(100);
     output_low(pin_A0);
     delay_ms(100);
  }
}



This is a test, which for some reason instead of blinking at 100 millisecond, blinks at 470 milliseconds. I now int osc is not precise as crystals, but like this.
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Fri Jan 27, 2017 7:32 am     Reply with quote

Code:

#include <18F2550.h>
#fuses NOMCLR INTRC_IO
#use delay(INTERNAL = 8MHz)


The default clock rate for the internal oscillator is not the 8MHz branch. You have to specify this to be used.
However you are aware that the chip can't do USB with the internal oscillator?. Seems silly to be using a USB chip and then wasting this feature.....
ViperARG



Joined: 07 Jan 2017
Posts: 16

View user's profile Send private message

PostPosted: Mon Jan 30, 2017 7:05 am     Reply with quote

Ttelmah wrote:
Code:

#include <18F2550.h>
#fuses NOMCLR INTRC_IO
#use delay(INTERNAL = 8MHz)


The default clock rate for the internal oscillator is not the 8MHz branch. You have to specify this to be used.
However you are aware that the chip can't do USB with the internal oscillator?. Seems silly to be using a USB chip and then wasting this feature.....


Im a starter on PIC's I been told to use Delphi for USB apps but I didn't manage to get it working, so Im starting with easier stuff...
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