[sdiy] DsPIC timer issue when used as DCO!

Colin f colin at colinfraser.com
Thu Dec 10 17:52:12 CET 2009


 
> > Looking at the linked waveform there's a couple of 
> interesting things 
> > - the change from low to high frequency doesn't happen at 
> the min/max 
> > value of the triangle but at about -25 (using the scale in 
> the image).  
> > Is this because the multiplexed DAC outputs the new Vwf, 
> the current 
> > source charges the cap at the new rate, the waveshaper 
> quickly sweeps 
> > thru at the new frequency, and then the timing cap doesn't 
> get reset 
> > by the dsPIC.  It just sits there for ~13ms.  Perhaps the dsPIC is 
> > taking an interrupt between setting the new Vwf and 
> updating the dsPIC 
> > timer. The 'deeeeeeeeelaaaaay' is the length of the ISR?  I can't 
> > imagine any ISR would take that huge amount of time though. Hmmm.
> 
> Interesting! Yes 35ms appears to be a very long time for an ISR!
> What if the code is not correct, lets asume what Dave has 
> coded for the portamento to be 0 are instead e.g 1,5ms? that 
> would get stretched over the note range. 

I haven't been following this thread...
But that picture looks to me like the change of pitch applies immediately to
the CV for the waveshaper (the timing cap charges at the correct new rate
causing the triangle wave to complete its full cycle in the correct time),
but the timer generated reset of the cap doesn't happen until the end of the
period for the old pitch.
Superimpose another cycle of the lower pitch triangle wave in your head as
it continues - the switch to the higher pitch occurs after that cycle
completes.
This says to me that the new pitch period is being put into a reload
register in the timer, when it should be written to the current timer value.

Cheers,
Colin f






More information about the Synth-diy mailing list