Discussion:
[PIC] MPLAB X execute program after device programmed?
s***@interlog.com
2018-05-29 21:43:41 UTC
Permalink
Hi,

Is there a way to get MPLAB X to run an .exe program *after* the device is
programmed, in the same way that it can run a program before the build (or
after the build) ?

I've made a device that switches the PGMD/PGMC lines, so they can be shared,
so it needs to be told to switch to the ICD4 for programming and then back
to the stuff on the PCB for testing.

If I can't figure anything else I can put a long delay in the device firmware
to do the switching, but it would be nice to have it go back right after the
programming operating completes.

Thanks!

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Isaac M. Bavaresco
2018-05-30 00:42:16 UTC
Permalink
In the "Building" group of the project's proprieties there are two
check-boxes "Execute this line before build" and "Execute this line
after build" with associated edit-boxes for typing the commands.

Cheers,

Isaac



Em 29/05/2018 18:43, ***@interlog.com escreveu:
> Hi,
>
> Is there a way to get MPLAB X to run an .exe program *after* the device is
> programmed, in the same way that it can run a program before the build (or
> after the build) ?
>
> I've made a device that switches the PGMD/PGMC lines, so they can be shared,
> so it needs to be told to switch to the ICD4 for programming and then back
> to the stuff on the PCB for testing.
>
> If I can't figure anything else I can put a long delay in the device firmware
> to do the switching, but it would be nice to have it go back right after the
> programming operating completes.
>
> Thanks!
>


---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailm
Spehro Pefhany
2018-05-30 02:48:51 UTC
Permalink
At 08:42 PM 5/29/2018, you wrote:
>In the "Building" group of the project's proprieties there are two
>check-boxes "Execute this line before build" and "Execute this line
>after build" with associated edit-boxes for typing the commands.
>Cheers, Isaac Em 29/05/2018 18:43,

Right, as I thought I mentioned, but 'after build' ends before
'program device'
begins so that doesn't work.

--sp


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Brent Brown
2018-05-30 03:10:22 UTC
Permalink
> >In the "Building" group of the project's proprieties there are two
> >check-boxes "Execute this line before build" and "Execute this line
> >after build" with associated edit-boxes for typing the commands.
> >Cheers, Isaac Em 29/05/2018 18:43,
>
> Right, as I thought I mentioned, but 'after build' ends before
> 'program device'
> begins so that doesn't work.

What programmer are you using? If you can do programming from command line
then maybe you could try putting that and your I/O change command in a batch file
and invoke with "Execute this line after build".


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Neil
2018-05-30 03:27:20 UTC
Permalink
Can you have it execute a batch file? In that batch file put a delay
and then the executable you want to run.

Cheers,
-Neil.


On 5/29/2018 10:48 PM, Spehro Pefhany wrote:
> At 08:42 PM 5/29/2018, you wrote:
>> In the "Building" group of the project's proprieties there are two
>> check-boxes "Execute this line before build" and "Execute this line
>> after build" with associated edit-boxes for typing the commands.
>> Cheers, Isaac Em 29/05/2018 18:43,
> Right, as I thought I mentioned, but 'after build' ends before
> 'program device'
> begins so that doesn't work.
>
> --sp
>
>

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Isaac M. Bavaresco
2018-05-30 09:48:52 UTC
Permalink
Sorry, I misunderstood your message.

Can't you create some simple hardware to monitor the MCLR line and do
the switching after some time of inactivity?

If MCLR is at Vpp or GND levels it is not running code. If you watch the
line in the oscilloscope you may have a good idea of its behavior and
figure out how to detect that it has finished programming. Perhaps the
detection can be as soon as a few milliseconds.

Cheers,

Isaac



Em 29/05/2018 23:48, Spehro Pefhany escreveu:
> At 08:42 PM 5/29/2018, you wrote:
>> In the "Building" group of the project's proprieties there are two
>> check-boxes "Execute this line before build" and "Execute this line
>> after build" with associated edit-boxes for typing the commands.
>> Cheers, Isaac Em 29/05/2018 18:43,
> Right, as I thought I mentioned, but 'after build' ends before
> 'program device'
> begins so that doesn't work.
>
> --sp
>
>


---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership op
AB, Pearce - UKRI STFC
2018-05-30 19:44:19 UTC
Permalink
Monitoring Vpp was my thought as well, provided you are not trying to debug - but then you would take your magic box out of the line anyway, eh?


-----Original Message-----
From: piclist-***@mit.edu [mailto:piclist-***@mit.edu] On Behalf Of Isaac M. Bavaresco
Sent: 30 May 2018 10:49
To: ***@mit.edu
Subject: Re: [PIC] MPLAB X execute program after device programmed?

Sorry, I misunderstood your message.

Can't you create some simple hardware to monitor the MCLR line and do the switching after some time of inactivity?

If MCLR is at Vpp or GND levels it is not running code. If you watch the line in the oscilloscope you may have a good idea of its behavior and figure out how to detect that it has finished programming. Perhaps the detection can be as soon as a few milliseconds.

Cheers,

Isaac



Em 29/05/2018 23:48, Spehro Pefhany escreveu:
> At 08:42 PM 5/29/2018, you wrote:
>> In the "Building" group of the project's proprieties there are two
>> check-boxes "Execute this line before build" and "Execute this line
>> after build" with associated edit-boxes for typing the commands.
>> Cheers, Isaac Em 29/05/2018 18:43,
> Right, as I thought I mentioned, but 'after build' ends before
> 'program device'
> begins so that doesn't work.
>
> --sp
>
>


---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/m
John J. McDonough
2018-05-30 14:45:31 UTC
Permalink
Does the '.all-post' target in the Makefile help?

I haven't had a need to do something after everything is done, but if it
is possible, it would seem like .all-post is the way to do it.

--McD


On Tue, 2018-05-29 at 17:43 -0400, ***@interlog.com wrote:
> Hi,
>
> Is there a way to get MPLAB X to run an .exe program *after* the device is
> programmed, in the same way that it can run a program before the build (or
> after the build) ?
>
> I've made a device that switches the PGMD/PGMC lines, so they can be shared,
> so it needs to be told to switch to the ICD4 for programming and then back
> to the stuff on the PCB for testing.
>
> If I can't figure anything else I can put a long delay in the device firmware
> to do the switching, but it would be nice to have it go back right after the
> programming operating completes.
>
> Thanks!
>


--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Loading...