From: JohnT on
I tried that already but with no success. The code I showed you is
straight from an example that came with the bootloader.


RaceMouse wrote:
> JohnT wrote:
> > How do I post my code, I can't see of a way to upload a file. The
> > start of my code is as follows though.
> >
> > ORG 0x00 ; Start of the program
> > CLRF STATUS
> > MOVLW 0x00
> > MOVWF PCLATH
> > GOTO INIT
> >
> >
> > ORG 0x04 ; Interrupt address
> > GOTO INT_HAND
> >
> > All I'm doing after it goes to the INIT routine is set all the outputs
> > on for PortA and B. I've simulated this and it works fine.
> >
> > John
> >
> > RaceMouse wrote:
> >
> >>JohnT wrote:
> >>
> >>>Thanks for the response.
> >>>
> >>>Firstly, my background is in PLC's and the various pieces of software I
> >>>use 'download to the PLC' or 'upload from the PLC'
> >>>
> >>>Secondly, the bootloader I'm trying to should move the 'goto'
> >>>instruction that you need to put in the first four lines of code to the
> >>>start of the bootloader code. This leaves the start of memory as the
> >>>bootloader set it, i.e. jump to the bootloader routine. After it has
> >>>executed the bootloader routine, it jumps to just before the bootloader
> >>>and should find the address of where to go next, i.e. the 'goto'
> >>>instruction in my code. If you look at the web address of my initial
> >>>query there is a nice picture showing what I've just tried to explain.
> >>>
> >>>The download program that is on that website must modify the hex file,
> >>>find the 'goto' instruction in the first four lines and overwrite that
> >>>line of the bootloader.
> >>>
> >>>I can't think how to test it though, has anyone else used a bootloader
> >>>successfully?
> >>>
> >>>John
> >>>
> >>>
> >>>RaceMouse wrote:
> >>>
> >>>
> >>>>Pietje Bell wrote:
> >>>>
> >>>>
> >>>>>Does the bootloader needs to know where the application is programmed?
> >>>>>(at what address)
> >>>>>
> >>>>>
> >>>>>
> >>>>>-------- Origineel bericht --------
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Hi All,
> >>>>>>
> >>>>>>Has anyone manged to get the tiny bootloader from
> >>>>>>http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm working?
> >>>>>>
> >>>>>>I have a 16F877A with a 4MHz crystal. I modified the frequency in the
> >>>>>>software and downloaded it with no problem. Running the software it
> >>>>>>discovers the PIC with no problem.
> >>>>>>
> >>>>>>However, I tried to create a simple program in assembler that would
> >>>>>>turn on all the outputs of Port B. I know my program works fine as
> >>>>>>I've downloaded it using a programmer. However, when I download it
> >>>>>>using the bootloader nothing happens. It appears that the PIC is
> >>>>>>'stuck' in the bootloader section and not jumping to my code when it's
> >>>>>>done.
> >>>>>>
> >>>>>>I suspect this is the case as the bootloader software detects the PIC
> >>>>>>straight away without the need for me to reset the PIC.
> >>>>>>
> >>>>>>Any ideas anyone?
> >>>>>>
> >>>>>>John
> >>>>>>
> >>>>
> >>>>My best quess is that your PIC progam should start with something like
> >>>>"ORG 0x100" or whatever the "jump-to-application-address" is.
> >>>>
> >>>>/RaceMouse
> >>>
> >>>
> >>Hmmm...
> >>
> >>Can you post the souce code of you application ?
> >>
> >>/RaceMouse
> >
> >
>
> Ok. It seems to me that you have 5 instructions within the first four
> program counts. Your Interrupt vector starts at 0x04 but your startup
> code ends at 0x05.
>
> My suggestion:
> ORG 0x00 ; Start of the program
> CLRF STATUS
> CLRF PCLATH
> GOTO INIT
>
> Please report back.
>
> /RaceMouse

From: Pietje Bell on
Are you linking your application code for the correct address?
The memory map should comply with the bootloader requirements.



> I tried that already but with no success. The code I showed you is
> straight from an example that came with the bootloader.
>
>
> RaceMouse wrote:
>> JohnT wrote:
>>> How do I post my code, I can't see of a way to upload a file. The
>>> start of my code is as follows though.
>>>
>>> ORG 0x00 ; Start of the program
>>> CLRF STATUS
>>> MOVLW 0x00
>>> MOVWF PCLATH
>>> GOTO INIT
>>>
>>>
>>> ORG 0x04 ; Interrupt address
>>> GOTO INT_HAND
>>>
>>> All I'm doing after it goes to the INIT routine is set all the outputs
>>> on for PortA and B. I've simulated this and it works fine.
>>>
>>> John
>>>
>>> RaceMouse wrote:
>>>
>>>> JohnT wrote:
>>>>
>>>>> Thanks for the response.
>>>>>
>>>>> Firstly, my background is in PLC's and the various pieces of software I
>>>>> use 'download to the PLC' or 'upload from the PLC'
>>>>>
>>>>> Secondly, the bootloader I'm trying to should move the 'goto'
>>>>> instruction that you need to put in the first four lines of code to the
>>>>> start of the bootloader code. This leaves the start of memory as the
>>>>> bootloader set it, i.e. jump to the bootloader routine. After it has
>>>>> executed the bootloader routine, it jumps to just before the bootloader
>>>>> and should find the address of where to go next, i.e. the 'goto'
>>>>> instruction in my code. If you look at the web address of my initial
>>>>> query there is a nice picture showing what I've just tried to explain.
>>>>>
>>>>> The download program that is on that website must modify the hex file,
>>>>> find the 'goto' instruction in the first four lines and overwrite that
>>>>> line of the bootloader.
>>>>>
>>>>> I can't think how to test it though, has anyone else used a bootloader
>>>>> successfully?
>>>>>
>>>>> John
>>>>>
>>>>>
>>>>> RaceMouse wrote:
>>>>>
>>>>>
>>>>>> Pietje Bell wrote:
>>>>>>
>>>>>>
>>>>>>> Does the bootloader needs to know where the application is programmed?
>>>>>>> (at what address)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -------- Origineel bericht --------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> Has anyone manged to get the tiny bootloader from
>>>>>>>> http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm working?
>>>>>>>>
>>>>>>>> I have a 16F877A with a 4MHz crystal. I modified the frequency in the
>>>>>>>> software and downloaded it with no problem. Running the software it
>>>>>>>> discovers the PIC with no problem.
>>>>>>>>
>>>>>>>> However, I tried to create a simple program in assembler that would
>>>>>>>> turn on all the outputs of Port B. I know my program works fine as
>>>>>>>> I've downloaded it using a programmer. However, when I download it
>>>>>>>> using the bootloader nothing happens. It appears that the PIC is
>>>>>>>> 'stuck' in the bootloader section and not jumping to my code when it's
>>>>>>>> done.
>>>>>>>>
>>>>>>>> I suspect this is the case as the bootloader software detects the PIC
>>>>>>>> straight away without the need for me to reset the PIC.
>>>>>>>>
>>>>>>>> Any ideas anyone?
>>>>>>>>
>>>>>>>> John
>>>>>>>>
>>>>>> My best quess is that your PIC progam should start with something like
>>>>>> "ORG 0x100" or whatever the "jump-to-application-address" is.
>>>>>>
>>>>>> /RaceMouse
>>>>>
>>>> Hmmm...
>>>>
>>>> Can you post the souce code of you application ?
>>>>
>>>> /RaceMouse
>>>
>> Ok. It seems to me that you have 5 instructions within the first four
>> program counts. Your Interrupt vector starts at 0x04 but your startup
>> code ends at 0x05.
>>
>> My suggestion:
>> ORG 0x00 ; Start of the program
>> CLRF STATUS
>> CLRF PCLATH
>> GOTO INIT
>>
>> Please report back.
>>
>> /RaceMouse
>
From: JohnT on
I believe I am, I've started my program as it states in the
documentation but it doesn't seem to get that far.


Pietje Bell wrote:
> Are you linking your application code for the correct address?
> The memory map should comply with the bootloader requirements.
>
>
>
> > I tried that already but with no success. The code I showed you is
> > straight from an example that came with the bootloader.
> >
> >
> > RaceMouse wrote:
> >> JohnT wrote:
> >>> How do I post my code, I can't see of a way to upload a file. The
> >>> start of my code is as follows though.
> >>>
> >>> ORG 0x00 ; Start of the program
> >>> CLRF STATUS
> >>> MOVLW 0x00
> >>> MOVWF PCLATH
> >>> GOTO INIT
> >>>
> >>>
> >>> ORG 0x04 ; Interrupt address
> >>> GOTO INT_HAND
> >>>
> >>> All I'm doing after it goes to the INIT routine is set all the outputs
> >>> on for PortA and B. I've simulated this and it works fine.
> >>>
> >>> John
> >>>
> >>> RaceMouse wrote:
> >>>
> >>>> JohnT wrote:
> >>>>
> >>>>> Thanks for the response.
> >>>>>
> >>>>> Firstly, my background is in PLC's and the various pieces of software I
> >>>>> use 'download to the PLC' or 'upload from the PLC'
> >>>>>
> >>>>> Secondly, the bootloader I'm trying to should move the 'goto'
> >>>>> instruction that you need to put in the first four lines of code to the
> >>>>> start of the bootloader code. This leaves the start of memory as the
> >>>>> bootloader set it, i.e. jump to the bootloader routine. After it has
> >>>>> executed the bootloader routine, it jumps to just before the bootloader
> >>>>> and should find the address of where to go next, i.e. the 'goto'
> >>>>> instruction in my code. If you look at the web address of my initial
> >>>>> query there is a nice picture showing what I've just tried to explain.
> >>>>>
> >>>>> The download program that is on that website must modify the hex file,
> >>>>> find the 'goto' instruction in the first four lines and overwrite that
> >>>>> line of the bootloader.
> >>>>>
> >>>>> I can't think how to test it though, has anyone else used a bootloader
> >>>>> successfully?
> >>>>>
> >>>>> John
> >>>>>
> >>>>>
> >>>>> RaceMouse wrote:
> >>>>>
> >>>>>
> >>>>>> Pietje Bell wrote:
> >>>>>>
> >>>>>>
> >>>>>>> Does the bootloader needs to know where the application is programmed?
> >>>>>>> (at what address)
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> -------- Origineel bericht --------
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>> Hi All,
> >>>>>>>>
> >>>>>>>> Has anyone manged to get the tiny bootloader from
> >>>>>>>> http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm working?
> >>>>>>>>
> >>>>>>>> I have a 16F877A with a 4MHz crystal. I modified the frequency in the
> >>>>>>>> software and downloaded it with no problem. Running the software it
> >>>>>>>> discovers the PIC with no problem.
> >>>>>>>>
> >>>>>>>> However, I tried to create a simple program in assembler that would
> >>>>>>>> turn on all the outputs of Port B. I know my program works fine as
> >>>>>>>> I've downloaded it using a programmer. However, when I download it
> >>>>>>>> using the bootloader nothing happens. It appears that the PIC is
> >>>>>>>> 'stuck' in the bootloader section and not jumping to my code when it's
> >>>>>>>> done.
> >>>>>>>>
> >>>>>>>> I suspect this is the case as the bootloader software detects the PIC
> >>>>>>>> straight away without the need for me to reset the PIC.
> >>>>>>>>
> >>>>>>>> Any ideas anyone?
> >>>>>>>>
> >>>>>>>> John
> >>>>>>>>
> >>>>>> My best quess is that your PIC progam should start with something like
> >>>>>> "ORG 0x100" or whatever the "jump-to-application-address" is.
> >>>>>>
> >>>>>> /RaceMouse
> >>>>>
> >>>> Hmmm...
> >>>>
> >>>> Can you post the souce code of you application ?
> >>>>
> >>>> /RaceMouse
> >>>
> >> Ok. It seems to me that you have 5 instructions within the first four
> >> program counts. Your Interrupt vector starts at 0x04 but your startup
> >> code ends at 0x05.
> >>
> >> My suggestion:
> >> ORG 0x00 ; Start of the program
> >> CLRF STATUS
> >> CLRF PCLATH
> >> GOTO INIT
> >>
> >> Please report back.
> >>
> >> /RaceMouse
> >

From: RaceMouse on
JohnT wrote:
> I believe I am, I've started my program as it states in the
> documentation but it doesn't seem to get that far.
>
>
> Pietje Bell wrote:
>
>>Are you linking your application code for the correct address?
>>The memory map should comply with the bootloader requirements.
>>
>>
>>
>>
>>>I tried that already but with no success. The code I showed you is
>>>straight from an example that came with the bootloader.
>>>
>>>
>>>RaceMouse wrote:
>>>
>>>>JohnT wrote:
>>>>
>>>>>How do I post my code, I can't see of a way to upload a file. The
>>>>>start of my code is as follows though.
>>>>>
>>>>> ORG 0x00 ; Start of the program
>>>>> CLRF STATUS
>>>>> MOVLW 0x00
>>>>> MOVWF PCLATH
>>>>> GOTO INIT
>>>>>
>>>>>
>>>>> ORG 0x04 ; Interrupt address
>>>>> GOTO INT_HAND
>>>>>
>>>>>All I'm doing after it goes to the INIT routine is set all the outputs
>>>>>on for PortA and B. I've simulated this and it works fine.
>>>>>
>>>>>John
>>>>>
>>>>>RaceMouse wrote:
>>>>>
>>>>>
>>>>>>JohnT wrote:
>>>>>>
>>>>>>
>>>>>>>Thanks for the response.
>>>>>>>
>>>>>>>Firstly, my background is in PLC's and the various pieces of software I
>>>>>>>use 'download to the PLC' or 'upload from the PLC'
>>>>>>>
>>>>>>>Secondly, the bootloader I'm trying to should move the 'goto'
>>>>>>>instruction that you need to put in the first four lines of code to the
>>>>>>>start of the bootloader code. This leaves the start of memory as the
>>>>>>>bootloader set it, i.e. jump to the bootloader routine. After it has
>>>>>>>executed the bootloader routine, it jumps to just before the bootloader
>>>>>>>and should find the address of where to go next, i.e. the 'goto'
>>>>>>>instruction in my code. If you look at the web address of my initial
>>>>>>>query there is a nice picture showing what I've just tried to explain.
>>>>>>>
>>>>>>>The download program that is on that website must modify the hex file,
>>>>>>>find the 'goto' instruction in the first four lines and overwrite that
>>>>>>>line of the bootloader.
>>>>>>>
>>>>>>>I can't think how to test it though, has anyone else used a bootloader
>>>>>>>successfully?
>>>>>>>
>>>>>>>John
>>>>>>>
>>>>>>>
>>>>>>>RaceMouse wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Pietje Bell wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Does the bootloader needs to know where the application is programmed?
>>>>>>>>>(at what address)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>-------- Origineel bericht --------
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Hi All,
>>>>>>>>>>
>>>>>>>>>>Has anyone manged to get the tiny bootloader from
>>>>>>>>>>http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm working?
>>>>>>>>>>
>>>>>>>>>>I have a 16F877A with a 4MHz crystal. I modified the frequency in the
>>>>>>>>>>software and downloaded it with no problem. Running the software it
>>>>>>>>>>discovers the PIC with no problem.
>>>>>>>>>>
>>>>>>>>>>However, I tried to create a simple program in assembler that would
>>>>>>>>>>turn on all the outputs of Port B. I know my program works fine as
>>>>>>>>>>I've downloaded it using a programmer. However, when I download it
>>>>>>>>>>using the bootloader nothing happens. It appears that the PIC is
>>>>>>>>>>'stuck' in the bootloader section and not jumping to my code when it's
>>>>>>>>>>done.
>>>>>>>>>>
>>>>>>>>>>I suspect this is the case as the bootloader software detects the PIC
>>>>>>>>>>straight away without the need for me to reset the PIC.
>>>>>>>>>>
>>>>>>>>>>Any ideas anyone?
>>>>>>>>>>
>>>>>>>>>>John
>>>>>>>>>>
>>>>>>>>
>>>>>>>>My best quess is that your PIC progam should start with something like
>>>>>>>>"ORG 0x100" or whatever the "jump-to-application-address" is.
>>>>>>>>
>>>>>>>>/RaceMouse
>>>>>>>
>>>>>>Hmmm...
>>>>>>
>>>>>>Can you post the souce code of you application ?
>>>>>>
>>>>>>/RaceMouse
>>>>>
>>>>Ok. It seems to me that you have 5 instructions within the first four
>>>>program counts. Your Interrupt vector starts at 0x04 but your startup
>>>>code ends at 0x05.
>>>>
>>>>My suggestion:
>>>> ORG 0x00 ; Start of the program
>>>> CLRF STATUS
>>>> CLRF PCLATH
>>>> GOTO INIT
>>>>
>>>>Please report back.
>>>>
>>>>/RaceMouse
>>>
>
Can you merge the two hex files (the bootloader and you application) and
run it in a simulator ?

/RaceMouse
From: RaceMouse on
JohnT wrote:
> I tried that already but with no success. The code I showed you is
> straight from an example that came with the bootloader.
>
>
> RaceMouse wrote:
>
>>JohnT wrote:
>>
>>>How do I post my code, I can't see of a way to upload a file. The
>>>start of my code is as follows though.
>>>
>>> ORG 0x00 ; Start of the program
>>> CLRF STATUS
>>> MOVLW 0x00
>>> MOVWF PCLATH
>>> GOTO INIT
>>>
>>>
>>> ORG 0x04 ; Interrupt address
>>> GOTO INT_HAND
>>>
>>>All I'm doing after it goes to the INIT routine is set all the outputs
>>>on for PortA and B. I've simulated this and it works fine.
>>>
>>>John
>>>
>>>RaceMouse wrote:
>>>
>>>
>>>>JohnT wrote:
>>>>
>>>>
>>>>>Thanks for the response.
>>>>>
>>>>>Firstly, my background is in PLC's and the various pieces of software I
>>>>>use 'download to the PLC' or 'upload from the PLC'
>>>>>
>>>>>Secondly, the bootloader I'm trying to should move the 'goto'
>>>>>instruction that you need to put in the first four lines of code to the
>>>>>start of the bootloader code. This leaves the start of memory as the
>>>>>bootloader set it, i.e. jump to the bootloader routine. After it has
>>>>>executed the bootloader routine, it jumps to just before the bootloader
>>>>>and should find the address of where to go next, i.e. the 'goto'
>>>>>instruction in my code. If you look at the web address of my initial
>>>>>query there is a nice picture showing what I've just tried to explain.
>>>>>
>>>>>The download program that is on that website must modify the hex file,
>>>>>find the 'goto' instruction in the first four lines and overwrite that
>>>>>line of the bootloader.
>>>>>
>>>>>I can't think how to test it though, has anyone else used a bootloader
>>>>>successfully?
>>>>>
>>>>>John
>>>>>
>>>>>
>>>>>RaceMouse wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Pietje Bell wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Does the bootloader needs to know where the application is programmed?
>>>>>>>(at what address)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>-------- Origineel bericht --------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Hi All,
>>>>>>>>
>>>>>>>>Has anyone manged to get the tiny bootloader from
>>>>>>>>http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm working?
>>>>>>>>
>>>>>>>>I have a 16F877A with a 4MHz crystal. I modified the frequency in the
>>>>>>>>software and downloaded it with no problem. Running the software it
>>>>>>>>discovers the PIC with no problem.
>>>>>>>>
>>>>>>>>However, I tried to create a simple program in assembler that would
>>>>>>>>turn on all the outputs of Port B. I know my program works fine as
>>>>>>>>I've downloaded it using a programmer. However, when I download it
>>>>>>>>using the bootloader nothing happens. It appears that the PIC is
>>>>>>>>'stuck' in the bootloader section and not jumping to my code when it's
>>>>>>>>done.
>>>>>>>>
>>>>>>>>I suspect this is the case as the bootloader software detects the PIC
>>>>>>>>straight away without the need for me to reset the PIC.
>>>>>>>>
>>>>>>>>Any ideas anyone?
>>>>>>>>
>>>>>>>>John
>>>>>>>>
>>>>>>
>>>>>>My best quess is that your PIC progam should start with something like
>>>>>>"ORG 0x100" or whatever the "jump-to-application-address" is.
>>>>>>
>>>>>>/RaceMouse
>>>>>
>>>>>
>>>>Hmmm...
>>>>
>>>>Can you post the souce code of you application ?
>>>>
>>>>/RaceMouse
>>>
>>>
>>Ok. It seems to me that you have 5 instructions within the first four
>>program counts. Your Interrupt vector starts at 0x04 but your startup
>>code ends at 0x05.
>>
>>My suggestion:
>> ORG 0x00 ; Start of the program
>> CLRF STATUS
>> CLRF PCLATH
>> GOTO INIT
>>
>>Please report back.
>>
>>/RaceMouse
>
>

And I just saw I was wrong 'cause "ORG" is a directive. Not an
instruction :-)

/RaceMouse