Range of DACL/DACR? LED rate indicator

Software questions and issues with the FV-1

Moderator: frank

Post Reply
mark2
Posts: 22
Joined: Mon Jan 20, 2020 4:17 pm

Range of DACL/DACR? LED rate indicator

Post by mark2 »

This just isn't "clicking" for me at the moment. I'm trying to use DACR to create a rate indicator LED. I have the following to simply conditionally set the output depending on the sign of SIN1:

Code: Select all

;--- Rate indicator
cho rdal, sin1
skp gez, LED_ON                 ;

sof 0, 0                        ; set ACC to zero
wrax dacr, 0                    ; LED off
skp zro, END_LED

LED_ON:
sof 0, 0.999
wrax dacr, 0                    ; LED on

END_LED:
The right output just goes through a resistor to the base of a transistor to drive the LED.

This gives me a square wave centered around 3V or so. Is there a way to create an output that alternates between 0V and some positive value to drive the transistor?

As an aside... This incidentally blinks the CLIP led, so that got me wondering if anyone has exploited that to use for a rate LED.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Re: Range of DACL/DACR? LED rate indicator

Post by Sweetalk »

When you write a 0 on the DAC, the output voltage will be 1.65v (3.3v/2 or Vref). To have 0v on the output you have to write a -1, but if you want to avoid the clipping led to light on just narrow the range a little bit, wrte -.9 and .9 instead of -1 / 1 or even -0.8 / 0.8.

Code: Select all

;--- Rate indicator
cho rdal, sin1
skp gez, LED_ON                 ;

sof 0, -0.9                        ; set ACC to zero
wrax dacr, 0                    ; LED off
skp zro, END_LED

LED_ON:
sof 0, 0.9
wrax dacr, 0                    ; LED on

END_LED:
That gives enough range to light the LED. You can also write the LFO value directly for a smooth rate indicator.
mark2
Posts: 22
Joined: Mon Jan 20, 2020 4:17 pm

Re: Range of DACL/DACR? LED rate indicator

Post by mark2 »

Thank you, that makes a lot of sense. I'll give it a try.
mark2
Posts: 22
Joined: Mon Jan 20, 2020 4:17 pm

Re: Range of DACL/DACR? LED rate indicator

Post by mark2 »

Yeah, those both worked beautifully, thanks. I tried both a gradual and hard-stepped version but preferred the latter since gradual seems asymmetric at lower speeds (LED appears ON more than OFF).

For anyone who comes across the thread later, here's the code I used:

Code: Select all

;--- Gradual LED indicator
cho rdal, sin1
;sof 0.95, 0                     ; probably not helpful
wrax dacr, 0

Code: Select all

;---- LED on/off rate indicator
cho rdal, sin1
skp gez, LED_ON                 ; Sign of SIN1 determines LED state

sof 0, -0.95                    ; Turn LED off
wrax dacr, 0
skp zro, END_LED

LED_ON:
sof 0, 0.95
wrax dacr, 0

END_LED:
Post Reply