Thank you Richard.
I'm going to have a look at the link you posted and try before asking more![]()
Thank you Richard.
I'm going to have a look at the link you posted and try before asking more![]()
Roger
Since I own MCSP (I forgot the included bootloader....), I give it a try.
I'm using a PIC18F2431 and here is my blinky:
Code:DEFINE LOADER_USED 1 #CONFIG __CONFIG _CONFIG1H, _OSC_IRCIO_1H & _FCMEN_ON_1H & _IESO_OFF_1H #ENDCONFIG OSCCON = %01100000 ' set INTRC to 4 MHZ MAIN: Toggle PORTA.7 ' LED pause 500 goto MAIN END
What did I do then?
1.- I flashed my PIC via PICKit3 with le bootloader file from MCS ("18F2431_04.hex") and checked if it was really there; yes, it is in the PIC!
...the rest of the code is way down in the memory - but it is there!
2.- I realised this serial programming circuit:
My FTDI cable is plugged in my PC and is "COM3".
3.- I launched the Loader from within MCSP and loaded my "Blinky_18F2431.hex" file previously compiled:
4.- When I clic on "Program" in the Loader, I get following message:
Since I couldn't make it work, I tried to connect a button between MCLG and GND to make a "manual" reset but it doesn't help either.
There seems to be nothing to configure in the FTDI chip to activate/deactivate the RTS pin so I admit it is working.
Any clue what I'm doing wrong or missing?
Roger
When using the MCSP bootloader you have to understand that it is the CONFIG of the bootloader .hex file that you initially flashed into into the PIC that's "in play" and not the CONFIG in your source file. The boorloader will completely ignore whatever CONFIG you include in your source file.
IIRC the bootloader(s) are setup for external x-tal. Your schematic indicates that you don't have one connected and your code indicates you're expecting the PIC to run on its internal oscillator - which it won't IF the bootloader dictates otherwise.
Some PICs allows you to change primary osillator at runtime but I don't think the old 2431 is one of them.
/Henrik.
Thank you so much Henrik!!!
I adapted my code to free up the OSC pins, put a crystal and 2 capacitors and....it worked instantly!!
May I kindly ask you how I can "create" or "modifiy" the bootloader file to adapt it to my needs please?
Roger
if you own mcs plus then its in this folder / if not you won't have the build files
C:\Program Files (x86)\Mecanique\MCSPX\MCLoader\umc\documentation
its an adventure not worth the trip in my experience
Warning I'm not a teacher
Last edited by flotulopex; - 3rd August 2020 at 11:14.
Roger
every chip type needs its own loader asm file ,every different config of that chip may need it own version, pll use brings another set of issuesWhat do you mean exactly if I may ask? Is customizing such a file overwhelming?
newer chip types aren't supported at all . the included device files are barely populated and need work to add chips.
its not particularly difficult just ugly and untidy
use C in mplabx it has a built in bootloader for mcc supported chips if you really want one. i prefer to just add an icsp socket.But if one has the need of a system that must be "updateable" without a programmer, what would be the alternative?
for sold to customer products its a return to base for updates.
better still these days do everything on a esp8266 and use ota to update [no wires no problem all via wifi]
Warning I'm not a teacher
Bookmarks