View previous topic :: View next topic |
Author |
Message |
Guest
|
bootloader question for 18f452 |
Posted: Sun Dec 24, 2006 8:14 am |
|
|
please help
I have been using my bootloaderwith pic16f877 now i what to change to 18f452 my question is
would the following command still be aplicable to the 18f452 ?
Code: |
#ORG 0x1F00,0x1FFF {} //
|
|
|
|
Guest
|
|
Posted: Sun Dec 24, 2006 10:47 am |
|
|
What bootloader do you use for 18f452? |
|
|
Guest
|
|
Posted: Mon Dec 25, 2006 4:49 pm |
|
|
I have only used boot loader for 16f877 but i now want one i can use
for 18f452 @ 20mhz
most of the ones i have seen when i did a google search
are for 4mhz
So just wanted to know what you guys use
please help |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guest
|
|
Posted: Fri Dec 29, 2006 11:33 am |
|
|
Thanks PCM
I saw this one but i was not sure if this was a mistake
the hex file for the bootloader @ 20Mhz has a Baud rate of 12200 Baud
but on the windows downloading program there is no option for that baud rate it has the following 1200,2400.4800,9600 & 19200
Its that a typo ?
Have anyone actually used this loader?
Skinner |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Dec 29, 2006 12:01 pm |
|
|
I'm not sure what they mean. Is it a baud rate, or is it some code
number stuck in front of the filename ? The readme file says to go
to their website for full instructions, but then when I go there, they
don't explain it. Their terminal program doesn't support weird baud
rates. I don't know. I used to use their 16F877 bootloader, but when
I bought a Microchip ICD2, I dumped the bootloader and converted all
my proto boards to use the ICD2. |
|
|
Guest
|
|
Posted: Fri Dec 29, 2006 12:07 pm |
|
|
Am sure someone in this forum would be able to point me to
a bootlader for 18f452 @20mhz
i just want to use one that has being confirmed to work
PCM thanks for you help as usual
Skinner |
|
|
Guest
|
|
Posted: Fri Dec 29, 2006 1:49 pm |
|
|
I have tried the following with no luck
PIC18bootload
Tiny Bootloader
please help as i need to get my programme going over this weekend
And just to check with you here is the sample programmed i am trying to
bootload to my pic
Code: |
#if defined(__PCH__)
///////////////////////////
#org 0x40,0x7F
#else For Bootloader
#org 0x20,0x3F
#endif
///////////////////////////////
#include <18F452.h>
#device ADC=16
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#endif
void main() {
int i;
long value, min, max;
printf("Sampling:");
setup_port_a( ALL_ANALOG );
setup_adc( ADC_CLOCK_INTERNAL );
set_adc_channel( 0 );
do {
min=0xffff;
max=0;
for(i=0; i<=30; ++i) {
delay_ms(100);
value = Read_ADC();
if(value<min)
min=value;
if(value>max)
max=value;
}
printf("\n\rMin: %4LX Max: %4LX\n\r",min,max);
} while (TRUE);
}
|
|
|
|
Ttelmah Guest
|
|
Posted: Fri Dec 29, 2006 3:20 pm |
|
|
You need to use the #build directive, or the code will put the boot vector, and (if interrupts are used), the interrupt vector at the base of memory, and overwrite the bootloader. Look at the bootloader example that comes with the compiler, to see how the running program is defined.
Best Wishes |
|
|
Guest
|
|
Posted: Fri Dec 29, 2006 4:12 pm |
|
|
Ttlemah
i Have just had a look and the only directive i could find was
#include <bootloader.h>
Do i need to include this file? |
|
|
Ttelmah Guest
|
|
Posted: Fri Dec 29, 2006 4:18 pm |
|
|
'ex_bootload.c', is an example program to use a bootloader. 'bootloader.h', which this includes, shows how it reserves the base of memory for the bootloader.
Then 'ex_bootloader.c', is the bootloader this uses, with the main code in 'loader.c'.
Look particularly at the build statement in bootloader.h.
Best Wishes |
|
|
Guest
|
|
Posted: Sat Dec 30, 2006 5:37 am |
|
|
I have given up trying to search for a bootloader
i would experiment with the CCS examples now as there don't seems to
be bootloader readily avaliable for the 18f452 like there is for the 16f877 |
|
|
Guest
|
|
Posted: Sat Dec 30, 2006 6:57 am |
|
|
Ttelmah
i have tried using the example bootloader programme but i keep on getting the message "Timeout while downloading "
This is what i have done so far
1. I complied EX_BOOTLOADER.C and programmed it into my 18f452
using Picstart Plus
2. I then complied EX_BOOTLOAD.C and tried the download it using
siow from the IDE
My circuit has got a keypad wired to port b where RB3 has a pull down resistor to gnd and when i press my switch which is connected to one end of RB3 to RB5 this should pull RB5 down low.
Do i have to enable portb pull ups ?
My project board is Melab LAB-X1 Experimenter Board |
|
|
Guest
|
Now Working |
Posted: Sat Dec 30, 2006 8:03 am |
|
|
I finally got the CCS bootloader to work |
|
|
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Thu Jan 04, 2007 6:58 am |
|
|
What did you do to solve that? I'm also getting the message ' timeout while downloading' after the first line.
What are your SIOW settings? |
|
|
|