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

Starting PIC18 and PIC24

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



Joined: 19 Feb 2010
Posts: 8

View user's profile Send private message

Starting PIC18 and PIC24
PostPosted: Fri Feb 19, 2010 4:54 am     Reply with quote

Hello to all,

I'm starting using PIC18 and PIC24 family with PCWHD 4.093.
I have few PIC like 24HJ64GP502, 18F25J11, 24HJ128GP502. I wrote a simple code for blinking a led but it's not working.
Maybe I don't configure fuses in the right way.
Here the code:
Code:
#include <24hj64gp502.h>

#fuses FRC,NOWDT
#use delay(clock=7370000)

void main()
{
set_tris_b (0xf0);   

while(TRUE)
   {
   output_low(PIN_B3);
   delay_ms(200);
   output_high(PIN_B3);   
   delay_ms(200);
   }
}


Thank you for your help.

Raffaele
logical



Joined: 21 Dec 2009
Posts: 57
Location: SouthPort, UK

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

PostPosted: Fri Feb 19, 2010 11:49 am     Reply with quote

A copy of my fuses that work with the internal oscillator, did a blink led program myself as just started on the GP502 and GP504's.

Code:
#include<24HJ128GP502.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOBSS                    //No boot segment
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES FRC                      //Internal Fast RC Oscillator
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES OSCIO                    //OSC2 is general purpose output
#FUSES NOPR                     //Pimary oscillaotr disabled
#FUSES NOWINDIS                 //Watch Dog Timer in Window mode
#FUSES WPRES128                 //Watch Dog Timer PreScalar 1:128
#FUSES WPOSTS16                 //Watch Dog Timer PostScalar 1:32768
#FUSES PUT128                   //Power On Reset Timer value 128ms
#FUSES IOL1WAY                  //Allows only one reconfiguration of peripheral pins
#FUSES NOIESO                   //Internal External Switch Over mode disabled
#FUSES NORSS                    //No secure segment RAM
#FUSES NOSSS                    //No secure segment
#FUSES NOWRTSS                  //Secure segment not write protected
#FUSES NORBS                    //No Boot RAM defined
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOCOE                    //Device will reset into operational mode
#FUSES NOJTAG                   //JTAG disabled
#FUSES ICSP3                    //ICD uses PGC3/PGD3 pins
#FUSES NOALTI2C                 //I2C mapped to alternate pins

#use delay(clock=7370000)
raffaele



Joined: 19 Feb 2010
Posts: 8

View user's profile Send private message

PostPosted: Wed Feb 24, 2010 3:25 am     Reply with quote

Thank you, it works. I found also PIC24 Wizard is good to configure fuses.
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