ds30 Loader free edition forums
problem with PIC16F877 [solved] - Printable Version

+- ds30 Loader free edition forums (https://picbootloader.com/forum)
+-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3)
+--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7)
+--- Thread: problem with PIC16F877 [solved] (/showthread.php?tid=483)



problem with PIC16F877 [solved] - antonadc - 2012-02-19

Everytime I want to program the chip a message comes up say no goto at org 0. What am I doing wrong. Please help. I am using latest ds30 bootloader and mplab to asemmble the bootloader file. I program the chip with ICD2. Huh


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-19

Upload the hex file and I will take a look at it.


RE: problem with PIC16F877 - antonadc - 2012-02-19

(2012-02-19, 06:32:07)antonadc Wrote: Everytime I want to program the chip a message comes up say no goto at org 0. What am I doing wrong. Please help. I am using latest ds30 bootloader and mplab to asemmble the bootloader file. I program the chip with ICD2. Huh




RE: problem with PIC16F877 - antonadc - 2012-02-20

(2012-02-19, 13:33:24)Mikael Gustafsson Wrote: Upload the hex file and I will take a look at it.

Uploaded hex file with txt ext. Just remove.txt Thanks


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-20

Thank you. That was the bootloader right? I need your application hex file and preferably the source as well.


RE: problem with PIC16F877 - antonadc - 2012-02-21

I have partially solved the problem. Firstly I discoverred to my horrer I had an old ds30 program. I re-installed the new program and it all seemed to work ok until I discovered that the 877 code will not work. Checking my hex file (From Proton+ crownhill ass) The first location for the 18 and 16 series is zero. This is to make way for the location 0 goto instruction. Not much I can do. The ds30 18 BL has one location open at 0 and that is for the goto. Now the ds30 bl for the 16 series has 3 bytes in it 2 for bank switching and the last for goto. Can the first 2 bytes not be removed and the goto put at 0? Please.

Thanks

Anton


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-22

What do you mean by "the 877 code will not work"?
What is "Proton+ crownhill ass"?
Upload or send me the application hex file and preferably the source as well.

Regards
Mikael


RE: problem with PIC16F877 - antonadc - 2012-02-22

(2012-02-22, 22:51:38)Mikael Gustafsson Wrote: What do you mean by "the 877 code will not work"?
What is "Proton+ crownhill ass"?
Upload or send me the application hex file and preferably the source as well.

Regards
Mikael

It crashes on run with bl but if i program the hex file as is it works
The crownhill ass is a picbasic compilor. http://www.protonbasic.co.uk
done


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-23

Thanks, I will take a look at it.


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-23

Try with this setting:
Bootloader=Off


RE: problem with PIC16F877 - antonadc - 2012-02-23

(2012-02-23, 14:16:38)Mikael Gustafsson Wrote: Try with this setting:
Bootloader=Off

Sorry nothing works. I have programmed a small porgram to display a logo. When I program it directly into memory with ICD2 it works ok. With bootloader on or off and programming it with ds30 Bootloader the screen stays blank.


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-23

Do you use exactly the same configuration bits in the bootloader as in the application?


RE: problem with PIC16F877 - antonadc - 2012-02-24

(2012-02-23, 21:09:45)Mikael Gustafsson Wrote: Do you use exactly the same configuration bits in the bootloader as in the application?

Thank you for reply will check.


RE: problem with PIC16F877 - antonadc - 2012-02-24

This was posted on the proton forum by another user
quote
I don't know if Proton accounts for this or not when a program first starts up, but in the sources I have for the 16F both ds30loader.asm and umc_loader.asm leave the banksel set for bank1 prior to jumping to the user code. Most compilers assume it's set to 0 like it would normally be at poweron, so when your app runs the banksel isn't what it would normally be without a bootloader.
unquote

I hope this helps

Anton


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-02-28

That might be an issue. I will look into it.
Have you compared the configuration bits?


RE: problem with PIC16F877 - antonadc - 2012-02-29

(2012-02-28, 22:16:50)Mikael Gustafsson Wrote: That might be an issue. I will look into it.
Have you compared the configuration bits?

Thanks No not config bits tried that as well.


RE: problem with PIC16F877 - Mikael Gustavsson - 2012-03-03

Hi,
I have been busy with the commercial version. I will get back to this thread when I have time.
You cold try to clear the pclat register the first thing in you code.


RE: problem with PIC16F877 - antonadc - 2012-03-04

(2012-03-03, 23:06:50)Mikael Gustafsson Wrote: Hi,
I have been busy with the commercial version. I will get back to this thread when I have time.
You cold try to clear the pclat register the first thing in you code.

Thanks will try it



RE: problem with PIC16F877 - Mikael Gustavsson - 2012-03-06

Sorry I didn't mean the PCLAT register, i meant the BANKSEL bits as you pointed out earlier. Something like this
Code:
STATUS.RP0 = 0
STATUS.RP1 = 0



RE: problem with PIC16F877 - antonadc - 2012-03-07

(2012-03-06, 13:01:55)Mikael Gustafsson Wrote: Sorry I didn't mean the PCLAT register, i meant the BANKSEL bits as you pointed out earlier. Something like this
Code:
STATUS.RP0 = 0
STATUS.RP1 = 0

Yipee found the problem it is the status file.
;---------------------------------------------------------------------
; GOTO user application
;--------------------------------------------------------------------- org STARTADDR - 3 ;space to deposit goto application
loadusr
clrf STATUS <-- added this now all works ok
;nop ;page select, replaced by gui
;nop ;page select, replaced by gui
;nop ;goto, replaced by gui




RE: problem with PIC16F877 - Mikael Gustavsson - 2012-03-08

Great! Thanks for helping out. I will add this fix to the package.