PDA

View Full Version : Microcode Studio Plus Loader?



koossa
- 29th November 2005, 04:34
Hi Picers

I am using MicroCode Studio Plus and PicBasic Pro and I designed MCLoader hardware as described here
http://www.picbasic.co.uk/forum/showthread.php?t=623&highlight=bootloader

I pluged this device to my computer's serial port and when I tried to compile and program my source code, for 16F877 @ 4MHz, I have a problem "Reset Required, please reset the target microcontroller in order to access to the bootloader process... ".

In the help file they said "Before using MicroCode Loader, you need to ensure that the bootloader firmware has been programmed onto the target microcontroller.", how do I do this?

Thx

Charles Linquis
- 29th November 2005, 05:20
You have to use some other programmer - EPIC, Microchip's PICSTART PLUS or ICD2, etc to first load the appropriate loader file into your chip.

In your case, it would be 16F877_04.HEX , generally found in

\\... \CodeStudioPlus\MCLoader\16F877


After that is loaded, you can then reload code quickly whenever needed through the serial port. Very handy for debugging or field upgrades.

koossa
- 29th November 2005, 05:22
Charles, Thank you, I will try it!!

koossa
- 29th November 2005, 05:42
I have upload the hex file (16F877_04.hex), but still gets the "Reset Required, please reset the target microcontroller in order to access to the bootloader process... ". error if I try to program it through my serial cable?

Charles Linquis
- 29th November 2005, 06:04
You need to insure that the serial port is working properly on both machines.

On my PC, I simply connect pins 2&3 together on the serial cable and hit a key. If the character echoes, then the PC end is working.

On the PIC side - Write a very simple program, such as:

DEFINE OSC 20 (or whatever it is)

DEFINE HSER_RCSTA 90H
DEFINE HSER_TXSTA 20H
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1
DEFINE LOADER_USED 1

Dummy VAR BYTE

Begin:

HSEROUT ["Press Any Key "]
HSERIN [Dummy]
HSEROUT ["You Pressed ",Dummy,13,10]
GOTO Begin

END

The program above will prove that the PIC is sending and receiving characters - something it must do before any bootloader can work.

koossa
- 29th November 2005, 06:07
Hi Charles

Both sides are working perfectly, I am doing serial comms using HSEROUT and HSERIN.

Thx

Charles Linquis
- 29th November 2005, 06:38
Make sure Microcode Loader is set to use the correct serial port on your PC.

koossa
- 29th November 2005, 06:39
Yes, I have set that to Comm2.

koossa
- 30th November 2005, 09:26
I'm Using the PIC16F877 20/P with a 4MHz Crystal and then upload the 16F877_04.hex file.

Could my problem maybe be the "20/P"

Thx!

keithdoxey
- 30th November 2005, 09:39
I have upload the hex file (16F877_04.hex), but still gets the "Reset Required, please reset the target microcontroller in order to access to the bootloader process... ". error if I try to program it through my serial cable?

You say you are successfully doing serial comms already but this only requires TX and RX (as does the bootloadr for actual programming) but you need a way to restart the PIC so that it looks for the bootloader when it boots from a reset.

Do you have the DTR (Pin4) line connected to MCLR so that the bootloader can reset the PIC ?

http://www.mecanique.co.uk/code-studio/loader/reset-circuit-small.gif

IF not, you either need to do that, or have a reset button on your PCB that you can reset the PIC with (or power down the PIC).

I prefer the reset button method personally as previously when using the DTR line my program would reset when I opened the serial port on the PC.

Regards

koossa
- 30th November 2005, 17:29
Hi Keith

Thank you very much for your reply.
I have setup my PCB as described in this thread:
http://www.picbasic.co.uk/forum/showthread.php?t=623&highlight=bootloader

But I did not build the reset button in, I have connect MCLR to the 10uF capacitor and the capacitor then goes to Pin9 on the MAX232.
Must I put the reset button in, as described on the thread above?
If so, when do I press the reset button?

Thx
Koossa

keithdoxey
- 30th November 2005, 18:44
Hi Keith

Thank you very much for your reply.
I have setup my PCB as described in this thread:
http://www.picbasic.co.uk/forum/showthread.php?t=623&highlight=bootloader

But I did not build the reset button in, I have connect MCLR to the 10uF capacitor and the capacitor then goes to Pin9 on the MAX232.
Must I put the reset button in, as described on the thread above?
If so, when do I press the reset button?

Thx
Koossa

Hi Koossa,

I hadnt heard of the capacitor coupled version. It is exactly the same circuit except for the 10u capacitor instad of a 100R resistor. The difference being that instead of pulling MCLR permanently low it will only provide a short pulse. Maybe it is not pulling it low enough or for long enough.

The Reset button *shouldnt* be needed but having it gives the option of manually resetting your PIC at any time.

When the bootloader is displaying a message saying it is waiting for a reset, connect the MCLR pin to 0V momentarily and it should then reset the PIC and bootload the new program.

Just had a few more thoughts.....

1. When you programmed the bootloader into your PIC did you make sure that the MCLR pin was set as MCLR and not an IO pin ?

2. Is your MCLR pulled up with a resistor or have you tied it directly to +5V ?

3. Is Microcode loader set to "Auto" baud rate or is it fixed at the wrong speed?

4 Try the bootloader circuit with 100R instead of 10uF !

Other than that I cant think of anything else :(

Regards

koossa
- 1st December 2005, 05:20
Hi Keith



1. When you programmed the bootloader into your PIC did you make sure that the MCLR pin was set as MCLR and not an IO pin ?

How do I do that?



2. Is your MCLR pulled up with a resistor or have you tied it directly to +5V ?

With a Resistor.



3. Is Microcode loader set to "Auto" baud rate or is it fixed at the wrong speed?

Yes, to Auto



4 Try the bootloader circuit with 100R instead of 10uF !

Thx, I will try that.

koossa
- 12th December 2005, 11:24
When the bootloader is displaying a message saying it is waiting for a reset, connect the MCLR pin to 0V momentarily and it should then reset the PIC and bootload the new program.


I have connect the MCLR PINT TO 0V, but it still don't work.
I'm using the Max1672 switching regulator, and it has a soft on pin, so I must press the ON button on my keypad for the power to go through to my PIC.
I have done this and then momentarily connect MCLR to GND, but still no luck?

Any idea what else I can try?