I think it depends on how precise our times have to be reproduced and how long your time phases are.
When the frequency is low enough, you could do with just one timer and one DAC. the trick is to set up everything after a phase change for the next phase and using the strobe input of the DAC from the (single) timer TC.
If frequency is too high, I would suggest to use a PWM which is able to generate two of your phases and with chance even all four.
You can use the 'normal' wave generator strategy - driving the DAC from the DMA. See the WaveDAC8 AppNote for an example: http://www.cypress.com/?rID=54728 . You would need to modify the waveform stored in the RAM to match your timings.
Some thoughts -
1) You have built a constant I generator to drive load, with switches to reverse polarity,
but that is not reflected in timing diagram, so not sure of its purpose ?
2) Your description is that all pulses occur sequentially, so I only see the need to use one VDAC.
3) Prior thread, ram based table makes good sense if this is a repetitive waveform. Store in table
wave amplitude, width, and at each terminating PWM pulse, ISR, do the next lookups and write
the VDAC and PWM period, duty cycle registers.
Or, following Dana's advice, use DMA to keep the CPU free from doing too much work. There is a WAVEDAC component using this feature (run a keyword search on that). If you still in need of a solution I'll have to dig for an example I programmed using a table in Rom sending out data to a DAC repeatedly.
The range of timing values for T1, T2, and T3 are between 0.3 - 10 milliseconds.
1) Yes, the purpose of the voltage signal is to control an external constant current generator (see image). The non-zero phases will be able to have their polarity switched. In the end I will need to control the exteranal analog switching using the PSoC timing scheme.
2) Yes, the pulses occur sequentially.
3) As I mentioned, I am considering the analog switching scheme in efforts to create a waveform with fast rise and fall times. My concern is that using one VDAC is that it isn't fast enough to change values before the switch changes polarity.
There may be no time delay between the two non-zero phases in some instances (T2=0). Thus, I will have no time between the two non-zero phases. T4 represents the delay between repeats of the waveform.
Now I understand, I thought the original goal was a wide dynamic range of
setting amplitude, its clear you only need limited number of voltages. Excellent
approach using muxed fixed voltages.
Note the OP162 has limited C load capability, hence phase margin, because
the MAX4622 presents a lot of Cload, thats why it has such good Ron for an
analog swtitch, lots of channel, hence Miller. Look at datasheet, there is a
section on loading to handle the phase margin problem in the 162 to keep
the ringing down.
According to the data sheet, the VDAC has a settling time of 1µs max, in the 1V range (the typical value is 0.45µs). If this is enough, the DAC solution is viable. If not, the idea with the fixed voltages is fine.
If you want to have a more hardware-based solution, you need to use 4 timers (one for each period). You can trigger them in a linked ring (t1 trigeers T2, T2 trigger T3 and so on), and with each trigger event you can use a lookup table to select the proper output on your mux.
If you want to use only a single timer, you could use a DMA to set the timer periods. Each timer a timer reaches its TC, switches to the next output via the lookup table, triggers the DMA event to write the next period values, and the starts the timer again. (Though I think that this will get tricky)
If the "bit" timing is same, pulse to pulse, a single LUT can
provide triggers and timing. I know the diagram does not in-
dicate this, but if it were.........
Btw: I think we should ask Dave for some official 'PSoC zealot' T-Shirts: we got already 5 different solutions for the same problem :)
Are those shirts available in XXXL?
When I stay with my preconceptions about the US: when Dave wears a XL shirt, it means XXXL in Germany :)
(Though I'm afraid that after this statement I will never receive such a shirt...)
OK, so XXXL in US is a tent, but I know, I'm a bit more in size than Dave.