PDA

View Full Version : Using Microcode Bootloader + CDLite + Hyperterminal



guanerrr
- 23rd November 2005, 10:01
Hi, this is my first post. I'm quite new in this field.

I programmed my PIC16F877A with microcode bootloader and I don't wanna use Microcode Studio Plus IDE. Can I use CDLite IDE and then generate hex file and after that I send the hex file using hyperteminal? Can I do that? Any special configuration needed? TQ

milestag
- 23rd November 2005, 13:35
The bootlaoder software (on your PC) and the bootloader firmware (in your PIC) must work together. So it's basically a package deal.

If you use the pre-built hex files for MCS bootloader, then you will need to use MCS bootloader software to do the programming. Hyperterminal won't work.

You CAN still use CD Lite to edit and compile your code. Then just use the bootloader to load your program hex file.

FYI - I found that the Tiny PIC Bootloader (freeware) works perfectly with PicBasic Pro. I built the same MAX232 interface as shown on the MCS web site. You may have to edit the firmware .asm file yourself though, depending on what chip, baud rate and oscillator speed you want to use.

-Jim

mikeciz
- 23rd November 2005, 18:36
Milestag,
When you use Tiny PIC Bootloader do in picbasic do you use the same "define bootloader=1" in your program, or do you have to insert some assembly code at the beginning of your picbasic code? Thanks

milestag
- 23rd November 2005, 19:14
No assembly required! :)

Just add this line (I put it at the top of the code, but not sure if the location matters):

DEFINE LOADER_USED 1

Same as the instructions for using MCS bootloader.

Also I don't use the "reset" connection to MCLR on my MAX232 circuit. Only the RX/TX lines. Works fine as long as you can cycle power on your target circuit before you start the bootloader.

guanerrr
- 24th November 2005, 01:12
Why we cannot use hyperterminal to send hex file to microcontroller? If I use mscomm in VB, can I still send the hex file to microcontroller.?

I'm using hyperterminal coz it's free. I have 40 students and I don't have money to by 40 licences for Microcode Studio. Or anyone can help me the best way to send hex file without using Microcode Studio but still using Microcode Studio Bootloader firmware for my PIC16F877A. TQ

milestag
- 25th November 2005, 13:37
If you want to create your own bootloader, then I think you will need to go to www.Microchip.com and read up on the programming application notes. But it's definitely involved than just sending a serial file to the PIC using hyperterminal.

Also, I already told you about a FREE bootloader. "Tiny PIC Bootloader" Here is the link to the author's web site:

http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm

All the info and software/firmware you need is on that site. So far this bootloader works perfectly for me. And it works fine with the shareware version of MicroCode Studio.

Not sure what you don't like about MCS, but I just switched over to it from CD Lite, and it's an INFINITELY better package. I had so many crashes and glitches with CD Lite, and MCS lets you open multiple files and tab between them. Very convenient.

tdavis80
- 25th November 2005, 14:04
MCS is NOT free if used by an educational institution. I think that is what he is complaining about.

Luckily, any editor will work and there are lots of free boot loaders out there.

I would recommend checking some of the free programmer's editors because they allow you to enter keywords into a config file. If you use a picbasic config file, it would highlite the commands much in the same way as mcs.


I use the following boot loader. I like the fact that it doesn't lock the serial port. I can leave it on screen and it only opens the comport when downloading. I have another program that uses the comport while my PIC is running. This means I can have both onscreen and set to the same comport.

http://www.ehl.cz/pic/pic_e.htm

I do not have the mclr hooked up. Only the rs232 rx/tx. When I click on the [write] button to send the firmware, I push the reset button on my PIC board. The boot loader then auto-kicks into action and the program downloads in just a few seconds.

chai98a
- 26th November 2005, 01:56
Milestag, sir

I Just add this line but not work

DEFINE LOADER_USED 1

pic 16f877a complier with microcode studio plus 2.2.10

After download with "Tinybldwin191 into microcontroler "WARNING: PCLATH not initialised before GOTO! ... could not repair.,

How to fixed it

here is my code:
define loader_used 1
Define OSC 20
TRISB = 0 'rb0 =output
TRISB.1 = 0
Include "modedefs.bas"
loop: Serout PORTC.6,T9600,["Hello",10,13] ' Display "Hello", next line
pause 500 ' Wait .5 second
high portb.1
Serout PORTC.6,T9600,["World",10,13,10,13] ' Display "World", skip a line
paUSE 500 ' Wait .5 second
low portb.1
Goto loop ' Do it forever
End

milestag
- 27th November 2005, 03:29
What bootloader file did you program into the PIC? I assume you had to edit the 16F876A file?

Does the bootloader interface identify the connected PIC okay when you click on Check PIC?

So many variables here, and I don't have extensive experience on this bootloader. I can only tell you what worked for me. Be sure to read all the instructions included with the program.

chai98a
- 27th November 2005, 04:42
Dear milestag

Yes commucate is OK after i edit asm file by change micro from 16f877 to 16f877a and see below

radix DEC
LIST P=16F877a, F=INHX8M
xtal EQU 20000000
baud EQU 115200
__CONFIG _XT_OSC & _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _LVP_OFF & _DEBUG_OFF

milestag
- 27th November 2005, 05:28
I don't know what the problem is, maybe someone else here has seen it. If the error is from the bootloader, then maybe you will have to try contacting the author.

Does your code work okay with a traditional PIC programmer (EPIC, etc)?

Have you tried compiling for different baud rates or oscillator freq? Double check everything too. Make sure you had the right chip selected in MCS, etc. This is the hazard of freeware....limited or no support (you get what you pay for, right?)

BTW - Probably unrelated, but I always try everything I can think of....if you are using 20MHz crystal, then I believe you need to use HS_OSC instead of XT_OSC. Someone else here pointed that out to me on an earlier problem I had.

chai98a
- 27th November 2005, 05:36
Dear milestag
thank you for advise..