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
waveform source controllable
-
- Professional User
- Posts: 13
- Joined: Fri 2024-01-12 13:24
Re: waveform source controllable
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. This method is shown in the attached file example1.pdsprj 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. Home it makes sense.
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. This method is shown in the attached file example1.pdsprj 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. Home it makes sense.
Kind regards,
Ettore Arena - Labcenter Electronics.
Ettore Arena - Labcenter Electronics.
-
- Professional User
- Posts: 13
- Joined: Fri 2024-01-12 13:24
Re: waveform source controllable
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
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 (109.35 KiB) Viewed 227 times
-
- pic1.png (136.09 KiB) Viewed 227 times
Re: waveform source controllable
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.
Ettore Arena - Labcenter Electronics.
-
- Professional User
- Posts: 13
- Joined: Fri 2024-01-12 13:24
Re: waveform source controllable
Hi, I see, ok, thank you for your time.
Re: waveform source controllable
I was thinking to something like this:
You can modify it at your need/pleasure.Kind regards,
Ettore Arena - Labcenter Electronics.
Ettore Arena - Labcenter Electronics.
-
- Professional User
- Posts: 13
- Joined: Fri 2024-01-12 13:24
Re: waveform source controllable
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.
Thanks again for your help.