Page 1 of 1
ECIO-40p
Posted: Thu Mar 01, 2012 4:14 pm
by pmr1
I am using the ECIO programmer in standalone mode and tried to load the hex file compiled under MPLAB V 8.76. The file loads and attempts program the device but fails to complete. The last block fails to load and led remains in a flashing state. It does this also with a pre-compiled code from fCV4. However within FCV4 it does program correctly reverting to a the green led being continuously on and code functions as intended. Are some other commands I need to supply to terminate the programming under stand alone operation ?
Re: ECIO-40p
Posted: Thu Mar 01, 2012 4:52 pm
by Benj
Hello,
Yes you need to do two things when using a stand alone compiler.
1) You need to shift the beginning of your code from 0x0 to 0x800. In the Microchip compilers this is normally done with a linker script or pragma command. You shoul dbe able to look at a Microchip bootloader example to find out how this is done.
2) You also need to ensure the hex file is generated in "inhx032" format. You may not need to do anything here but if the programming still does not work after you have shifted the code to start from 0x800 then you may need to look into how this is done for your compiler.
See this page where is details how to setup the HiTech compiler for use with an ECIO or MIAC in Flowcode.
http://www.matrixmultimedia.com/mmforum ... =26&t=6812
Programs generated in Flowcode for a non ECIO target eg the 18F4455 will not work on the ECIO as you need to follow step 1 as listed above. Simply switching the project chip target to a ECIO in Flowcode and recompiling will automatically solve this issue.
Re: ECIO-40p
Posted: Fri Mar 02, 2012 2:02 pm
by pmr1
Hi Benj,
Thanks for your detailed reply, however I still cannot get it to load correctly after setting switches as suggested. I am using picc-18 ver 9.63 in lite mode. On peeking the .hex file code in my application is offset at 0x800 but a bulk of the code is loaded at the top ( high address) end of memory - does this cause a problem with ECIO devices ?
Regards
Paul
Re: ECIO-40p
Posted: Fri Mar 02, 2012 3:07 pm
by Benj
Hi Paul,
No that shouldn't be a problem. If you like you can send me the hex file via a attachment or PM and I will have a look for you.
Re: ECIO-40p
Posted: Sun Mar 04, 2012 8:27 pm
by pmr1
Hi Benj,
Soruce and .hex attached.
Regards
Paul
Re: ECIO-40p
Posted: Mon Mar 05, 2012 10:43 am
by Benj
Hello,
Looking at another project online using the same compiler they seem to have the following linker setting in their compilation toolchain.
--output=default,-inhx032
I think this is the switch that will allow the ECIOprog tool to correctly load your hex file. The hex file itself looks ok to me so the addresses have been shifted to 0x800 correctly.
Taken from this post
http://www.microchip.com/forums/tm.aspx ... e=1#637261
Re: ECIO-40p
Posted: Mon Mar 05, 2012 5:02 pm
by pmr1
Hi Benj,
When I load a FCV4 test programme via the ECIO programmer it loads and only runs when I issue a reset command ( ^T). When the HITECH compiled code is loaded it fails to run after a reset. Looking at the hex file : in the flowcode example the code starts thus
1025 0800 EF26 GOTO 0x84c
1026 0802 F004 NOP
1027 0804 FFFF NOP
1028 0806 FFFF NOP
1029 0808 EF4B GOTO 0x896
1030 080A F004 NOP
In the HITECH example code starts :
1025 0800 EE00 LFSR 0, 0
1026 0802 F000 NOP
1027 0804 EE10 LFSR 0x1, 0x6
1028 0806 F006 NOP
1029 0808 EC1A CALL 0x834, 0
1030 080A F004 NOP
1031 080C EE04 LFSR 0, 0x400
1032 080E F000 NOP
LFSR is not listed in the PIC18F4455 instruction. Any Ideas ?
Paul
Re: ECIO-40p
Posted: Thu Mar 08, 2012 1:22 pm
by pmr1
Further investigation revealed that the hex file generated by the hitech compiler does not load properly even though the hex output format is inhx032. When read back via the programmer the device is empty ! Eyeballing the hex file and comparing it with a working FCV4 hex file they look similar in format. Perhaps its the compiler.
Re: ECIO-40p
Posted: Thu Mar 08, 2012 3:05 pm
by Benj
Hello,
I have had hex files working with the ECIO and MIAC using the Hitech compiler so it definitely can work.
Here are the settings for Flowcode.
If your using a Matrix target with Matrix USB bootloader eg MIAC, ECIO
Compiler Location = C:\Program Files\HI-TECH Software\PICC-18\PRO\9.63\bin\picc18.exe
Params = --CHIP=%p -N48 %f.c --CODEOFFSET=800h --ROM=default,-0-7FF --OUTPUT=inhx032
Taken from this article.
http://www.matrixmultimedia.com/mmforum ... =26&t=6812
Have you done a Google search for some thing along the lines of "hitech pdfsusb bootloader example"
The second link down looks pretty good.
http://www.picprojects.net/usbbootloader/index.html
See the section entitled "Application Software for usage of the Bootloader"
Though the programming tool is the ECIOprog application and not the Microchip PDFSUSB application the hex format and firmware offset are the same.
Re: ECIO-40p
Posted: Fri Mar 23, 2012 5:53 pm
by pmr1
Hi Benj,
Finally found the problem - I was using an old ECIO programmer. On using mLoader it run first time and code is performing as expected with compiler switches as suggested. Thanks for your help.
Regards
Paul
Re: ECIO-40p
Posted: Fri Mar 23, 2012 5:56 pm
by Benj
Hi Paul,
That's great glad you got it working and thanks for letting us know.