Some help is required from anyone who has had sucsess cofiguring different PIC parts? I am trying to add a PIC24EP256GP204 and what follows is the process i have used.
looking at the momory map details i assumed that the 24E falls in the type D family?
I added the new part to the PICini file but then found there was an existing entry for PIC24E, device ID $70
I started with an existing D family PIC24 source file, TinyBld_PIC24F32KA301.s
I modified the file for PIC24EP256GP204
I built the project but it return 2 asm errors, undefined symbol ERASE' in operation: undefined symbolNVMOP4' in operation.
I looked at the p24EP256GP204.inc file and see there are no references to the above 2 symbols.
Can any one help me out here? there is a virtual cold beer for help :-) and i will post the working files to this forum. Below is my .s file
;changetheselinesaccordinglytoyourapplication.equ__24EP256GP204,1.include"p24EP256GP204.inc".equIdTypePIC,0x70;Pleaserefertothetablebelow,mustexistsin"piccodes.ini".equmax_flash,0x55800;PICmaxaddress,notbytes!!!(='maxflashmemory'from"piccodes.ini"dividedby2),Pleaserefertothetablebelow.equFcy,140030000/2;PIC24E,Fcy=Fosc/2.equbaud,19200;standardTinyBldbaudrates:115200or19200.equUART_CH,1;selectUART(1/2);Theabove7linescanbechangedandbuidabootloaderforthedesiredfrequency(andPICtype);+---------+------------+------------+------------+---------------+---------------+-----------+--------+;|IdTypePIC|Device|Write_Page|Erase_Page|TXport(U1/U2)|RXport(U1/U2)|max_flash|EEPROM|;+---------+------------+------------+------------+---------------+---------------+-----------+--------+;|0x14|24F16KA301|32instr.|32instr.|B7(11)/B0(4)|B2(6)/B1(5)|0x2C00|512|;|0x15|24F32KA301|32instr.|32instr.|B7(11)/B0(4)|B2(6)/B1(5)|0x5800|512|;|0x14|24F16KA302|32instr.|32instr.|B7(16)/B0(4)|B2(6)/B1(5)|0x2C00|512|;|0x15|24F32KA302|32instr.|32instr.|B7(16)/B0(4)|B2(6)/B1(5)|0x5800|512|;|0x14|24F16KA304|32instr.|32instr.|C7(3)/B0(21)|C6(2)/B1(22)|0x2C00|512|;|0x15|24F32KA304|32instr.|32instr.|C7(3)/B0(21)|C6(2)/B1(22)|0x5800|512|;+---------+------------+------------+------------+---------------+---------------+-----------+--------+;|0x14|24FV16KA301|32instr.|32instr.|B7(11)/B0(4)|B2(6)/B1(5)|0x2C00|512|;|0x15|24FV32KA301|32instr.|32instr.|B7(11)/B0(4)|B2(6)/B1(5)|0x5800|512|;|0x14|24FV16KA302|32instr.|32instr.|B7(16)/B0(4)|B2(6)/B1(5)|0x2C00|512|;|0x15|24FV32KA302|32instr.|32instr.|B7(16)/B0(4)|B2(6)/B1(5)|0x5800|512|;|0x14|24FV16KA304|32instr.|32instr.|C7(3)/B0(21)|C6(2)/B1(22)|0x2C00|512|;|0x15|24FV32KA304|32instr.|32instr.|C7(3)/B0(21)|C6(2)/B1(22)|0x5800|512|;+---------+------------+------------+------------+---------------+---------------+-----------+--------+;PC_flash:LHU96...[DataLDataHDataU]*32...crc;PC_cfg:LHU18...[CFGDataLCFGDataH]*9...crc;PIC_response:type`D`;;;;;;PC_cfgData:[CFGDataLCFGDataH0]*9(TypeD);;;;;;0xF800000xF800080xF80012;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|X|fordsPIC30F;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|X|X|O|O|O|O|O|O|O|forPIC24FXXKA201/202;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|O|forPIC24FXXKA3XX,PIC24FXXKA101/102;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|X|forPIC24FXXKLXXX,PIC24FXXKMXXX;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|X|forPIC24H;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|O|forPIC24EPXXXGU810/814,PIC24EP512GP806;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|O|fordsPIC33FJ32GS406/606/608/610,33FJ64GS406/606/608/610;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|X|forotherdsPIC33F;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;+-----+-----+-----+-----+-----+-----+-----+-----+-----+;|O|O|O|O|O|O|O|O|O|fordsPIC33EP256MU806,dsPIC33EPXXXMU810/814,;+-----+-----+-----+-----+-----+-----+-----+-----+-----+dsPIC33EP512(MC/GP)806;X:Invalid(reciveonly),O:Effectiveness,rewriteConfig.IF(UART_CH==2).equUxMODE,U2MODE.equUxSTA,U2STA.equUxBRG,U2BRG.equUxTXREG,U2TXREG.equUxRXREG,U2RXREG.ELSE.equUxMODE,U1MODE.equUxSTA,U1STA.equUxBRG,U1BRG.equUxTXREG,U1TXREG.equUxRXREG,U1RXREG.ENDIF;********************************************************************;TinyBootloaderPIC24F(V)16KA30X24F(V)32KA30XSize=100words;;claudiu.chiculita@ugal.ro;http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm;;ThisprogramisonlyavailableinTinyAVR/PICBootloader+.;;TinyAVR/PICBootloader+;https://sourceforge.net/projects/tinypicbootload/;;;********************************************************************config__FICD,ICS_PGD1&JTAGEN_OFFconfig__FPOR,ALTI2C1_ON&ALTI2C2_OFFconfig__FWDT,WDTPOST_PS256&WINDIS_OFF&PLLKEN_ON&FWDTEN_OFFconfig__FOSC,POSCMD_NONE&OSCIOFNC_ON&IOL1WAY_OFF&FCKSM_CSECMEconfig__FOSCSEL,FNOSC_FRCPLL&IESO_ONconfig__FGS,GWRP_OFF;REGISTRY:;W0imediat;W1crc;W2EAWrite;W3memorybufferpointer;W4;W5;W6;W7;W8;W9;W10delay1;W11delay2;W12for/do;W13;W14void(blackhole);W15stack.global__reset.sectionRAM,bssstack:.space64;stackbuffer:.space32*3;Data.text.equbl_size,32*3*2;sizeofbootloader:32*3+4=100instr..orgmax_flash-0x200-bl_size-4*2first_address:NOPNOPNOPNOP__reset:;Startofmaincodelabel,initialstackpointer=0x800BCLRAD1CON1,#ADON;A/DConverterisoffCOMANSB;AllDegitalPortinit_uart:;InitializeandEnableUART1forTxandRxbsetUxMODE,#UARTENbsetUxSTA,#UTXENmov#(((Fcy/baud)/16)-1),W0;?InitializeBaudrate(divideINSTRUCTIONCycle)movW0,UxBRG;to115200Kbaud#(((8000000/115200)/16)-1)rcallReceive;waitforcomputersub.b#0xC1,W0;ExpectC1hbraNZ,way_to_exitmov.b#IdTypePIC,W0;sendPICtypemovW0,UxTXREGMainLoop:mov.b#'D',W0;"-Everything OK, ready and waiting."mainl:movW0,UxTXREGclrW1;clearchksumrcallReceive;setEA,TBLPAG,Countmov.bWREG,WREG2LrcallReceivemov.bWREG,WREG2H;;;;;movWREG2,W2;W2=EA;;;;;rcallReceivemovW0,TBLPAG;setTBLPAGrcallReceivemovW0,W12;W12=countmov#buffer,W3;W3=DatabufferTOPdorcv:rcallReceivemov.bW0,[W3++]decW12,W12braNZ,dorcvrcallReceive;checkCRCziieroare:mov.b#'N',W0braNZ,mainlmov#buffer,W3;W3=DatabufferTOPbtssTBLPAG,#7;isCFGdata?branoconfigwr_cfg:mov#8,W12;W12=loopcounterwr_cfg_lp:TBLWTL[W3++],[W2];writeintoprogramlatchMOV#((1<<WREN)|(1<<NVMOP2)),W0;writeConfig:0x4004rcallKey_Sequenceinc2W2,W2decW12,W12braNZ,wr_cfg_lpbraMainLoopnoconfig:btssTBLPAG,#6;isEEPROMdata?brawr_flashwr_EEPROM:TBLWTL[W3],[W2];writeintoprogramlatchMOV#((1<<WREN)|(1<<NVMOP2)),W0;writeEEPROM:0x4004rcallKey_SequencebraMainLoopwr_flash:TBLWTLW0,[W2];dummyMOV#((1<<WREN)|(1<<ERASE)|(1<<NVMOP4)|(1<<NVMOP3)),W0;PageErase:0x4058rcallKey_Sequencemov#32,W12;W12=loopcounterw_l:TBLWTL.B[W3++],[W2++];WritePMlowwordintoprogramlatchTBLWTL.B[W3++],[W2--];WritePMhighbyteintoprogramlatchTBLWTH.B[W3++],[W2];WritePMmiddlewordintoprogramlatchinc2W2,W2decW12,W12braNZ,w_lMOV#((1<<WREN)|(1<<NVMOP2)),W0;PageWrite:0x4004rcallKey_SequencebraMainLoop;-----------------------------------------------------Key_Sequence:;ExpectsaNVMCONvalueinW0MOVW0,NVMCONMOV#0x55,W0;WritethekeysequenceMOVW0,NVMKEYMOV#0xAA,W0MOVW0,NVMKEYBSETNVMCON,#WR;StartthewritecycleNOPNOPKey_Wait:btscNVMCON,#15braKey_WaitRETURNReceive:mov#(2*Fcy/2000000+1),W10;mstowaitrpt2:clrW11rpt1:btssUxSTA,#URXDAbranorcvmovUxRXREG,W0;W0=Dataadd.bW0,W1,W1;computecrcreturnnorcv:decW11,W11braNZ,rpt1decW10,W10braNZ,rpt2timeout:way_to_exit:clrUxMODE;deactivateUARTbrafirst_address.end
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some help is required from anyone who has had sucsess cofiguring different PIC parts? I am trying to add a PIC24EP256GP204 and what follows is the process i have used.
ERASE' in operation: undefined symbol
NVMOP4' in operation.Can any one help me out here? there is a virtual cold beer for help :-) and i will post the working files to this forum. Below is my .s file