Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

Ads

Discussion Groups

There are 23 messages in this thread.

You are currently looking at messages 0 to 10.

Tiny Bootloader - JohnT - 02:55 29-08-06

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




Re: Tiny Bootloader - RaceMouse - 11:56 29-08-06

JohnT wrote:
> 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
> 

Greetings

First: You don't download _TO_ something. you upload _TO_ a device !
(I really couldn't help it :-) )

Second : Have you made sure that you application program starts at the
same address as the booloader jumps to when it does not receive a char
from the PC ?

/RaceMouse

Re: Tiny Bootloader - Pietje Bell - 11:56 29-08-06

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
> 

Re: Tiny Bootloader - larwe - 12:03 29-08-06

RaceMouse wrote:

> First: You don't download _TO_ something. you upload _TO_ a device !
> (I really couldn't help it :-) )

You'd have no idea how many arguments I've had about this. I agree with
what you just said, but I've never been able to convince anyone else of
this. It is common parlance that programming a chip is "downloading to"
that chip.


Re: Tiny Bootloader - RaceMouse - 12:08 29-08-06

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

Re: Tiny Bootloader - RaceMouse - 12:11 29-08-06

larwe wrote:
> RaceMouse wrote:
> 
> 
>>First: You don't download _TO_ something. you upload _TO_ a device !
>>(I really couldn't help it :-) )
> 
> 
> You'd have no idea how many arguments I've had about this. I agree with
> what you just said, but I've never been able to convince anyone else of
> this. It is common parlance that programming a chip is "downloading to"
> that chip.
> 

As long as you agree with me you're doing fine :-)

The only way to change this "common parlance" is to use the correct
terms. Agree ?

-maybe the discussion belongs in an other thread but ...

/RaceMouse

Re: Tiny Bootloader - JohnT - 13:20 29-08-06

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


Re: Tiny Bootloader - RaceMouse - 13:30 29-08-06

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

Re: Tiny Bootloader - JohnT - 13:36 29-08-06

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


Re: Tiny Bootloader - RaceMouse - 13:49 29-08-06

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

| 1 | 2 | 3 | next