-2

I'm trying to use Master clear(MCLR) on a pic18f4550 with Proteus, but whenever I press the button to do so, the red and blue dots that represent on and off in Proteus turn yellow and the LED doesn't turn off.

I'm trying to replicate a Proteus file that my professor used and it worked perfectly, but even though it seems my file is looking exactly the same as his, it doesn't work.

Here's my circuit: my circuit,

M professor's circuit: professor's circuit,

and here's what happens when I press the MCLR button: MCLR button.

Here's the code, but I'm pretty sure that's not the problem

#include <p18f4550.h>
#include <delays.h>
#pragma config  FOSC    =   HS
#pragma config  PWRT    =   ON
#pragma config  PBADEN  =   OFF
#pragma config  WDT     =   OFF
#pragma config  LVP     =   OFF
#pragma config  MCLRE   =   ON
void main()             
{
    TRISB=0x00;         
    PORTB=0b11111111;    
                                         
    while (1){
        PORTBbits.RB1 = 0;
        Delay1KTCYx(100);
        PORTBbits.RB1 = 1;
        Delay1KTCYx (100);
    }                             
}

The only error message I get is from Proteus, that says:

[PIC18]PC=0x00BC $MCLR$ is low. Processor is in reset.

Roberto Caboni
  • 7,252
  • 10
  • 25
  • 39
  • 1
    Please take the [tour], read [ask] and if you want help, post all relevant information. Links to offset information are generally frowned upon. – jwdonahue Aug 17 '19 at 19:31
  • 1
    Check voltage level on pin 1 (MCLR )! – GJ. Aug 19 '19 at 09:35

1 Answers1

1

Connect MCLR pin with 10K resistor to power.