|
|
View previous topic :: View next topic |
Author |
Message |
AngeloColp
Joined: 17 Jul 2008 Posts: 2
|
Reset vector address change |
Posted: Fri Jul 25, 2008 10:42 am |
|
|
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
|
|
Posted: Fri Jul 25, 2008 12:42 pm |
|
|
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
|
Reset vector address change |
Posted: Mon Jul 28, 2008 12:55 am |
|
|
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 |
|
|
|
|
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
|