Menu

bootloader for 18f47k40 - modified k42 asm help

sheldon
2020-07-25
2020-09-02
  • sheldon

    sheldon - 2020-07-25

    like to make use of a modifed k42 asm for k40 use ,
    the orginal k42 asm compiles ok ,

    need some help with C and the bank use by the look for the k40 series for the asm - chip i need to test on 18F47k40 , please see attached

     
  • sheldon

    sheldon - 2020-07-25

    modifed file

     
  • sheldon

    sheldon - 2020-07-26

    any one with some more c programing who can read the asm/change asm so at least it compiles would be of help

     
  • Anobium

    Anobium - 2020-07-26

    Sheldon. No MPASM installed on my current computer as I have installed the new MPLAB-X. Arghhh

    Line 60 vtxPPS - should the references to vtxPPSbe txPPS
    Line 187: Does U2TXB exist in the soure INC file? You have a constant defined that refers to U2TXB but is may not exist.
    Remove all references to UNLOCKPPS and LOCKPPS. You dont need them. This will resolve a lot of the BANKSEL issues.
    Line 196: _RXPPS refers to the contant U2RXPPS. Does that existin the source INC file?

    Lots of the errors seem to point to the INC not having the correct constants. Resolve this first.

    Sorry, I truly dont have all my tools available.

     
  • sheldon

    sheldon - 2020-07-26

    hi evan , i have a go on the changes you sugest , try to contact you on skype but with no outcome,

     
  • sheldon

    sheldon - 2020-07-27

    be handy if you could load MPASM to check this please

     
  • Anobium

    Anobium - 2020-07-27

    Same errors with respect to constants not present - errors 113

    make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
    make[1]: Entering directory 'C:/Users/admin/MPLABXProjects/k49.X'
    make  -f nbproject/Makefile-default.mk dist/default/production/k49.X.production.hex
    make[2]: Entering directory 'C:/Users/admin/MPLABXProjects/k49.X'
    make[2]: *** [build/default/production/_ext/1199933227/test_tinybld18FxxK40_int64MHz_19200.o] Error 1
    make[1]: *** [.build-conf] Error 2
    make: *** [.build-impl] Error 2
    "C:\Program Files (x86)\Microchip\MPLABX\v5.35\mpasmx\mpasmx.exe" -q -p18f47k40 -l"build/default/production/_ext/1199933227/test_tinybld18FxxK40_int64MHz_19200.lst" -e"build/default/production/_ext/1199933227/test_tinybld18FxxK40_int64MHz_19200.err" -o"build/default/production/_ext/1199933227/test_tinybld18FxxK40_int64MHz_19200.o" "../../Downloads/test_tinybld18FxxK40_int64MHz_19200.asm" 
    
    Warning[205] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 1 : Found directive in column 1. (radix)
    Error[108]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 19 : Illegal character (+)
    Warning[207] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 65 : Found label after column 1. (vtxPPS)
    Error[105]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 93 : Cannot open file (Include File "spbrgselect.inc" not found)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 187 : Symbol not previously defined (U2TXB)
    Warning[202] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 189 : Argument out of range.  Least significant bits used.
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 196 : Symbol not previously defined (U2RXPPS)
    Warning[202] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 214 : Argument out of range.  Least significant bits used.
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 215 : Symbol not previously defined (RXEN)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 216 : Symbol not previously defined (U2CON0)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 217 : Symbol not previously defined (spbrg_value)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 218 : Symbol not previously defined (U2BRGL)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 219 : Symbol not previously defined (U2ON)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 219 : Symbol not previously defined (U2CON1)
    Warning[202] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 222 : Argument out of range.  Least significant bits used.
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 278 : Symbol not previously defined (REG0)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 295 : Symbol not previously defined (REG1)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 303 : Symbol not previously defined (REG1)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 313 : Symbol not previously defined (U2RXIF)
    Warning[207] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 315 : Found label after column 1. (subfsr)
    Error[122]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 315 : Illegal opcode (FSR1)
    Warning[207] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 317 : Found label after column 1. (addfsr)
    Error[122]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 317 : Illegal opcode (FSR1)
    Warning[202] ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 330 : Argument out of range.  Least significant bits used.
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 331 : Symbol not previously defined (U2ON)
    Error[113]   ..\..\DOWNLOADS\TEST_TINYBLD18FXXK40_INT64MHZ_19200.ASM 331 : Symbol not previously defined (U2CON1)
    
    nbproject/Makefile-default.mk:108: recipe for target 'build/default/production/_ext/1199933227/test_tinybld18FxxK40_int64MHz_19200.o' failed
    make[2]: Leaving directory 'C:/Users/admin/MPLABXProjects/k49.X'
    nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
    make[1]: Leaving directory 'C:/Users/admin/MPLABXProjects/k49.X'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
    
    BUILD FAILED (exit value 2, total time: 1s)
    
     
  • sheldon

    sheldon - 2020-07-27

    hey thank Evan , yes the k40 inc has dif names for these registers, so i am going though 18F47k40 chip pdf to match the required registers
    eg U2TXB (k42) = RX2PPS(k40) i think
    have to marry up all the other name changes to each

    just alot reading of the k40 chip register sets to and the k42 chip register set to see if it doing the same thing , just another name
    then looking up the c code to try to follow what each is trying to achieve
    again be better done by some one who knows what they are doing , than me guessing

    vtxPSS value i think is not used ?? ( ref line 192 - movlw vtxPPS is commented out )
    yes not using PPSLocked for bank is not need but illsee if can translate ot to the use for the k40

     
  • Anobium

    Anobium - 2020-07-27

    That approach wont work.

    Using the Great Cow BASIC source libraries will help, as follows. We have mapped VARs and BIts to the same register/bits. So, U2TXB would be the same as TXREG2 and TX2REG. We have normalised the register/bit to make support easier.

    Use this as a source.

    #samevar TXREG, TXREG1, U1TXB
    #samebit TXIF, TX1IF, U1TXIF
    
    #sameVar TXREG2, TX2REG, U2TXB
    #samevar TXSTA2, TX2STA
    #samebit TX2IF, U2TXIF
    #samebit TXSTA2.TRMT, TX2STA.TRMT, U2ERRIR.TXMTIF
    #samebit TXSTA2_TRMT, TX2STA_TRMT, U2ERRIR_TXMTIF '// PIC16F1946/47
    
     
  • sheldon

    sheldon - 2020-07-28

    mmm , seems like dan or your self would be best to update the asm so it workable for the k40 series

     
  • sheldon

    sheldon - 2020-07-30

    evan - email me , cheers sheldon

     
  • sheldon

    sheldon - 2020-08-10

    hi evan , dan , i got a bit further with this but like to you review it , like to add information from the the new build that i have change for it , please contact me when you can , cheers sheldon

     
  • Anobium

    Anobium - 2020-08-10

    ok. Good to hear.

    I am back at work next week, CV19 recovering.

     
  • sheldon

    sheldon - 2020-08-10

    ok evan , skype me when you return next week

     
  • sheldon

    sheldon - 2020-08-18

    hi evan you back on deck
    please contact me on skype , cheers

     
  • sheldon

    sheldon - 2020-09-02

    hi evan , looks like your not online much atm and not back at work as yet ????

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.