Hello, and thanks for your answer.
I'll try to explain what I need to do.
Let's use P to indicate a pulse lasting 500ns. For "pulse" I mean a digital signal switching from level 0 to level 1 at time 0, remaining at level 1 for 500ns, then switching to level 0 again.
Let's use Z to indicate a signal which remains at 0 for 500ns.
Let's use L to indicate a pulse lasting 1000ns, ie a digital signal switching from level 0 to level 1 at time 0, remaining at level 1 for 1000ns, then switching to level 0 again.
I need to generate someting like this: ... ZZPZPZZZZPZPZZZPZLZLZPPZZP...
The exact sequence is not always the same (it depends from variable data). The number of pulses until stop may vary from 60 to 120, also depending on data.
All intervals are multiple of 500ns. The 1000ns pulses, however, can't be obtained by concatenating 2 500ns pulses because there's no return to 0 after the first 500ns.
I tried to obtain this sort of thing in three different ways using MCF52235:
1) Using QSPI: I configured the QSPI to produce pulses of 500ns, then I loaded data in the QSPI transmission register and started the peripheral. The result was good, but I cannot prevent the QSPI from inserting a little delay between bursts. So I abandoned this approach.
2) Using GPIO: I wrote a little assembler routine which toggled the status of a GPIO pin based on data; I inserted some delay to ensure the toggling lasts 500ns exactly. It worked *perfectly* on two different MCF52235 evaluation boards; after we made the first prototype, however, we realized that there was a random jitter in pulse duration: the jitter was of 32 or 64 ns. For example: if a P pulses lasts, say, 500-32 ns, the following Z "pulse" lasts 500+32 ns. We *suppose* this is due to synchronization between Coldfire core and GPIO. We haven't been able to discover this reading the manual.
3) Using DMA timer: this is the solution that gives no jitter in pulse duration. However, this is not good for us, because 500ns (30 clock cycles) are not enough to toggle the pin, reload the counter, and check for new data. Then minimun duration we were able to handle was about 60-70 clock cycles. Of course, there's no jitter in pulses generation.
After loosing the battle against jitter, we give up and used an external CPLD to retime the signal coming from GPIO (solution 2).
Any better solution?