It is currently 20 Jan 2019 09:44

All times are UTC + 1 hour

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 04 Mar 2018 21:54 

Joined: 04 Mar 2018 20:40
Posts: 1
I am a beginner in PIC programming and I have a problem when I try to program my PIC18F87j50, when I upload the code to my board via microbootloader it is shown this mesagge:
-HEX file contains code over device bootloader area

#pragma config WDTEN = ON       // Watchdog Timer Enable bit (WDT enabled)
#pragma config PLLDIV = 1       // PLL Prescaler Selection bits (No prescale (4 MHz oscillator input drives PLL directly))
#pragma config STVREN = ON      // Stack Overflow/Underflow Reset Enable bit (Reset on stack overflow/underflow enabled)
#pragma config XINST = OFF      // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode enabled)

#pragma config CPUDIV = OSC1    // CPU System Clock Postscaler (No CPU system clock divide)
#pragma config CP0 = OFF        // Code Protection bit (Program memory is not code-protected)

#pragma config FOSC = ECPLL     // Oscillator Selection bits (EC Oscillator with PLL, CLKO on RA6, ECPLL used by USB)
#pragma config FCMEN = ON       // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor enabled)
#pragma config IESO = ON        // Two-Speed Start-up (Internal/External Oscillator Switchover) Control bit (Two-Speed Start-up enabled)

#pragma config WDTPS = 32768    // Watchdog Timer Postscaler Select bits (1:32768)

#pragma config EASHFT = ON      // External Address Bus Shift Enable bit (Address shifting enabled, address on external bus is offset to start at 000000h)
#pragma config MODE = MM        // External Memory Bus Configuration bits (Microcontroller mode - External bus disabled)
#pragma config BW = 16          // Data Bus Width Select bit (16-bit external bus mode)
#pragma config WAIT = OFF       // External Bus Wait Enable bit (Wait states on the external bus are disabled)

#pragma config CCP2MX = DEFAULT // ECCP2 MUX bit (ECCP2/P2A is multiplexed with RC1)
#pragma config ECCPMX = DEFAULT // ECCPx MUX bit (ECCP1 outputs (P1B/P1C) are multiplexed with RE6 and RE5; ECCP3 outputs (P3B/P3C) are multiplexed with RE4 and RE3)
#pragma config PMPMX = DEFAULT  // PMP Pin Multiplex bit (PMP pins placed on EMB)
#pragma config MSSPMSK = MSK7   // MSSP Address Masking Mode Select bit (7-Bit Address Masking mode enable)

// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.

#include <stdio.h>
#include <stdlib.h>
#include <p18f87j50.h>
#define _XTAL_FREQ 20000000

void main()

  TRISD0 = 0x00;          //

  do {

    PORTD = 0xFF;        //

  } while(1);            //  loop


I don't know where is the problem, cause is a simple program to blink an LED, and I copied the main function from another post.
Thank you before hand.

PostPosted: 05 Mar 2018 14:18 
mikroElektronika team
User avatar

Joined: 25 Jan 2008 09:56
Posts: 10150

Please, can you attach you HEX here ?


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 1 guest

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 post attachments in this forum

Search for:
Jump to: