Discussion in "PIC Microcontroller Discussion" started by    Emb_cool    Aug 24, 2012.
Fri Aug 24 2012, 07: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, 07: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, 07:09 PM ]
Sat Aug 25 2012, 06: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, 07: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, 11:48 AM
#5
Nice Explanation Ajay Bhargav
 Emb_cool like this.
Mon Aug 27 2012, 05: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, 11:11 AM
#7
Thank you sir again , I ill Check this one . .
Tue Aug 28 2012, 04:50 AM
#8
sure let me know as you progress
Thu Nov 08 2012, 06: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

Sun Oct 13 2019, 02:02 AM
Aline Hutchinson
Hey there,
ExperimenterUK
Sat Oct 12 2019, 10:23 PM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 10:18 AM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 07:37 AM
Nathaniel
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Wed Sep 18 2019, 08:48 PM
Caryn Kover
Thank you for your time,
ExperimenterUK
Mon Aug 05 2019, 07:09 PM
@Ismail ..post in forum, give details
Mon Aug 05 2019, 04:33 PM
Ismail balghmi
Hello. Please I won't download
ExperimenterUK
Wed Jul 24 2019, 12:47 AM
@BUSTER123 Please post in the forum
Tue Jul 23 2019, 06:13 PM
BUSTER123
hello! newbie here. i am kind of a guy who hates using ready - made existing libraries, so this helped a lot as i was trying to control and write to a character lcd display. however, i can't figure out how to set the cursor position. for example, i want to set it to the 5th column in the first row, so position 5. so according to the table, i am sending 10000101 on the 8 data lines of the lcd (register select pulled low). the cursor does not move there however. and i cant move the cursor left or right too. is it something wrong that i am doing? thank you.
ExperimenterUK
Thu Jul 11 2019, 07:55 PM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html

Downloads

Comments

ilylily07
Tue Oct 15 2019, 04:32 PM
hientran123
Tue Oct 15 2019, 02:27 AM
Sat Oct 05 2019, 02:38 PM
zexalo
Thu Oct 03 2019, 09:53 AM
thanhle12345
Thu Oct 03 2019, 07:37 AM
ramon_vsc
Fri Sep 20 2019, 04:53 PM
youssoufba
Thu Sep 19 2019, 11:57 AM
Taiphan000
Tue Sep 17 2019, 04:21 AM

Online

Guests: 43, Members: 0 ...

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

Members: 38097
Newest member: ilylily07
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Oct 22 2019, 05:18 AM
wimac Avatar
Posted By wimac
Mon Oct 21 2019, 09:18 AM
I’ve been following this thread and looking at the...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:09 PM
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 03:02 PM
sir, when i on display ,sometime 3rd display is no...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sun Oct 20 2019, 02:53 PM
sir, when i on display ,sometime 3rd display is no...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 20 2019, 12:21 AM
Your code seems okay on my simulationTry my code o...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:13 PM
please find video attachment. 3rd & 4th displa...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Sat Oct 19 2019, 07:05 PM
sir, 3rd and 4th dot matrix display flickering, ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Oct 18 2019, 09:18 PM
Hopefully you understand some of the program.Which...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Thu Oct 17 2019, 09:38 PM