Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

programming PIC16f877 with rs232 and bootloader

Status
Not open for further replies.

redsuns

New Member
Can anyone tell me where can i find the bootloader program for PIC16f877?
i want to program a pic16f877 using max232 and db9 , i have a PIC programmer kit that i can borrow from friend
i know we must install a bootloader program into the PIC in the first time and enable it to use the serial port programming
i found some bootloader from the net but i want to ask what is the best recommendation
And how to know what is the crystal frequency i should connect between XTAL1 and XTAL2, i found some using 4Mhz and some is using 10Khz
and the most important, how to calculate the baud rate that is needed to use?
 
Last edited:
thank you nigel, you solve much of my problems lately
then how to calculate the crystal frequency i should connect between the XTAL pins
 
oh, i didn't read through all the links provided , found it in the faqs
think i will choose for the 4Mhz or 16Mhz crystal
thank you very much
 
Tiny Bootloader

Take a look top the following bootloader, too.
Very small, very simple to use. Available for a wide range of PICs.
 
i will be using sdcc to compile my codes for my project
the faqs mentions about reserving 256bytes of memory but don't have mention about it when writing in sdcc
so how should i write the first line of codes to reserve the bootloader memory?

Take a look top the following bootloader, too.
Very small, very simple to use. Available for a wide range of PICs.
for tiny pic bootloader, do i need to write codes to reserve the bootloader in the memory as in the pic downloader 1.08?
 
Last edited:
for tiny pic bootloader, do i need to write codes to reserve the bootloader in the memory as in the pic downloader 1.08?

Yes. Just follow the following points:

(1) start your program with a GOTO like the following
Code:
    org 0x0000
    clrf PCLATH
    goto Main     ;Main is your real program entry point
or
Code:
    org 0x0000
    pagesel Main
    goto Main

(2) if you use an interrupt routine, it starts at 0x0004 as usual like in example below
Code:
      org 0x0004
      nop
      retfie

(3) in your .ASM file, don't use any __CONFIG directive

(4) after a reset, your Main program will start after about 1 second of delay. If you want to download a program update, simply run program TinyBldWin (the Windows update program) before you reset your PIC device.
 
in the manual
If you use a (C/Basic/...) compiler, some of them may require a special directive to allows coexistence with a bootloader; but then again, most of them will work without specifying anything.

i will be using c code programming and compile with sdcc into hex file
does sdcc allow coexixtence with bootloader?
 
Last edited:
Read the site I posted the link for, it's a site about programming in C - and the bootloader is written in C. It explains fully about what you need to consider while writing your program.
 
Read the site I posted the link for, it's a site about programming in C - and the bootloader is written in C. It explains fully about what you need to consider while writing your program.

i am using free compiler which is sdcc
what they teach there is for paid software
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top