Discussion in "PIC Microcontroller Discussion" started by    Emb_cool    Aug 24, 2012.
Fri Aug 24 2012, 03:25 AM
#1
Hi Every Onel ,

Currently i m trying to write the bootloader code for PIC series ,i need to know the working of the controller , according to my understanding reset vector is the address where the controller begins to execute instruction whenever the controller reset occur,and interrupt vector is the address , to which controller ill call back to it when the peripheral interrupt if any occurs .
The bootloader code is the code which is capable of flashing the user code into the program memory, so from this point there ill be two applications in the microcontoller , my doubt is whether bootloader application and user code application both uses the same reset vector (0x0000) / interrupt vector (0x0004) or each application will have different reset and interrupt vector . If this question is kidding, forgive me ..


Fri Aug 24 2012, 03:03 PM
#2
i am also waiting for the answer
and for simply interrupt demonstration

http://www.8051projects.net/t43305/8051-discussion-forum/interrupt-demonstration.htm


[ Edited Fri Aug 24 2012, 03:09 PM ]
Sat Aug 25 2012, 02:54 AM
#3

The bootloader code is the code which is capable of flashing the user code into the program memory, so from this point there ill be two applications in the microcontoller , my doubt is whether bootloader application and user code application both uses the same reset vector (0x0000) / interrupt vector (0x0004) or each application will have different reset and interrupt vector . If this question is kidding, forgive me ..

Emb_cool


Lets talk on this regarding PIC microcontroller, reset vector is controller's property and controller will always jump to its reset vector whenever reset occurs, no matter you have one or two applications inside your controller. same is that case with interrupt vector.

Now talking about bootloader + user application scenario. reset vector and interrupt vectors are common to both bootloader and user app. Bootloader is always executed first whenver user press a reset switch. and bootloader checks if there is a programming request or not, if not then it jumps to user app. and user app executes normally. Now you must be thinkin how user app works if an interrupt occurs. Bootloaders are usually written without using interrupts and user app is always programmed to fixed location lets say bootloader at 0x000 location and user app at 0x1000 location. so you user app is linked with a special linker file where its hex file starts from location 0x1000 as its reset location and 0x1004 as its interrupt vector location. In bootloader side interrupt vectors always have a simple goto jump to user app location.. i.e. at interrupt vector location 0x0004 there is always a jump in bootloader to 0x1004 location which executes user app ISR routine. so everything works seamlessly.

Incase on bigger controllers like ARM, there is a provision of vector relocation, user can specify a custom location for interrupt vectors. so bootloader and user application both can have its own interrupts and ISRs. You will come to know when you work on it

I hope this helps in answering your question a bit.
 Emb_coolMiguelito like this.
Tags PIC bootloader workingunderstanding PIC bootloaderbootloader interrupts
Sat Aug 25 2012, 03:34 AM
#4
Thankyou a lot Ajay sir, your explanation were very clear ,it has cleared my doubt .And i now able to understand the role of reset/interrupt vector in userApplication code and bootloader code .What is that special Linker file sir ...
Thankyou majoka sir for interrupt demonstration , it helped me to understand interrupts better ...
Sat Aug 25 2012, 07:48 AM
#5
Nice Explanation Ajay Bhargav
 Emb_cool like this.
Mon Aug 27 2012, 01:11 AM
#6
Thanks you guys

You application codes be it bootloader or anything uses a default linker file. when working in bootloader/app environment you need to modify that linker file to link your code to a different location which in above example I considered 0x1000. You can search in your MPLAB installation directory (if you are using C18 or Microchip compiler) look for ".lkr" file. copy that file in your project directory, modify it and provide it as linker for your project. You might need to look into your compiler's user guide for more help on linker scripts.
Mon Aug 27 2012, 07:11 AM
#7
Thank you sir again , I ill Check this one . .
Tue Aug 28 2012, 12:50 AM
#8
sure let me know as you progress
Thu Nov 08 2012, 01:58 AM
#9
Ajay's explanation above enlighten me.
Although I have some questions on the bootloader side, here ( http://www.8051projects.net/t58325/8051-discussion-forum/startup-code-for-bootloader-please-explain.htm )

Hope somebody can help me understanding the code.

thanks in advance.
Miguelito

Get Social

Information

Powered by e107 Forum System

Conversation

scena
Tue May 19 2020, 06:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 03:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 09:39 AM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 06:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 08:55 AM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 12:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 11:58 AM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 05:12 AM
Pearl Olin
Hello,
Wed Jan 22 2020, 01:16 PM
MINU CHAUDHARY
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.
Tue Jan 14 2020, 02:08 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me

Downloads

Comments

Davidthils
Thu May 21 2020, 08:44 AM
Jakeror
Wed May 20 2020, 09:28 PM
motorCar
Wed May 20 2020, 03:05 PM
Vordrync
Wed May 20 2020, 07:52 AM
JadenjiT
Wed May 20 2020, 03:15 AM
scena
Tue May 19 2020, 06:08 PM
CodySiz
Tue May 19 2020, 02:22 PM
ClaireSat
Mon May 18 2020, 09:50 PM

Online

Guests: 63, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 01:37 AM

Members: 38211
Newest member: Davidthils
Forum Activity
xrxx Avatar
Posted By xrxx
Thu Apr 30 2020, 06:59 AM
BCD MULTIPLICATIONAssume that you have to 2 BCD nu...
liqian Avatar
Posted By liqian
Tue Apr 28 2020, 05:26 AM
I happened to see your post and I got many useful ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 28 2020, 04:21 AM
The code is hard to read.Please zip it and attach ...
rogermado Avatar
Posted By rogermado
Sun Apr 26 2020, 01:53 AM
@ExperimenterUK, thanks for your reply. You'll fin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Apr 25 2020, 05:42 PM
Some simulators handle displays better than others...
rogermado Avatar
Posted By rogermado
Sat Apr 25 2020, 03:59 PM
Hello everyone, sorry in advance if i'm not in the...
PHANTOM28 Avatar
Posted By PHANTOM28
Fri Feb 28 2020, 10:25 AM
Hi.I hope you all can help me. I am relatively ne...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 21 2020, 05:05 PM
ajay_bhargav Avatar
Posted By ajay_bhargav
Fri Feb 21 2020, 04:45 AM
Yes you can do that.1. Create a channel @Thingspea...
ananyagupta Avatar
Posted By ananyagupta
Thu Feb 20 2020, 03:58 AM
With regards to the particular characters sent to ...