PWLIN continuous

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
uriotech
Professional User
Posts: 164
Joined: Sun 2010-05-30 22:13

PWLIN continuous

Post by uriotech »

How I can simulate the attached signal continuously, at 100 hz ?

Ricardo Urio
Attachments
Ignition signal
Ignition signal
Ignition signal.jpg (92.03 KiB) Viewed 791 times
chimimic
Expert User
Posts: 508
Joined: Tue 2006-04-11 13:31
Location: France
Contact:

Re: PWLIN continuous

Post by chimimic »

Hi Ricardo,

perhaps EasyHDL could be a solution for you ?
With it, you can specify any analog (or digital) signal and make it periodic.

Code: Select all

REM Define time/value pairs for the output
DATA 1u,10
DATA 1.8m,10
DATA 2m,0
DATA 4.2m,0
DATA 4.8m,230
DATA 5.4m,10
DATA 5.6m,30
DATA 5.8m,10
DATA 6m,30
DATA 6.2m,10
DATA 6.4m,30
DATA 6.6m,10
DATA 6.8m,20
DATA 7.4m,20
DATA 7.6m,10
DATA 0,0  // End of data

FLOAT PERIOD=10m
FLOAT v,t,td
TIME OFFSET=0

REM Reset the data pointer to
REM start a new cycle
ON TIMER AT PERIOD EVERY PERIOD
   RESTORE
   OFFSET=EVTTIME
ENDON

ON EVENT
 READ t,v
 IF t > 0
  t = t + OFFSET
  OUT=v AT t // The output is set to voltage v at time t
  CALLBACK AT t
 ENDIF
ENDON
Remy
Attachments
proteus_easyhdl_sample_001a.gif
proteus_easyhdl_sample_001a.gif (4.53 KiB) Viewed 772 times
uriotech
Professional User
Posts: 164
Joined: Sun 2010-05-30 22:13

Re: PWLIN continuous

Post by uriotech »

Thank you, I never used HDL, it´s very good !

Ricardo Urio
See_mos
Professional User
Posts: 37
Joined: Mon 2006-03-13 8:59
Location: Aberdeen

Re: PWLIN continuous

Post by See_mos »

At the moment I am stuck with version 8 beta on W7.

I tried the EasyHDL code above as starter for a project that needs similar signal but when I try to run the simulation I get an error message.

"This application has requested the Runtime to terminate it in an unusual way"

Followed by Proteus closing completely.

Any ideas please?
Ettore
Labcenter Staff
Posts: 2935
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: PWLIN continuous

Post by Ettore »

With no info is hard to have any clue on why it happens.
For example, you didn't clarify if your simulation was working well with no EasyHDL code and then crashed down when added in.
Or, did you test EasyHDL code alone and then system crashed ?

However I tried the same EasyHDL code on Win7 installation and it still works well with Proteus 8 (BETA).
The message looks like a Windows error. A possible reason is your Windows/Proteus installation and/or Microsoft Redistributable files are corrupted.
I would try to run the Proteus beta installer and "Remove" completely the Proteus installation and then install in again.
Backup any customized library you've created so far.
Kind regards,
Ettore Arena - Labcenter Electronics.
See_mos
Professional User
Posts: 37
Joined: Mon 2006-03-13 8:59
Location: Aberdeen

Re: PWLIN continuous

Post by See_mos »

Sorry, this is the first time I tried to use EasyHDL.

The error was my fault, I did not know that the generator has to have a proper name such as 'Impulse' rather than ? or R1.1 or the nearest component pin name such as 'A' for the oscilloscope.
Ettore
Labcenter Staff
Posts: 2935
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: PWLIN continuous

Post by Ettore »

This is odd. With my installation the name ? is accepted as shown below. Only when named as the pin (A) from oscilloscope or R1.1 from nearest resistor (if any) this triggers a recoverable error from Proteus - as depicted below. But Proteus did not close abruptly as you say in any case. I still think you have something odd in your system.
Attachments
Immagine1.jpg
Immagine1.jpg (239.92 KiB) Viewed 637 times
Immagine.jpg
Immagine.jpg (81.47 KiB) Viewed 637 times
Kind regards,
Ettore Arena - Labcenter Electronics.
See_mos
Professional User
Posts: 37
Joined: Mon 2006-03-13 8:59
Location: Aberdeen

Re: PWLIN continuous

Post by See_mos »

Hi Ettore, it probably is because I only have the V8.0 Beta, or it could be a problem with the DLL.

My USC expired a long time ago. Now that I am retired and no longer a commercial user I had hoped that sales would make me a deal but at the moment I cannot afford the full price to upgrade.
Post Reply