CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Reset vector address change

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
AngeloColp



Joined: 17 Jul 2008
Posts: 2

View user's profile Send private message

Reset vector address change
PostPosted: Fri Jul 25, 2008 10:42 am     Reply with quote

Dear all,

I've written a little application with PIC16F916.
All works fine in standard set-up condition (without any address change).
The device works ok after programming.

I've to insert at the address 0x0000 two instructions:
nop
movlw 0x07

so i wrote this:
#build( reset=0x0002, interrupt=0x0006 )
#rom 0x0000 = {0x0000, 0x3007}

and all compiles correctly without errors.
I looked to the program memory window and checked the correct reset vector at the new position.

I program the device (using MPLAB-ICD2), and all is ok.
But when I give the power to the device, it doesn't anything.

Any ideas?

Thanks a lot.
Angel
Ttelmah
Guest







PostPosted: Fri Jul 25, 2008 12:42 pm     Reply with quote

Are you using the interrupt?.
If so, it won't work.
The physical interrupt _always_ calls address 4. All 'build' does, is to relocate where the compiler puts the code. The assumption is that you will put 'real' code at address 4, that will correctly jump to the new interrupt code address.

Best Wishes
AngeloColp



Joined: 17 Jul 2008
Posts: 2

View user's profile Send private message

Reset vector address change
PostPosted: Mon Jul 28, 2008 12:55 am     Reply with quote

Thank you very much.

Yes, in fact I use the interrupts.

In this days, I've also tried another solution, like following:

#build( reset=0x0600 )
#rom 0x0600 = {0x0000, 0x3007}

I looked again to the program memory window and checked the correct reset vector at the new position, with the correct jump to the main address.

This also compiles correctly, and does not have influence on the interrupt vector. All goes right, but when I give power, the device does not work.

I'll try to apply your suggestion.
Thanks a lot.

Kind regards,
Angel
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group