Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with ds30BootLoader and 16F887 [solved]
#1
Hi Mikael,
I' m Daniele. Thank You very much for your free "ds30BootLoader"...
I wrote a program for Pic16F887 that work very well... I tested it for many times and it' s all ok.
However, If I program Pic with your BootLoader, I don' t can write Pic with my Program.
I don' t know if there is a problem with my source code or with your application, but nothing happens.
The USART, work fine (I tested it with others firmware) and the BootLoader is found from your Application, but when I go to write, appears an error...(write failed...)
- Can You give me a "config file" for the 16F887 (4Mhz - XT_OSC) for your application?
- Can You indicate me if I need to do something in my source code? (like a goto...)
In my source code, at the address "ORG 0x00" I wrote:
PAGESEL Start
GOTO Start
where "Start" is the Beginning of my Program (Main Program)!...
- The "Config Words" are equals for any (your "settings.inc" and "My Source Code")
- I have your last Application version...

Can You help me please?...
Best Regards,
Daniele (Italy).
P.S. In attached my source code...


Attached Files
.txt   Cubo_10.asm.txt (Size: 3.85 KB / Downloads: 9)
.txt   Start.inc.txt (Size: 2.73 KB / Downloads: 5)
.txt   Main.inc.txt (Size: 894 bytes / Downloads: 5)
Reply
#2
Hi Daniele,
Thank you for posting in the forum.
Can you enable debug mode and post a screenshot or the the text from the GUI.
Also post the hex file.

Thanks
Mikael
Reply
#3
(2011-12-15, 23:40:02)Mikael Gustafsson Wrote: Hi Daniele,
Thank you for posting in the forum.
Can you enable debug mode and post a screenshot or the the text from the GUI.
Also post the hex file.

Thanks
Mikael

Hi Mikael,
thank You very much for your answer!
Below the error messages that appear after write.
.
.
.
Hex file successfully parsed
Writing flash...
Erasing page 0 0x0000...ok
Writing row 0 0x0000...verification error 1 try verification error 2 try write failed
Write flash failed
Closing port
Tx 73 bytes / Rx 8 bytes / 1,3s
Write failed
-------------------------------------------------------------------
In attached, ".hex" file and "screen shoot" of debug mode during write flash.
Best Regards, Dany.



Attached Files
.txt   Cubo_10.HEX.txt (Size: 30.7 KB / Downloads: 7)
Reply
#4
Thanks. I'm very busy at the moment but I will try to look into this next week.
Reply
#5
(2011-12-19, 00:32:48)Mikael Gustafsson Wrote: Thanks. I'm very busy at the moment but I will try to look into this next week.

Ok Mikael.
Thanks, Daniele.
Reply
#6
Hi again,
The solution is to uncomment line 526 in ds30loader.asm:
Code:
andlw    0x3F            ;maybe we should only compare low 6 bits?
I have updated this in the archive on the homepage now.

Thank you very much for reporting this problem!

Mikael
Reply
#7
(2011-12-20, 22:20:26)Mikael Gustafsson Wrote: Hi again,
The solution is to uncomment line 526 in ds30loader.asm:
Code:
andlw    0x3F            ;maybe we should only compare low 6 bits?
I have updated this in the archive on the homepage now.

Thank you very much for reporting this problem!

Mikael
Hi Mikael.
Thank You for your help, but this solution don' t work in my case.
I have the same error message!...

Reply
#8
Hi,
I am sorry about the delay. Unfortunately I don't have any PIC16F8xx to try on.
Do you use any code or write protection?
Which voltage do you run on?

Does it work if you remove write verification?
Replace
Code:
        ;----------------------------------------------------------------------
        ; Write complete, verify row
        ;----------------------------------------------------------------------    
verword
        decf    EEADRL_            ;bank 2/3
        ; Read word
        banksel EECON1_        
        ifdef HAS_EE    
            bsf        EECON1_, EEPGD    ;bank 3
        endif
        bsf        EECON1_, RD        ;bank 3
        nop
        nop
        ; Compare high byte    
        decf    FSR_
        movfw    INDF_
        andlw    0x3F            ;maybe we should only compare low 6 bits?
        banksel    EEDATH_
        subwf    EEDATH_            ;bank 2/3
        btfss    STATUS, Z
        goto    verfail
        ; Compare low byte            
        decf    FSR_
        movfw    INDF_
        subwf    EEDATL_            ;bank 2/3
        btfss    STATUS, Z
        goto    verfail
        ; Loop?
        decfsz     rowcnt2
        goto     verword    
        ; Verify succesfull
        goto     Main
With
Code:
        ;----------------------------------------------------------------------
        ; Write complete, verify row
        ;----------------------------------------------------------------------    
verword
                goto     Main
Reply
#9
(2011-12-26, 13:19:11)Mikael Gustafsson Wrote: Hi,
I am sorry about the delay. Unfortunately I don't have any PIC16F8xx to try on.
Do you use any code or write protection?
Which voltage do you run on?

Does it work if you remove write verification?
Replace
Code:
        ;----------------------------------------------------------------------
        ; Write complete, verify row
        ;----------------------------------------------------------------------    
verword
        decf    EEADRL_            ;bank 2/3
        ; Read word
        banksel EECON1_        
        ifdef HAS_EE    
            bsf        EECON1_, EEPGD    ;bank 3
        endif
        bsf        EECON1_, RD        ;bank 3
        nop
        nop
        ; Compare high byte    
        decf    FSR_
        movfw    INDF_
        andlw    0x3F            ;maybe we should only compare low 6 bits?
        banksel    EEDATH_
        subwf    EEDATH_            ;bank 2/3
        btfss    STATUS, Z
        goto    verfail
        ; Compare low byte            
        decf    FSR_
        movfw    INDF_
        subwf    EEDATL_            ;bank 2/3
        btfss    STATUS, Z
        goto    verfail
        ; Loop?
        decfsz     rowcnt2
        goto     verword    
        ; Verify succesfull
        goto     Main
With
Code:
        ;----------------------------------------------------------------------
        ; Write complete, verify row
        ;----------------------------------------------------------------------    
verword
                goto     Main

Hi Mikael,
Thank You very much for your support!...
I tried your source code but unfortunately Pic don' t write flash.
Now the error message does not appear but Flash is not written. I don' t use any protection.
I use 5Vdc Power Source for my Pic circuit with an "LM7805".
I use as RS232 Circuit, a Max_232 similar the scheme in your manual "AN1310" (but with 5 Vdc).
If I program Pic with an Usart.hex for testing it, it' s all ok, therefore this circuit work well. I use an RS232 Pin to Pin cable and it's all ok.
When I test your firmware, your program found the BootLoader with correct version therefore cable, Max232 Circuit, and your firmware works!
I try with another Pic_16F887 but no changes...
I hope in your news.
Best Regards.
Reply
#10
I have ordered 2 pic16f887 now. I will get back to you in a few days when I have done some testing.
Thanks for your patience.

Mikael
Reply
#11
Hi,
I don't really understand what the problem is now. Can you please post a screenshot of the GUI with debug mode activated when the problem happens.
I have tested now on PIC16F886 which is more or less identical to the 887. It works fine. I have attached my files.


Attached Files Thumbnail(s)
   

.zip   firmware PIC12F PIC16F.zip (Size: 21.37 KB / Downloads: 24)
Reply
#12
(2011-12-30, 14:49:15)Mikael Gustafsson Wrote: Hi,
I don't really understand what the problem is now. Can you please post a screenshot of the GUI with debug mode activated when the problem happens.
I have tested now on PIC16F886 which is more or less identical to the 887. It works fine. I have attached my files.

Hi Mikael,
I have tried last your source code also but it not works.
In attached, screenshots of errors and my "full project" that you can view and edit freely.
Thank You again for your help.
Best Regards and Happy New 2012...


Attached Files Thumbnail(s)
       

.zip   CUBO.zip (Size: 79.67 KB / Downloads: 17)
.zip   firmware PIC12F PIC16F.zip (Size: 53.06 KB / Downloads: 14)
Reply
#13
Happy new year!
Please attache the entire modified boot loader firmware project.
Reply
#14
(2011-12-31, 15:39:59)Mikael Gustafsson Wrote: Happy new year!
Please attache the entire modified boot loader firmware project.

Hi,
in the last post I attached BootLoader project...
Thanks
Reply
#15
(2011-12-31, 15:55:25)dasty80 Wrote:
(2011-12-31, 15:39:59)Mikael Gustafsson Wrote: Happy new year!
Please attache the entire modified boot loader firmware project.

Hi,
in the last post I attached BootLoader project...
Thanks

Hi Mikael,
Do You Have some news for me?
Thanks.
Reply
#16
I'm sorry but I don't know what to make of it. It works fine in my tests using 886 which is practically identical.
Do this:
-Do a chip erase
-Verify erase
-Write boot loader
-Try to write once using the boot loader
-Read the entire flash
-Export it from MPLAB IDE
-Attach the hex file here.
Reply
#17
(2012-01-09, 21:27:28)Mikael Gustafsson Wrote: I'm sorry but I don't know what to make of it. It works fine in my tests using 886 which is practically identical.
Do this:
-Do a chip erase
-Verify erase
-Write boot loader
-Try to write once using the boot loader
-Read the entire flash
-Export it from MPLAB IDE
-Attach the hex file here.

Hi Mikael,
How Are You?...
I tried some methods but nothing is changed!... I don' t know why not work.
I tested Max232 circuit with a software in the Pic that Tx and Rx char, and It works. I tried others firmware to load in the Pic with BootLoader but appears the some error message.
In the attached the BootLoader.hex and the file.hex after a write.
Thank You very much for your patience and support.
Dany.


Attached Files
.zip   ds30loader.HEX.zip (Size: 1.15 KB / Downloads: 18)
.zip   After Write.hex.zip (Size: 1.22 KB / Downloads: 11)
Reply
#18
How did you create those files? When use export on the File menu in MPLAB IDE I get a file that is ~45k big.
Reply
#19
(2012-01-21, 14:17:26)Mikael Gustafsson Wrote: How did you create those files? When use export on the File menu in MPLAB IDE I get a file that is ~45k big.

Hi,
I read the flash of Pic before and after use of BootLoader, with Pic Programmer.
Reply
#20
I'm sorry I can't find the problem. If you send me a board I can take a look at it. Send me a pm.
Reply
#21
Hey there.

just to let u know, i'm checking ver 1.0.2 against 1.0.1.
when i try to bootload with the new version got some erros, same as the guy above, then i did the download that u gave him, change the device and worked for me.

i'll check the files and let u know what's wrong.

by the way, great job, keep on doing it bro, many thaxxx

Reply
#22
Hi,
I just tested with the with the latest package from the website and everything worked fine with a PIC16F886.
What error do you get?
Reply
#23
hey there....

i just did check it, and it worked,

sorry, my bad, it was just the internal oscillator's configuration, 'cause i was setting it up at 8MHz in my code, not in the loader's code.

anyway, now i'm facing another issue, the auto baud detecting, doesn't work, and it use to, i'll check it later, but for now it's just fine for me. u can see the loader size now....

i'll be trying it with some other pic, and i'll let u know.

thanxxx again


Attached Files Thumbnail(s)
       
Reply
#24
The auto baud rate detection functionality works fine. See the screenshot.
Is there possibly an errata for your chip? I used these settings:
Code:
#define        USE_UART1        1
#define        BAUDRATE         115200
#define        USE_ABAUD        1
#define        USE_BRGH        1
#define        USE_BRG16        1
;#define    USE_TXENABLE    1
Reply
#25
screenshot


Attached Files Thumbnail(s)
   
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)