How can I call Bootloader from Basic programm?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Posts
    3

    Default How can I call Bootloader from Basic programm?

    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.)?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2005
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    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

  3. #3
    micro's Avatar
    micro Guest


    Did you find this post helpful? Yes | No

    Default

    excuse me for this equestion because im still newbie
    what does Bootloader mean?? and what does that for??
    thanks

  4. #4
    Join Date
    Jun 2005
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by micro
    excuse me for this equestion because im still newbie
    what does Bootloader mean?? and what does that for??
    thanks
    Take a look here please:
    http://www.mecanique.co.uk/products/...ootloader.html

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  4. frequency meter in PBP
    By savnik in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 13th June 2007, 06:34
  5. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 18:57

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts