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,

    OK, I think I have it. In the .lib file, there was another ORG statement further down that was apparently overriding the special ORG DEFINE that we put in. It looked like this:
    ORG RESET_ORG ; Reset vector at 0

    I commented it out, and all seems to work OK now, org'ing at 0 if nothing is specified and ORG'ing at 60160 using your special DEFINE to select the desired starting location.


    Joe

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


    Did you find this post helpful? Yes | No

    Default We need that define too

    We need the DEFINE RESET_ORG in the lib file when we write the application software to move the code to a suitable address (I like 64).

    Have you tried if that part works?


    /me

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I think this is a worthwhile project, but don't forget those of us that use parts with more than 64K of code space!
    Charles Linquist

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I agree. Funny... those i did with more than 64K, as now, don't use the bootloader, just ICSP. Case by case i guess.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default We must start somewhere

    Sure it would be nice if all PIC's could be using this loader but:

    How do we address the memory above 65535 ($FFFF) in READCODE and
    WRITECODE when PBP only have 16-bit variables. It seems to me that Microchip has outgrown PBP, 32-bit variables in PBP would be nice.

    ICSP is probably the way to go, unless it is done in ASM.

    Let's start with the 64K devices and see if we run into any mines. We are still far from finished.....

    /me

  6. #6
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Good morning all!
    (well morning my time...where is everyone else from?)

    An update on the project so far:

    1) We have a custom PBP DEFINE to specify where our bootloader should be in memory (needs to be checked further per Jumper's previous)
    2) I've written and compiled test code with the new DEFINE, and the resultant program truly does locate where it should be and run properly
    3) I wrote a little program that resides in 'remote' loader memory (ORG'd at 60160d) and writes a block of data to 'low' memory space starting at 0. This data block consists of 256 incrementing values starting at 0h and ending in FFh.

    I'm having a small problem with the last part. The data that I read back from memory is correct for the most part, but every 8th memory location has a "0" instead of the correct value. I don't have the code in front of me to attach, but I'll send it when I get back to my office later this morning. Basically though, the sequence of events is:

    A) Dump the 256 byte memory block to Hyperterminal using READCODE
    B) Do a 64-byte block erase using ERASECODE
    C) Rewrite each byte in the block just erased using WRITECODE
    D) Repeat for a total of 256 bytes
    E) Dump the re-written memory values to Hyperterminal

    If you want to cogitate on this for a while and speculate on what I might be doing wrong, I'll get you with some more details later. I think that once we get through this, we're on our way!

    BTW, in regard to programming bigger (>64K) parts, maybe we can fall back to using a little bit of embedded assembly code. Check out the OshonSoft web site for an example of how simple it can be:

    http://www.oshonsoft.com/pic18bootloader.html


    Joe

  7. #7
    Join Date
    Aug 2006
    Posts
    65


    Did you find this post helpful? Yes | No

    Default Loader Written in PBP

    Ok, as promised, here is the code and the result that I described earlier:

    CODE:

    INIT: HSEROUt [$0D,$0A,$0D,$0A] 'Make space between display dumps
    FOR I = 0 TO 255 step 16 'Dump 512 memory locations to screen
    hserout [hex4(i), ":: "]
    for j = 0 to 15 '16 bytes per line
    READCODE (i+J),X
    hserout [":", HEX2(X)," "]
    next j
    hserout [$0A, $0D] 'Line break after each line
    next i
    HSERin [x] 'Start on "L" from keyboard
    if x="L" then
    Goto Loader
    ENDIF
    '************************************************* ******************************
    Loader:
    for j = 0 to 255 step 64 'Erasecode does 64 bytes per block
    erasecode j 'Erase a block
    for i = 0 to 63 'Write 64 bytes
    writecode i+j,i+j 'Write the block that was just erased
    next i
    next j 'Keep going until done

    goto INIT 'Print out the result and wait




    and here is a partial of the screen dump:

    0000:: :00 :01 :02 :03 :04 :05 :06 :00 :08 :09 :0A :0B :0C :0D :0E :00
    0010:: :10 :11 :12 :13 :14 :15 :16 :00 :18 :19 :1A :1B :1C :1D :1E :00
    0020:: :20 :21 :22 :23 :24 :25 :26 :00 :28 :29 :2A :2B :2C :2D :2E :00
    0030:: :30 :31 :32 :33 :34 :35 :36 :00 :38 :39 :3A :3B :3C :3D :3E :00
    0040:: :40 :41 :42 :43 :44 :45 :46 :00 :48 :49 :4A :4B :4C :4D :4E :00
    0050:: :50 :51 :52 :53 :54 :55 :56 :00 :58 :59 :5A :5B :5C :5D :5E :00

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