2011-08-17, 22:36:36 (This post was last modified: 2012-12-23, 20:01:48 by Mikael Gustavsson.)
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!
2011-08-18, 21:26:36 (This post was last modified: 2011-08-18, 21:27:55 by VaGyver.)
(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.
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.
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?
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.
2011-08-21, 18:16:34 (This post was last modified: 2011-08-21, 18:21:53 by VaGyver.)
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?