waveform source controllable

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
mbristol78
Professional User
Posts: 13
Joined: Fri 2024-01-12 13:24

waveform source controllable

Post by mbristol78 »

Is there a way, or a component, a source, to generate a waveform at a desired time during the simulation.
The pulse/waveform component can do what I want, but it outputs as soon as the simulation starts.
I have a mcu to sample that wave, it needs to start, then give a signal to start the wave.
How can I do that?

Thanks
Ettore
Labcenter Staff
Posts: 2931
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: waveform source controllable

Post by Ettore »

There are several ways to control when a signal generator has to outputs the signal.

1)
By using generators in the GENERATOR bin (see attached picture). You can edit the generator and use several parameters that delays the wave form. For example, in the SINE generator we have "Time Delay (sec)" or with analogue PULSE generator a "Start(sec)" property. Also, with Digital Clock generator (DCLOCK) we have the "First Edge At" property.
Immagine 2024-02-27 110750.jpg
Immagine 2024-02-27 110750.jpg (59.58 KiB) Viewed 243 times
This method is shown in the attached file example1.pdsprj
example1.pdsprj
(43.42 KiB) Downloaded 91 times
2)
The other way - which I think is what you were searching for - is with the gate method. This is done through the use of DSWITCH primitive and a DEDGE or DPULSE generator (still in the GENERATOR bin). The advantage of such the method is that you can switch on or off any signals, even by using a pulse generated by your simulated micro.
This method is depicted in the example2.pdsprj.
The SPICE generator V1 and V2 is in the standard library at the Simulator Primitives->Sources category. The DSWITCH primitive is in the library at Modelling Primitives->Mixed Mode category.
example2.pdsprj
(55.32 KiB) Downloaded 89 times
Home it makes sense.
Kind regards,
Ettore Arena - Labcenter Electronics.
mbristol78
Professional User
Posts: 13
Joined: Fri 2024-01-12 13:24

Re: waveform source controllable

Post by mbristol78 »

Hello,

Thanks for your answers, although each of the solutions you propose is "cutting" the source from its load, but still, the source runs from the beginning of the simulation.
I would like to "start" the source at any point with a trigger.
As an example, the attached photo pic1 shows "example2"; the DSWITCH is cutting the track, but chB will match chA when DSWITCH is activated, 600ms later.
Pic2 shows what I am trying to do, the green line to "start" at 600ms (or any other time when my DSWITCH is activated, by software or hardware).
That is because the intended waveform source I'd like to use is not periodic, so I need to be in control of when it starts within the simulation.

Thanks
Attachments
pic2.png
pic2.png (109.35 KiB) Viewed 224 times
pic1.png
pic1.png (136.09 KiB) Viewed 224 times
Ettore
Labcenter Staff
Posts: 2931
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: waveform source controllable

Post by Ettore »

If non-periodic list of values have to start by hardware then there's nothing ready, I'm afraid. I presume the simplest thing you can do is by using a second (smaller) PIC with a list of values you may use to change PWM output and, finally, use a PWMTOV primitive to get the voltage output. PWMTOV is in the library at Modelling Primitive->Miscellaneous.
Kind regards,
Ettore Arena - Labcenter Electronics.
mbristol78
Professional User
Posts: 13
Joined: Fri 2024-01-12 13:24

Re: waveform source controllable

Post by mbristol78 »

Hi, I see, ok, thank you for your time.
Ettore
Labcenter Staff
Posts: 2931
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: waveform source controllable

Post by Ettore »

I was thinking to something like this:
Controllable_waveform_source.pdsprj
(110 KiB) Downloaded 368 times
You can modify it at your need/pleasure.
Kind regards,
Ettore Arena - Labcenter Electronics.
mbristol78
Professional User
Posts: 13
Joined: Fri 2024-01-12 13:24

Re: waveform source controllable

Post by mbristol78 »

Thank you, looks like it can do what I'd like indeed. I'll try something similar in my design in the next few days.
Thanks again for your help.
Post Reply