Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Need some help with this code

Status
Not open for further replies.

abidr

Full Member level 5
Full Member level 5
Joined
Feb 14, 2007
Messages
255
Helped
37
Reputation
74
Reaction score
32
Trophy points
1,308
Location
33 N, 73 E
Visit site
Activity points
2,691
Guys I am doing a project with PIC18F2550/4550 I have compiled the bootloader for the device.

My whole project is in Hitech C for PIC18, now I need to adopt my code so that code starts from 800 instead of 0000, I have found the following code but it is for C18, I need to change it to Hitech C for PIC18, I will be thankful for the help

Code:
extern void _startup (void);        
#pragma code _RESET_INTERRUPT_VECTOR = 0x000800
void _reset (void)
{
_asm goto _startup _endasm
}
#pragma code
#pragma code _HIGH_INTERRUPT_VECTOR = 0x000808
void _high_ISR (void)
{
;
}
#pragma code _LOW_INTERRUPT_VECTOR = 0x000818
void _low_ISR (void)
{
;
}
/* This pragma forces the code below this line to be put into the code */
/* section (memory address >= 0x82A). See linker script for details. */
#pragma code
 

Hi abidr, you should see on your Hitech User's Manual how is to define a code section using this compiler. I use MCC18 from Microchip so I'm not sure about this. Search for #pragma psect text=??? where ??? I guess is the desired start address of text section (code section). You should try with this and see where the code is stored. The Hitech C18 manual can be downloaded from Microchip web. I hope this can be helpful. Yosmany325
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top