[sdiy] Seb's Fat Controller (was DAC via Mux)
Seb Francis
seb at burnit.co.uk
Fri Nov 20 11:52:56 CET 2009
Justin Owen wrote:
> -----Original Message-----
> From: Eric Brombaugh [ebrombaugh1 at cox.net]
>
>
>> Check Seb Francis' Fat Controller MIDI2CV schematic for a good example of how this is done:
>>
>
> http://burnit.co.uk/sdiy/index.php?page=fatcontroller
>
> Thanks for this link Eric.
>
> I'm not sure if Seb is reading this - but the one query I have about his S&H circuit is that there doesn't seem to be any switching/sampling part to it. The Paia Fatman S&H uses a 4016 switched by the micro but Seb's Mux output seems to go straight into the S&H cap/op amp combo.
>
> Anyone care to explain that to me? Seb?
>
As Neil hinted at, the Mux also acts as a switch. It's necessary to
give some consideration to the timing of everything. Since I can't lay
my hands on the notes I made at the time, here's a the relevant bit of
source code, with my comments at the time...
nop2 and wait_us are macros - I expect you can guess what they do!
Update frequency is 51.2us per channel (768us overall = 1.302 KHz sample
rate)
PIC is running at 20MHz, so that's 0.2us per instruction
UpdateCVFromRAM
<snip>
; Set DAC to voltage
bcf PORTC,DACCS ; Set !CS low
movwf SSPBUF ; Transmit MSB
nop2 ; Wait 9 cycles before sending next byte
nop2
nop2
nop
bcf MUXE ; While waiting: Turn off MUX (takes max 300ns)
; Maybe move this to earlier to eliminate digital feedthrough from the
SPI signal???
movfw TEMP1 ; While waiting: Load LSB into w
movwf SSPBUF ; Transmit LSB and sub-bits
nop2 ; Wait 8 cycles
rlf TEMP3 ; While waiting: Shift MUX bits to left
btfsc TEMP3,4 ; While waiting: Copy bit 4 to left
bsf TEMP3,5
movfw TEMP3
movwf PORTA ; While waiting: Select MUX channel
nop
bsf PORTC,DACCS ; Set !CS high (loads DAC)
wait_us 5 ; Wait 5us for DAC and opamps to settle
; Maybe less wait with faster opamp?
bsf MUXE ; Turn on MUX (takes typ 105ns, max 600ns)
; S&H now has until next call of UpdateCVFromRAM to settle
bsf STATUS,RP0 ; Select RAM bank 1
return
More information about the Synth-diy
mailing list