Why won't my PIC turn on?

Status
Not open for further replies.

chris414

New Member
My PIC18F4550 works fine when connected to the PicKit2 debugger, but now that I want to run the device by itself it refuses to turn on. I have set the MCLR pin to high and still it does not turn on. Is there something I'm missing?
 
how do i change it? I see in the datasheet is says it's in the "config4L" register but that it isn't in the user program memory space or something...
 
MCLR still needs a resistor pulled high... and make sure your FOSC settings are correct. I ran into many problems just because the OSC setting was different heh
 
Whithout knowing which compiler you use ... not obvious ...

but your asm line should look like this :

Code:
    __CONFIG    _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L

( this is a 18F452 header ... so verify if same for 4550 ! )

otherwise ...

just post the config section and the very beginning of your program ...

Alain
 
Last edited:
MCLR still needs a resistor pulled high... and make sure your FOSC settings are correct. I ran into many problems just because the OSC setting was different heh

I am using a resistor pulling MCLR high and still does not work. What do you mean about the FOSC settings? What should I be looking for?


I am using MPLAB - here is the config code from my program:
Code:
#if defined(PICDEM_FS_USB)      // Configuration bits for PICDEM FS USB Demo Board (based on PIC18F4550)
        #pragma config PLLDIV   = 5         // (20 MHz crystal on PICDEM FS USB board)
        #pragma config CPUDIV   = OSC1_PLL2   
        #pragma config USBDIV   = 2         // Clock source from 96MHz PLL/2
        #pragma config FOSC     = HSPLL_HS
        #pragma config FCMEN    = OFF
        #pragma config IESO     = OFF
        #pragma config PWRT     = OFF
        #pragma config BOR      = ON
        #pragma config BORV     = 3
        #pragma config VREGEN   = ON      //USB Voltage Regulator
        #pragma config WDT      = OFF
        #pragma config WDTPS    = 32768
        #pragma config MCLRE    = ON
        #pragma config LPT1OSC  = OFF
        #pragma config PBADEN   = OFF
//      #pragma config CCP2MX   = ON
        #pragma config STVREN   = ON
        #pragma config LVP      = OFF
//      #pragma config ICPRT    = OFF       // Dedicated In-Circuit Debug/Programming
        #pragma config XINST    = OFF       // Extended Instruction Set
        #pragma config CP0      = OFF
        #pragma config CP1      = OFF
//      #pragma config CP2      = OFF
//      #pragma config CP3      = OFF
        #pragma config CPB      = OFF
//      #pragma config CPD      = OFF
        #pragma config WRT0     = OFF
        #pragma config WRT1     = OFF
//      #pragma config WRT2     = OFF
//      #pragma config WRT3     = OFF
        #pragma config WRTB     = OFF       // Boot Block Write Protection
        #pragma config WRTC     = OFF
//      #pragma config WRTD     = OFF
        #pragma config EBTR0    = OFF
        #pragma config EBTR1    = OFF
//      #pragma config EBTR2    = OFF
//      #pragma config EBTR3    = OFF
        #pragma config EBTRB    = OFF

(I'm using one of the USB demo's off microchip's website as part of my project, so headers are from them)
 
Last edited:
You have a 20Mhz Crystal on the board? Do you have a schematic? Are you using the PICDEM FS USB Board?
 
You have a 20Mhz Crystal on the board? Do you have a schematic? Are you using the PICDEM FS USB Board?

Yes I'm using a 20Mhz crystal. I'm using a PIC18F4550 which is on the FS USB board, and have replicated the parts of the demo board relevant to the USB part of the program (just two LEDs and the USB connections really). Then I have a IR detector which pulses an input into pin 17 for capture. (I'm making an IR remote that just acts like a keyboard to the computer to provide shortcut key combinations).
 
This might sound stupid but...
Did you program the chip or are did you simply use it in DEBUG and disconnected then tried to run it alone? There is a difference from using it in MPLAB and Programming it you know.
 
This might sound stupid but...
Did you program the chip or are did you simply use it in DEBUG and disconnected then tried to run it alone? There is a difference from using it in MPLAB and Programming it you know.

Thanks, i'd never heard of that! Everything working now
 
yeah what does the debugging mode do then if it isn't programming the device? or is it just programming it in a "different" way?
 
the debug is the same thing i think but it uses the PC to control the flow... or something like that... Programming is just that programming...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…