Jump to content
Sign in to follow this  
Badejavu

Fixed Memory Address And Interrupt In Mplabx

Recommended Posts

Hi,

 

I am using boostC with MplabX for PIC18F67K22. I have tried to :

 

1. Use fixed address like " int x@0x100" . This has worked for me previously in Mplab. Do I need to include any libraries to make this work in MplabX?

 

2. When I add an interrupt service routine as instructed in the boosC manual " void interrupt ( ) " the compiler shows error on all code lines in the isr. it does not see it as an interrupt. Is there a particular way to declare this in the MplabX environment?

 

3. Even when I include the "string.h" directive, the string length function "strlen(string)" is not recognised by the compiler. Hence the corresponding line is highlighted as an error.

 

 

Thanks

Bade

 

I also tried including all these files below, but it still didn't work.

#include <stdio.h>
#include <stdlib.h>
#include <system.h>
#include <boostc.h>
#include <BoostCPic18.h>
#include "PIC18f67k22.h"
#include <float.h>
#include <eeprom.h>
#include <string.h>

 

 

 

 

Share this post


Link to post
Share on other sites
#include <system.h> //don't include BoostCPic18.h or BoostCPic18.h
#include <string.h> //under MPLAB or MPLAB X add 'libc.pic18.lib' to your project

//Target PIC18F67K22 configuration word (please add)

//Set clock frequency (modify to suit your board)
#pragma CLOCK_FREQ 4000000

int  x@0x100;

void interrupt( void )
{
}

void interrupt_low( void )
{
}

void main( void )
{
	char string[] = "My test";
	x = strlen(string);
	
	//Endless loop
	while( 1 ) ;
}

When you say compiler shows error or is not recognised by the compiler do you really mean compiler or it's MPLAB who shows the errors? If that's MPLAB it doesn't necessarily mean that the code is wrong, just that MPLAB doesn't know how to parse it.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Hi

 

MPLAB X text pre-processing has some issues when trying to track macros and function in nested header files.

This makes it to flag source code lines has having errors when in fact there is none.

It happens also with Microchip XCnn toolchains but its an IDE issue only.

 

Only errors and warnings you need to worry about are the ones from the compiler and linker.

 

HIH

 

Best regards

Jorge

Edited by JorgeF

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×