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

Problems with Pic24 and LED

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



Joined: 29 Apr 2010
Posts: 11

View user's profile Send private message MSN Messenger

Problems with Pic24 and LED
PostPosted: Tue Jun 29, 2010 11:26 pm     Reply with quote

I want to use the pic 24fj128GA006 and a LED but I can't do it.
Here is my code:
Code:

#include <24FJ128GA006.h> //MICROCONTROLADOR UTILIZADO
//#device adc=10 //ADC 10 Bits de presicion
//****************************** FUSES **********************

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOJTAG                   //JTAG disabled
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES ICSP1                    //ICD uses PGC1/PGD1 pins
#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 IESO                     //Internal External Switch Over mode enabled
#FUSES FRC                      //Internal Fast RC Oscillator
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES NOOSCIO                  //OSC2 is clock output
#FUSES NOPR                     //Pimary oscillaotr disabled
 
#use delay (clock=4000000)         //Fosc=4Mhz
#use fast_io(e)

///PROGRAMA
void main(void)
{
   set_tris_e(0x3FE);   //portb como salida(RB0,las demas desactivadas)

   
   do{   
      output_low(PIN_E0);   //led off
      delay_ms(500);           
      output_high(PIN_E0);   //led on
      delay_ms(500);
   }while(TRUE);         //bucle infinito
}

I don't know if the problem is in the fuses.
I use the internal oscillator.
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