frankcr
Joined: 29 Apr 2010 Posts: 11
|
Problems with Pic24 and LED |
Posted: Tue Jun 29, 2010 11:26 pm |
|
|
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. |
|