Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 01, 2024, 04:45:28 04:45


Login with username, password and session length


Pages: [1]
Print
Author Topic: How can I call Bootloader from Basic programm?  (Read 8871 times)
0 Members and 1 Guest are viewing this topic.
Kabron
Active Member
***
Offline Offline

Posts: 198

Thank You
-Given: 64
-Receive: 144



« on: December 13, 2005, 04:05:28 16:05 »

Hello Fiends!
I need to pass control to Bootloader(Shipped with MCLoader) from running basic program. I tryed the following: @ goto 0, - the basic program performed restart, but not to the Bootloader. What are the right conditions( jump address, flags, etc.)? Does anybody knows?

Thanks in advance.
Logged
Faros
Senior Member
****
Offline Offline

Posts: 254

Thank You
-Given: 141
-Receive: 178


« Reply #1 on: December 13, 2005, 08:43:13 20:43 »

Hi …
Can you identify which basic do you use …?  (Mikrobasic, PIC BASIC, PROTON BASIC ….)
Logged
Kabron
Active Member
***
Offline Offline

Posts: 198

Thank You
-Given: 64
-Receive: 144



« Reply #2 on: December 14, 2005, 08:30:04 08:30 »

Quote from: Faros
Hi …
Can you identify which basic do you use …? (Mikrobasic, PIC BASIC, PROTON BASIC ….)

Doesn't matter as the bootloader is the same. But if the definition play a role for you let it be PBP and Proton+ or pure assembler.
Logged
Kabron
Active Member
***
Offline Offline

Posts: 198

Thank You
-Given: 64
-Receive: 144



« Reply #3 on: December 14, 2005, 08:39:35 08:39 »

The problem arised when I connected XPort to my project. As the XPort couldn't properly transmit DTR signal, I decide to watch for specific sequence in Rx stream ($E0..E0... in case of MCLoader) and pass control to Bootloader. So it will be possible to program the device distantly. But I'm afraid that Bootloader analyses the reset flags and do not starts in case of soft reset.
Logged
Faros
Senior Member
****
Offline Offline

Posts: 254

Thank You
-Given: 141
-Receive: 178


« Reply #4 on: December 14, 2005, 03:03:09 15:03 »

i have to try whatever i am going to post as a solution ... so I wanted as to be in the same boat ...
Logged
Kabron
Active Member
***
Offline Offline

Posts: 198

Thank You
-Given: 64
-Receive: 144



« Reply #5 on: December 15, 2005, 07:29:47 07:29 »

OK now I solved it.

You should wait for null character(s) in serial stream (byte $00) and then execute the following code:

ASM

MOVLW 0x1F
MOVWF PCLATH
GOTO 0x70D
ENDASM

or simple @ GOTO 0 if you test it in the first 2K code segment.



The whole example:



DEFINE LOADER_USED 1 ' uses a bootloader
define OSC 20
DEFINE HSER_BAUD 115200

Char var byte

TXSTA.2=1

SPBRG=10
hserout ["Program Starting...",CR]
ProgramStart:
WHILE 1
CHAR=1
hserin 1,TIMEOUT,[Char]
Timeout:
IF CHAR=0 THEN
ASM
MOVLW 0x1F
MOVWF PCLATH
GOTO 0x70D
ENDASM
' @ GOTO 0 'if this code is in the 1st 2k segment
endif

WEND
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC