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

Pic18F25K22 int osc 64 MHz

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



Joined: 07 Oct 2011
Posts: 8

View user's profile Send private message Send e-mail Visit poster's website

Pic18F25K22 int osc 64 MHz
PostPosted: Sat Dec 29, 2012 9:48 pm     Reply with quote

Hi

I need to get same starting header with fuse and setup oscillator to get
PIC18F25K22 running at 64 MHz with internal oscillator ?

I have try this at 16 MHz but nothing on pin a0 ?

Thanks

Alain
Code:

#include <18f25k22.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC_IO                   
#FUSES NOPROTECT
#FUSES NOEBTRB
#FUSES NOEBTR
               
#FUSES NOWRTC
SC   
#FUSES NODEBUG

#device icd=true
#use delay(clock=16Mhz)


void Main(void){
setup_oscillator(OSC_16MHZ);
test:

delay_ms(1);
output_high(pin_a0);
delay_ms(1);
output_low(pin_a0);
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Dec 30, 2012 3:02 am     Reply with quote

As it stands pin_a0 only goes high for 1ms. You could easily miss it
Code:
delay_ms(1);
output_high(pin_a0);
delay_ms(1);
output_low(pin_a0);

Try this instead
Code:
while (1)
  {
     delay_ms(500);
     output_high(pin_a0);
     delay_ms(500);
     output_low(pin_a0);
  }

Connect an LED (with current limit resistor) to pin_a0, you'll see LED flash at 1Hz (IF everything is working correctly).

Mike
horizontechno



Joined: 07 Oct 2011
Posts: 8

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Dec 30, 2012 8:24 pm     Reply with quote

Thank you !!

Basic mistake ...

Alain
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