Source code not visible in some sample projects

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Source code not visible in some sample projects

Post by picchiedi »

Hello.
When I try to run some sample projects, enclosed the case PICDEM MC demo, I have exception error and it seems the source code is not loaded.
After giving some "continue", the simulation run but with no source code visualization (see enclosed .zip).

This behaviour happens only with some sample projects.

Thanks a lot for any kind explanation of possible reason(if any).

Regards
Attachments
Source code not visualized during debug.zip
(238.73 KiB) Downloaded 257 times
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

Which Proteus version are you running ? Which Windows version ?
Kind regards,
Ettore Arena - Labcenter Electronics.
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Hello Ettore.
I run Proteus 8.3 sp2 with windows XP.
But I still have the same problem with demonstration version 8.8 sp1.

It seems that the windows exception error disappeared if I disconnect all drive with the icon on the bottom with an arrow (the one I use when I remove safely a USB key, for instance).

But the main problem still remains: I can't see the code during debug (only for some sample projects like the enclosed).

I know that I should update, but this will require to buy a completely new licence with new PC (they told me).

Thank you very much for your kind attention.

Regards.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

These samples are very old (2012) and made to work with MPLAB. It appears as the source code path embedded in the cof file has been lost so Proteus debugger is unaware of. You can, however, re-build the .cof file using the MPASMWIN and mplink tools provided in bundle with Proteus in the .\Labcenter Electronics\Proteus 8 Professional\Tools folder.

I suggest you creating a buid.bat file and save it in any specific sample folder you want to rebuild. You will call MPASMWIN assembler for any .asm source file existing in the project. All object files (.o) will be linked with mplink.exe at the end of assembly operations.

For example, the Proj8 gets 3 .asm files and, as a result, will require the following build.bat file:

Code: Select all

path=ProgramFiles\Labcenter Electronics\Proteus 8 Professional\Tools\MPASM
MPASMWIN.exe /e"Main.err" /l"Main.lst" /o"Main.o" /q+ /p16f917  "Main.asm"
MPASMWIN.exe /e"UARTInterface.err" /l"UARTInterface.lst" /o"UARTInterface.o" /q+ /p16f917  "UARTInterface.asm"
MPASMWIN.exe /e"UARTMonitor.err" /l"UARTMonitor.lst" /o"UARTMonitor.o" /q+ /p16f917  "UARTMonitor.asm"
mplink.exe /x /p16f917 /o "debug.cof" "16f917.lkr" "Main.o" "UARTInterface.o" "UARTMonitor.o"
del *.o; *.err;*.lst
As another example, the Proj6 get only two .asm files so you will require:

Code: Select all

path=ProgramFiles\Labcenter Electronics\Proteus 8 Professional\Tools\MPASM
MPASMWIN.exe /e"BackEMF.err" /l"BackEMF.lst" /o"BackEMF.o" /q+ /p16f917  "BackEMF.asm"
MPASMWIN.exe /e"LCD.err" /l"LCD.lst" /o"LCD.o" /q+ /p16f917  "LCD.asm"
mplink.exe /x /p16f917 /o "debug.cof" "16f917.lkr" "BackEMF.o" "LCD.o"
del *.o; *.err;*.lst
At the end of the build execution you should get a debug.cof file which you have to load in the PROGRAM property in Proteus project.

I trust you will be able to write your build file for the other samples.
Kind regards,
Ettore Arena - Labcenter Electronics.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

picchiedi wrote: Sat 2021-08-14 5:31 ... I know that I should update, but this will require to buy a completely new licence with new PC (they told me)...
"they" who ? Us, Labcenter ?
Well, about the PC, sure, you may have to (quite possibly) purchase a new one if you want to run Windows 10; you can't expect to run Windows 10 with old machine for WinXP :)

About the Proteus licence and as far as I'm aware of, what you require as a Professional user of 8.2 with expired USC is just an update to the current 8.xx version, not a completely new licence. Look at upgrades policy at https://www.labcenter.com/upgrades/

I will ask Dave for confirmation but I am reasonably sure.
Kind regards,
Ettore Arena - Labcenter Electronics.
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Thanks a lot Ettore, for your kindness and for your useful suggestions!

For the upgrade you're right. I remembered bad.
It happened in case I asked to add a PCB licence a couple of years ago.
In the offer of David, I guess, to do that I had to do also a renewal of the starter kit in amount of about 92 Euro.
But it was because I added a new PCB licence, I think.

In any case, I think that to run the latest version Proteus, if I buy the upgrade, I'm forced to chance operating system and PC.
I'm worried about that change, for the compatibility of all my other old programs...
But soon or later I know that I must do that... :) .

Thank you Ettore for your help and for working at this wonderful product.

Regards.
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Hello Ettore.

I thoght I had understood, but probably not.

I tell you what I did.
Like enclosed .zip, I put the .bat file like you wrote in the project folder Proj8 contained in PICDEM MC with PIC16F917 sample folder.
Then I tried to assemble one by one the 3 .asm code using MPASMWIN in Proteus Tool, but as I started I have, one after the other, following errors:
Error in parameter "and"
Error in parameter "Setting/all"
.....

Is my application of the procedure wrong?

Thank you

Regards
Attachments
Proj8.zip
(25.44 KiB) Downloaded 237 times
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

I have tested the .bat file in my emulated WinXP and it does work, so it would mean that you have the Tools in a different path.
What does it happen when you type MPASMWIN and press enter in a command (cmd) window ? Does MPASMWIN open up ? if so than remove the path= line from the .bat file and check again.
Kind regards,
Ettore Arena - Labcenter Electronics.
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Hello Ettore.
Yes, when execute MPASMWIN from dos command window MPASMWIN opens.
So I removed the path= line and run again, but I still have same error when assembling.

Actually the path in my case is C:\Programmi\Labcenter Electronics\Proteus 8 Professional\Tools\MPASM.
I tried also with that, but I still have same error.
Enclosed is the screen shot of MPASMWIN when I assemble. I don't know if make some error there.

But, Ettore, I don't want you to bother and loose your time with such an old matter.
Perhaps I'm going to rewrite the code and make my new project, in case.

Thanks a lot.

Regards
Attachments
MPASM.JPG
MPASM.JPG (65.5 KiB) Viewed 4168 times
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

If your path is that you did mention above, then you may try to delete the patch line and replace it with the following syntax which also works to me:

Code: Select all

set path=C:\Programmi\Labcenter Electronics\Proteus 8 Professional\Tools\MPASM
If even this does not work for you, then you have some unspecified installation issue.
Kind regards,
Ettore Arena - Labcenter Electronics.
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Hello Ettore.
Same errors, also with this attempt.

I solved (in a proper way, I suppose) by going through this alternative way:
I made a new project using MPLAB IDE, including all necessary .asm, .lkr,.inc, .h files (see enclosed), and rebuilt it.
Then I loaded in MCU property the debug file, as you suggested, and now I can see the source code lines during debug.

Many thanks for your kind support.

Regards.
Attachments
proj8_rebuilt.zip
(75.78 KiB) Downloaded 278 times
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Hello Ettore.
What I still miss in the enclosed sample PICDEM MC demo (in particular proj5 that runs the motor) is to understand why, even if the code calls
the clear and set of RD7 to stop and run the motor, acting at the end on the enable EN I guess, the motor is not influenced at all.
I mean the motor runs always, and from the start, whichever the projet furthermore, and regardless of the state of the RD7, that for my understanding should instead enable the motion or not.

Thank you for any kind explanation, if any.
Regards.
Attachments
OpticalInt.zip
(58.97 KiB) Downloaded 195 times
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

To be honest I did not fully understand your question.
However, yep, there are a number of limitations with those simulation projects.
The main reasoning was that the motor is driven with a 30us PWM period which made the simulation simply not possible to run in real time. For this reason a special simulation model for the MOSFET driver (Q11, IRF7309) has been developed. Such the model translates the PWM pulses to an equivalent DC voltage that, in turn, drives the DC motor and this strategy makes the simulation of the code working in real time and the motor to spin: we wanted to demonstrate the simulation of the PIC code as it is, after all!
The Q11 model worked fine if P1 (RD7) is high or, that's the same, the jump JP11 is closed, but it didn't if P1 is reset in the code or JP11 is open. For that reason the PICDEM MC demo file has been changed lately, but you are still using an old version.
Kind regards,
Ettore Arena - Labcenter Electronics.
picchiedi
Professional User
Posts: 142
Joined: Thu 2014-12-25 9:32

Re: Source code not visible in some sample projects

Post by picchiedi »

Hello Ettore.
I try to explain what my doubt was:
if JP11 is closed, RD7 is connected to EN, that I imagine is the enable for the engine to run (EN=1 run, EN=0 don't run).
So, in this situation, if in my code I put RD7=1, I expect the engine running, whereas if I put RD7=0, I expect the engine to stop.
But this doesn't happen: the motor runs even if JP11 is open, so without any enable EN.
So I couldn't stop the motor from the code.

Thank you so much for your attention.

Regards
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: Source code not visible in some sample projects

Post by Ettore »

Ok, that's exactly because you are using an old version of the demo file, as I have explained before.
A most recent version is, I think, in Proteus 8.13 SP0.
Kind regards,
Ettore Arena - Labcenter Electronics.
Post Reply