Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can be programmed only once! [solved]
#1
        Hello!

I can succesfully program the pic with the ds30 loader software only once.
The second time when i press the 'check for bl', it does not work any more.
My working application works ok either i program the pic directly (without the bootloader) or with the bootloader.


I am attaching all the files i think that could help finding the solution.
By the way i am using Proton+ Compiler.


Any help would be very helpful, since i think this is a very good bootloader to work with!

(2011-08-17, 22:36:36)VaGyver Wrote: Hello!

I can succesfully program the pic with the ds30 loader software only once.
The second time when i press the 'check for bl', it does not work any more.
My working application works ok either i program the pic directly (without the bootloader) or with the bootloader.


I am attaching all the files i think that could help finding the solution.
By the way i am using Proton+ Compiler.


Any help would be very helpful, since i think this is a very good bootloader to work with!


Attached Files Thumbnail(s)
               

.txt   settings.txt (Size: 4.69 KB / Downloads: 11)
.txt   ds30loader.txt (Size: 19.13 KB / Downloads: 7)
.txt   bootloader.hex.txt (Size: 137.96 KB / Downloads: 6)
.txt   working application.hex.txt (Size: 40.57 KB / Downloads: 3)
Reply
#2
Thanks for all the information!
Have you actually connect rts on the uart to mclr on the PIC?

If not, you need to manually reset the PIC before you write.
Reply
#3
(2011-08-18, 21:21:06)Mikael Gustafsson Wrote: Thanks for all the information!
Have you actually connect rts on the uart to mclr on the PIC?

If not, you need to manually reset the PIC before you write.

Yes, i do have connected the RTS.
When i press the 'check for bl', i don't need to reset manually the pic since it does it by itself (and it finds the pic by itself).

But for test reasons, i also tried to manuallyreset the pic with no difference, since it does reset it by itself via the RTS.
Reply
#4
Well, i have news.

Good news is that it worked.
What i did is i de-activated reset by RTS, i uncheck the 'auto baudrate', set the speed to 19200 and i manually reset the pic.
BUT there still exists a problem.
Some times it finds other pic than actually used and some times it finds nothing.

Since i think that it might be because of the fact that i am using the internal oscillator (so clocking might be bad), i will add a xtal (e.g. 8 MHZ) and i will come back with news.


Strange is that before i make the first write, by using auto baud rate and reset by RTS, it ALWAYS find the pic correctly.
After the first write action, the reset by RTS action stops working and then it does not recognize nothing any more. (then it needs hardware reset).
Until then, only by pressing the 'check for bl' it finds the pic. And by pressing the 'write' but only for one time.

Strange?


Reply
#5
Do you press download first and the reset the pic OR do you reset the pic and then press write?
The later may be more reliable.

When you use reset by dtr or rts, try a lower reset time such as 100ms.
Reply
#6
Mikael, fthank you for your reply!

Well, i tried with an other pic (18F26J11) with a XTAL=16 and everything works perfectly.

This happens ONLY when i do what you are saying in your previous post: "reset the pic and then press write".

So, it seems that reset by RTS action works fine but only until the first write.
Anyway, that is not a big problem.

I have a last question:
Should the application config be always same with the the bootloader config (created by mplab) or can be different?
If it is different then it means that the bootloader won't be able to work againa after the last write?


Reply
#7
Yes the config should be the same. It is recommended to never write the configs.
Unless you check "write configs" they will not written even if they are in the hex file.

Do you have schematics of the rts connection?
Reply
#8
I tried with RTS and DTR and i think i found the solution. The problem seems to be on the level (0 or 1) that the program makes. The schematics is ok (i am using a FT232RL).

What i did to really test is: i connected a LED to the MCLR and i am watching the status of the LED (on or off).

What i found is:
- Before i press the 'check for bl' the LED is on, so MCLR is high (so pic works).

- Just when i press the 'check for bl' the program says: "Resetting device..." and the LED is off, so MCLR goes low. This happens for as long as "reset time (ms)". In my case, i have 1000 (so 1 sec). So the pic gets reseted. Everything ok so far!

- Then the programs says: "Bringing dtr high...ok" and the LED light just for a moment (about half a second) and then gets off. I think that the LED should not get off.

- Then the program says: "Searching for bl . . ." and the LED is OFF. So, the pic is in reset mode and it does not work.

Isn't it so ???
Can the program finds the pic if the pic is in reset mode?


Reply
#9
Ok. I know I tested rts/dtr reset some time ago and it works in the latest version.
Which version are you using?
Reply
#10
I see now you use 1.4.2.
I looks like you have enabled activation by rts, that why you get that result.
Reply
#11
Mikael, you are the best!

That solved my problem.
What i did wrong is that i checked RTS in the activation tab.
So, all i had to do is to check RTS ONLY in the reset tab.

Now everything works perfectly!


Your bootloader is an EXCELLENT program!
Reply
#12
Great! Thanks!
Btw, you should upgrade to the latest version:
[broken link]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)