MCLoader & XPort


Closed Thread
Results 1 to 40 of 45

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Jumper,

    I made the .lib modification and modified your code to read back 16 memory locations starting at 60106. Data coming back from the read is all FF's, so it looks like there's no program located there.

    Comments?

    Joe

    ================================================== ======

    DEFINE MAKE_LOADER 1 'Code will begin at 60160


    DEFINE HSER_RXSTA 90h
    define HSER_TXSTA 24h
    DEFINE HSER_BAUD 9600
    define OSC 8
    OSCCON = $FF
    TRISB=%00111111
    TRISC=%10111111


    RB6 var PORTB.6
    RB7 var PORTB.7

    TX Var PORTC.6
    RX Var PORTC.7
    '************************************************* ********************************************
    I VAR BYTE
    x var byte
    Flash var word
    Temp var word

    '************************************************* ********************************************

    Goto INIT


    '************************************************
    jump_back:
    'Flash=64
    'READCODE flash, temp 'Read the value at Flash adr
    'IF temp=$FFFF then STOP 'If it is $FFFF we have no application code in the PIC so STOP
    '@ GOTO 0x0040 'Start application
    '*************************************************

    'Here we decide if we should enter the Loader or not receiving a byte.

    INIT: Pause 200 'wait for things to settle
    Rb6=1 'indicate we are waiting for a character
    HSERin [x] 'if nothing after 5 sek go to jump_back
    if x="L" then
    PAUSE 100
    Goto Loader
    ENDIF 'If it is what we want to get then enter the laoder
    goto Jump_Back 'everything else jump_back

    '************************************************* ****************

    Loader:
    FOR I = 0 TO 15
    READCODE (60610 + I),X
    hserout [$0D, $0A, ":", HEX(X)," "]
    NEXT I
    RB7=1 'Indicate we have entered the Loader
    RB6=0
    pause 200

    'Here we can recieve new data and write it to the FLASH
    'Erase before writing and write full blocks 64 bytes
    '

    goto Jump_Back 'When finished goto
    END
    '************************************************* ********

  2. #2
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Hmm yes

    Check this part:

    FOR I = 0 TO 15
    READCODE (60610 + I),X <--------------- wrong
    hserout [$0D, $0A, ":", HEX(X)," "]
    NEXT I


    should be READCODE (60160+i),X

    But there is something else too, I need to check some things..... gimme half an hour

    /me
    Last edited by Jumper; - 24th August 2006 at 17:28.

  3. #3
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Jumper,

    Well, while I fail to see any syntactical or other error in the way I wrote the line, I did cut-paste your suggested line into my program - no change

    Am I failing to understand something about how READCODE works, or is there no code at the memory locations where there should be code?

    Joe

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Hmm MPLAB plays tricks with me

    Try the original HIJACKING way since I couldn't get it to work with our own DEFINE the second time I tried it.

    If you are using MPLAB you can look under view and program memory to see what your code looks like.

    Try the original approach:

    1: Change the LOADER_USED line in the LIB
    2: DEFINE LOADER_USED 1 in your code
    3: Compile
    4: Check program memory, there should be code in position 0 and 2 then FFFF until $EB00

    Syntax in PBP can be a little bit tricky. Some functions don't really like that you have a formula as argument. They want to have a WORD or BYTE only.

    /me

  5. #5
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Compile results from your file

    DEFINE LOADER_USED 1
    DEFINE HSER_RXSTA 90h
    define HSER_TXSTA 24h
    DEFINE HSER_BAUD 9600

    This is with the DEFINE LOADER_USED in the lib file like this

    ifdef LOADER_USED
    LIST
    ORG 60160 ; Own loader address
    NOLIST
    endif

    Any luck now??

    /me
    Attached Images Attached Images   

  6. #6
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Jumper,

    It seems like that's better. Here is dump result:
    :4
    :0
    :9E
    :AA
    :FD
    7
    :AE
    :50
    8
    :80
    :E1
    :EF
    :75
    :F0
    :E9
    :50

    But we should be able to do this with a custom DEFINE, no??

    Joe

  7. #7
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Maybe , probably but....

    I didn't really look into this because I never use any other loaders but maybe this forum can come up with an answer.

    This will not be solved today since we have passed Midnight a long time ago here.

    Maybe moving this to a new thread might be a good idea after we have solved these problems. Then all our misstakes will be forgotten......

    /me

Similar Threads

  1. xport code, have example, confused though
    By kenpo in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 30th March 2009, 19:59
  2. Bootloader and Instant Interrupts Atn:_DT_
    By Josuetas in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 16th May 2007, 01:59
  3. McLoader and 18F2580
    By rwskinner in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 12th February 2007, 06:20
  4. xport + connecting 2 networks
    By rf_xport in forum General
    Replies: 0
    Last Post: - 12th July 2006, 06:26
  5. Has anyone used the Lantronics Xport
    By octavio bru in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 14th September 2004, 11:51

Members who have read this thread : 0

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