diff --git a/stereo_mix/hardware_design/pcb/dac.lbr b/stereo_mix/hardware_design/pcb/dac.lbr new file mode 100644 index 0000000..6534794 Binary files /dev/null and b/stereo_mix/hardware_design/pcb/dac.lbr differ diff --git a/stereo_mix/hardware_design/pcb/simulation/digital_tests.asc b/stereo_mix/hardware_design/pcb/simulation/digital_tests.asc index 4be1c6d..9b42d26 100644 --- a/stereo_mix/hardware_design/pcb/simulation/digital_tests.asc +++ b/stereo_mix/hardware_design/pcb/simulation/digital_tests.asc @@ -1,42 +1,45 @@ Version 4 -SHEET 1 1028 680 -WIRE 928 -160 832 -160 -WIRE 784 -64 768 -64 -WIRE 800 -64 784 -64 -WIRE 832 -64 832 -160 -WIRE 848 -64 832 -64 -WIRE 928 -48 928 -160 -WIRE 928 -48 912 -48 -WIRE 688 -32 688 -64 -WIRE 784 -32 784 -64 -WIRE 800 -32 800 -64 -WIRE 848 -32 800 -32 +SHEET 1 1208 680 WIRE 304 32 272 32 WIRE 624 32 608 32 -WIRE 896 128 784 128 WIRE 96 144 80 144 WIRE 176 144 176 64 WIRE 192 144 192 32 WIRE 192 144 176 144 WIRE 208 144 192 144 -WIRE 304 144 304 32 -WIRE 400 144 304 144 -WIRE 512 144 480 144 +WIRE 384 144 384 32 +WIRE 384 144 368 144 +WIRE 400 144 384 144 WIRE 528 144 528 32 -WIRE 528 144 512 144 +WIRE 528 144 480 144 WIRE 544 144 528 144 -WIRE 304 160 304 144 +WIRE 304 160 304 32 WIRE 304 160 272 160 WIRE 624 160 624 32 WIRE 624 160 608 160 WIRE 208 176 192 176 WIRE 544 176 496 176 -WIRE 784 176 784 128 WIRE 80 192 80 144 WIRE 192 192 192 176 -WIRE 512 208 512 144 -WIRE 512 208 496 208 -WIRE 496 224 496 208 +WIRE 368 256 368 144 +WIRE 528 320 528 144 +WIRE 528 320 512 320 +WIRE 432 368 432 320 +WIRE 464 368 432 368 +WIRE 352 400 320 400 +WIRE 464 400 464 368 +WIRE 464 400 432 400 +WIRE 320 480 320 400 +WIRE 320 480 272 480 +WIRE 368 480 320 480 +WIRE 112 496 112 480 +WIRE 192 496 192 480 +WIRE 192 496 112 496 +WIRE 464 496 464 400 +WIRE 464 496 432 496 +WIRE 112 512 112 496 +WIRE 368 512 352 512 +WIRE 352 560 352 512 FLAG -192 208 0 FLAG -192 352 0 FLAG -80 352 0 @@ -52,14 +55,15 @@ FLAG 96 64 -10V FLAG 192 192 0 FLAG 576 192 -12V FLAG 576 128 +12V -FLAG 416 224 -10V FLAG 496 176 0 -FLAG 784 256 0 -FLAG 880 -16 0 -FLAG 880 -80 +5V -FLAG 832 0 0 -FLAG 688 48 0 -FLAG 784 48 0 +FLAG 368 336 0 +FLAG 112 592 0 +FLAG -352 128 +4V096 +FLAG -352 208 0 +FLAG 112 400 +4V096 +FLAG 400 528 -12V +FLAG 352 560 0 +FLAG 400 464 +12V SYMBOL voltage -80 256 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 @@ -79,7 +83,7 @@ SYMBOL voltage 80 176 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V4 -SYMATTR Value SINE(0 10 20) +SYMATTR Value PULSE(-10 10 0 .1 .1 0 .2) SYMBOL res 192 128 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 @@ -114,32 +118,43 @@ WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R5 SYMATTR Value 100k -SYMBOL res 512 208 R90 +SYMBOL res 400 16 R90 +WINDOW 0 0 56 VBottom 2 +WINDOW 3 32 56 VTop 2 +SYMATTR InstName R9 +SYMATTR Value {X} +SYMBOL res 384 352 R180 +WINDOW 0 36 76 Left 2 +WINDOW 3 36 40 Left 2 +SYMATTR InstName R10 +SYMATTR Value {100k-X} +SYMBOL res 528 304 R90 +WINDOW 0 0 56 VBottom 2 +WINDOW 3 32 56 VTop 2 +SYMATTR InstName R11 +SYMATTR Value 100k +SYMBOL res 96 384 R0 +SYMATTR InstName R12 +SYMATTR Value {X} +SYMBOL res 96 496 R0 +SYMATTR InstName R13 +SYMATTR Value {100k-X} +SYMBOL voltage -352 112 R0 +WINDOW 123 0 0 Left 0 +WINDOW 39 0 0 Left 0 +SYMATTR InstName V6 +SYMATTR Value 4.096 +SYMBOL TL072 400 432 R0 +SYMATTR InstName U4 +SYMBOL res 288 464 R90 +WINDOW 0 0 56 VBottom 2 +WINDOW 3 32 56 VTop 2 +SYMATTR InstName R14 +SYMATTR Value 43k +SYMBOL res 448 384 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R6 SYMATTR Value 100k -SYMBOL voltage 784 160 R0 -WINDOW 123 0 0 Left 0 -WINDOW 39 0 0 Left 0 -SYMATTR InstName V6 -SYMATTR Value SINE(0 5 20) -SYMBOL Opamps\\LT1677 880 -112 R0 -SYMATTR InstName U3 -SYMBOL voltage 688 -48 R0 -WINDOW 3 23 87 Left 2 -WINDOW 123 0 0 Left 0 -WINDOW 39 0 0 Left 0 -SYMATTR InstName V7 -SYMATTR Value SINE(0 10 20) -SYMBOL res 784 -80 R90 -WINDOW 0 0 56 VBottom 2 -WINDOW 3 32 56 VTop 2 -SYMATTR InstName R7 -SYMATTR Value 100k -SYMBOL res 800 64 R180 -WINDOW 0 36 76 Left 2 -WINDOW 3 36 40 Left 2 -SYMATTR InstName R8 -SYMATTR Value 100k -TEXT -98 212 Left 2 !.tran 1 +TEXT -96 216 Left 2 !.tran 1 +TEXT 720 80 Left 2 !.step param X .1k 99.9k 1k diff --git a/stereo_mix/hardware_design/pcb/simulation/digital_tests.log b/stereo_mix/hardware_design/pcb/simulation/digital_tests.log index 1bac454..5f7b1c1 100644 --- a/stereo_mix/hardware_design/pcb/simulation/digital_tests.log +++ b/stereo_mix/hardware_design/pcb/simulation/digital_tests.log @@ -1,90 +1,158 @@ -Circuit: * Z:\home\jhbruhn\eurorack\eurorack-dev-environment\eurorack-modules\stereo_mix\simulation\digital_tests.asc +Circuit: * Z:\home\jhbruhn\eurorack\eurorack-dev-environment\eurorack-modules\stereo_mix\hardware_design\pcb\simulation\digital_tests.asc -WARNING: Less than two connections to node N006. This node is used by V6. +Early termination of direct N-R iteration. Direct Newton iteration failed to find .op point. (Use ".option noopiter" to skip.) Starting Gmin stepping -Increasing initial diagonal Gmin to 100 -Gmin = 100 +Gmin = 10 vernier = 0.5 vernier = 0.25 -Gmin = 34.2672 vernier = 0.125 +Gmin = 5.5165 vernier = 0.0625 vernier = 0.03125 vernier = 0.015625 -Gmin = 33.0995 vernier = 0.0078125 +Gmin = 5.49501 vernier = 0.00390625 vernier = 0.00195313 -Gmin = 32.9705 vernier = 0.000976563 vernier = 0.000488281 +Gmin = 5.50104 Gmin = 0 Gmin stepping failed Starting source stepping with srcstepmethod=0 Source Step = 3.0303% -vernier = 0.25 -Source Step = 0.0177557% -Source Step = 0.0473485% -Source Step = 0.0769413% -Source Step = 0.106534% -Source Step = 0.136127% -Source Step = 0.16572% -vernier = 0.00146484 -Source Step = 0.208629% -Source Step = 0.253018% -Source Step = 0.297408% -Source Step = 0.341797% -Source Step = 0.386186% -vernier = 0.00219727 -Source Step = 0.448331% -Source Step = 0.514915% -Source Step = 0.581499% -Source Step = 0.648082% -Source Step = 0.714666% -vernier = 0.0032959 -Source Step = 0.804554% -Source Step = 0.90443% -Source Step = 1.00431% -Source Step = 1.10418% -Source Step = 1.20406% -vernier = 0.00494385 -Source Step = 1.3339% -Source Step = 1.48371% -Source Step = 1.63352% -Source Step = 1.78334% -Source Step = 1.93315% -vernier = 0.00741577 -Source Step = 2.12042% -Source Step = 2.34514% -Source Step = 2.56986% -Source Step = 2.79458% -Source Step = 2.96312% -Source Step = 3.0193% -Starting source stepping with srcstepmethod=1 -Source Step = 3.0303% -Source Step = 7.48106% -Source stepping failed +Source Step = 9.84848% +Source Step = 17.4242% +Source Step = 25% +Source Step = 32.5758% +Source Step = 40.1515% +vernier = 0.375 +Source Step = 50.7576% +Source Step = 62.1212% +Source Step = 73.4848% +Source Step = 84.8485% +Source Step = 96.2121% +vernier = 0.5625 +Source stepping succeeded in finding the operating point. -Pseudo Transient succeeded in finding the operating point at 274.067 ms. -Heightened Def Con from 0.463185 to 0.463185 +.step x=100 +.step x=1100 +.step x=2100 +.step x=3100 +.step x=4100 +.step x=5100 +.step x=6100 +.step x=7100 +.step x=8100 +.step x=9100 +.step x=10100 +.step x=11100 +.step x=12100 +.step x=13100 +.step x=14100 +.step x=15100 +.step x=16100 +.step x=17100 +.step x=18100 +.step x=19100 +.step x=20100 +.step x=21100 +.step x=22100 +.step x=23100 +.step x=24100 +.step x=25100 +.step x=26100 +.step x=27100 +.step x=28100 +.step x=29100 +.step x=30100 +.step x=31100 +.step x=32100 +.step x=33100 +.step x=34100 +.step x=35100 +.step x=36100 +.step x=37100 +.step x=38100 +.step x=39100 +.step x=40100 +.step x=41100 +.step x=42100 +.step x=43100 +.step x=44100 +.step x=45100 +.step x=46100 +.step x=47100 +.step x=48100 +.step x=49100 +.step x=50100 +.step x=51100 +.step x=52100 +.step x=53100 +.step x=54100 +.step x=55100 +.step x=56100 +.step x=57100 +.step x=58100 +.step x=59100 +.step x=60100 +.step x=61100 +.step x=62100 +.step x=63100 +.step x=64100 +.step x=65100 +.step x=66100 +.step x=67100 +.step x=68100 +.step x=69100 +.step x=70100 +.step x=71100 +.step x=72100 +.step x=73100 +.step x=74100 +.step x=75100 +.step x=76100 +.step x=77100 +.step x=78100 +.step x=79100 +.step x=80100 +.step x=81100 +.step x=82100 +.step x=83100 +.step x=84100 +.step x=85100 +.step x=86100 +.step x=87100 +.step x=88100 +.step x=89100 +.step x=90100 +.step x=91100 +.step x=92100 +.step x=93100 +.step x=94100 +.step x=95100 +.step x=96100 +.step x=97100 +.step x=98100 +.step x=99100 +.step x=99900 -Date: Wed Nov 13 23:02:23 2019 -Total elapsed time: 80.796 seconds. +Date: Thu Dec 05 21:47:55 2019 +Total elapsed time: 43.862 seconds. tnom = 27 temp = 27 method = modified trap -totiter = 3586130 -traniter = 3577585 -tranpoints = 1609521 -accept = 1147239 -rejected = 462294 -matrix size = 61 -fillins = 90 +totiter = 8318 +traniter = 5030 +tranpoints = 2376 +accept = 1996 +rejected = 380 +matrix size = 72 +fillins = 224 solver = Normal -Thread vector: 14.0/12.0[3] 4.0/2.9[3] 4.0/2.7[3] 0.4/1.2[1] 2592/500 -Matrix Compiler1: 8.46 KB object code size 2.5/1.4/[0.9] -Matrix Compiler2: 6.89 KB object code size 1.3/1.7/[0.5] +Matrix Compiler1: 18.84 KB object code size 5.1/2.7/[1.4] +Matrix Compiler2: 10.08 KB object code size 2.1/2.8/[0.9] diff --git a/stereo_mix/hardware_design/pcb/simulation/digital_tests.op.raw b/stereo_mix/hardware_design/pcb/simulation/digital_tests.op.raw index 55fc3f4..e8ebb01 100644 Binary files a/stereo_mix/hardware_design/pcb/simulation/digital_tests.op.raw and b/stereo_mix/hardware_design/pcb/simulation/digital_tests.op.raw differ diff --git a/stereo_mix/hardware_design/pcb/simulation/digital_tests.raw b/stereo_mix/hardware_design/pcb/simulation/digital_tests.raw index ba4a0af..87373b0 100644 Binary files a/stereo_mix/hardware_design/pcb/simulation/digital_tests.raw and b/stereo_mix/hardware_design/pcb/simulation/digital_tests.raw differ diff --git a/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.brd b/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.brd index 79bf6ed..ea92d83 100644 --- a/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.brd +++ b/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.brd @@ -1,6 +1,6 @@ - + @@ -6338,6 +6338,62 @@ OSHW_LOGO + +<b>Digital to Analogue Converters</b><br> +From Texas, Microchip +Vaguely based on Farnell provided libs, but they're too ugly to use directly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + @@ -7345,6 +7401,154 @@ design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7402,8 +7606,6 @@ design rules under a new name. - - @@ -7450,7 +7652,6 @@ design rules under a new name. - @@ -7875,14 +8076,12 @@ design rules under a new name. - - @@ -7933,8 +8132,6 @@ design rules under a new name. - - @@ -8080,6 +8277,60 @@ design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -8309,6 +8560,22 @@ design rules under a new name. + + + + + + + + + + + + + + + + @@ -8486,6 +8753,22 @@ design rules under a new name. + + + + + + + + + + + + + + + + @@ -8867,25 +9150,16 @@ design rules under a new name. - - - - - - - - - @@ -8933,7 +9207,6 @@ design rules under a new name. - @@ -8982,33 +9255,27 @@ design rules under a new name. - - - - - - @@ -9016,7 +9283,6 @@ design rules under a new name. - @@ -9024,7 +9290,6 @@ design rules under a new name. - @@ -9032,7 +9297,6 @@ design rules under a new name. - @@ -9077,6 +9341,9 @@ design rules under a new name. + + + @@ -11045,13 +11312,6 @@ design rules under a new name. - - - - - - - @@ -11259,6 +11519,14 @@ design rules under a new name. + + + + + + + + @@ -11326,6 +11594,14 @@ design rules under a new name. + + + + + + + + @@ -11377,6 +11653,215 @@ design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.sch b/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.sch index 142d97e..e757883 100644 --- a/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.sch +++ b/stereo_mix/hardware_design/pcb/stereo_mix_back_digital.sch @@ -1,6 +1,6 @@ - + @@ -39005,6 +39005,208 @@ OSHW_LOGO + +<b>Digital to Analogue Converters</b><br> +From Texas, Microchip +Vaguely based on Farnell provided libs, but they're too ugly to use directly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>Dual In Line Package</b> + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + +DAC 8BIT DUAL SPI/VREF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39305,6 +39507,60 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40072,19 +40328,19 @@ OSHW_LOGO - - - + + + - - - + + + - - + + @@ -40164,10 +40420,226 @@ OSHW_LOGO - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -40498,11 +40970,12 @@ OSHW_LOGO - - - + - + + + + @@ -40544,6 +41017,94 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40604,6 +41165,32 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40650,6 +41237,32 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -40942,16 +41555,6 @@ OSHW_LOGO - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -42049,13 +42621,6 @@ OSHW_LOGO - - - - - - - @@ -42143,6 +42708,30 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + @@ -42179,6 +42768,30 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + @@ -42234,6 +42847,400 @@ OSHW_LOGO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42860,8 +43867,8 @@ OSHW_LOGO - - + + @@ -42946,14 +43953,6 @@ OSHW_LOGO - - - - - - - - @@ -42976,6 +43975,14 @@ OSHW_LOGO + + + + + + + + @@ -43066,16 +44073,16 @@ OSHW_LOGO - - - diff --git a/stereo_mix/stereo_mix.cc b/stereo_mix/stereo_mix.cc index 54e7a10..cc1ea09 100644 --- a/stereo_mix/stereo_mix.cc +++ b/stereo_mix/stereo_mix.cc @@ -2,12 +2,14 @@ #include "avrlib/adc.h" #include "avrlib/avrlib.h" +#include "avrlib/boot.h" +#include "avrlib/deprecated/devices/input_array.h" #include "avrlib/devices/mcp492x.h" #include "avrlib/gpio.h" #include "avrlib/spi.h" #include "avrlib/watchdog_timer.h" - #include "stereo_mix/resources.h" +#include "avrlib/time.h" #define degToRad(angleInDegrees) ((angleInDegrees)*M_PI / 180.0) @@ -24,6 +26,9 @@ typedef SpiMaster, MSB_FIRST, 2> dac4Spi; typedef Dac Dac4; typedef AdcInputScanner AnalogInputs; +typedef InputArray Pots; + +Pots pots; #define NUM_CHANNELS 4 @@ -32,32 +37,54 @@ uint16_t pan[NUM_CHANNELS]; int main(void) { + Boot(true); Dac1::Init(); Dac2::Init(); Dac3::Init(); Dac4::Init(); - AnalogInputs::Init(); + pots.Init(); + //Adc::set_reference(ADC_DEFAULT); + //Adc::set_alignment(ADC_LEFT_ALIGNED); AnalogInputs::set_num_inputs(8); - while (true) { ResetWatchdog(); + Pots::Event event = pots.Read(); + if (event.event != EVENT_NONE) { + if (event.id < NUM_CHANNELS) { // volume pots + volume[event.id] = event.value; //pgm_read_word_near(lut_res_linear_to_exp + (event.value >> 6)); + } else { // pan pots + pan[event.id - NUM_CHANNELS] = event.value >> 6; + } + } else { + //volume[1] = 4095; + } AnalogInputs::Scan(); + /*AnalogInputs.Scan(); for (int i = 0; i < NUM_CHANNELS; i++) { - volume[i] = pgm_read_word_near(lut_res_linear_to_exp + AnalogInputs::Read(i)); + volume[i] = pgm_read_word_near(lut_res_linear_to_exp + (AnalogInputs.Read8(i) << 2)); if (volume[i] < 7) // some ADSRs dont seem to close completely, lets gate very low voltages... volume[i] = 0; - pan[i] = AnalogInputs::Read(i + NUM_CHANNELS); - } + pan[i] = AnalogInputs.Read8(i + NUM_CHANNELS) << 2; + }*/ - Dac1::Write(((uint32_t)(volume[0]) * pgm_read_word(lut_res_left_sin_pan + pan[0])) >> 8, 0); - Dac1::Write(((uint32_t)(volume[0]) * pgm_read_word(lut_res_right_cos_pan + pan[0])) >> 8, 1); - Dac2::Write(((uint32_t)(volume[1]) * pgm_read_word(lut_res_left_sin_pan + pan[1])) >> 8, 0); - Dac2::Write(((uint32_t)(volume[1]) * pgm_read_word(lut_res_right_cos_pan + pan[1])) >> 8, 1); - Dac3::Write(((uint32_t)(volume[2]) * pgm_read_word(lut_res_left_sin_pan + pan[2])) >> 8, 0); - Dac3::Write(((uint32_t)(volume[2]) * pgm_read_word(lut_res_right_cos_pan + pan[2])) >> 8, 1); - Dac4::Write(((uint32_t)(volume[3]) * pgm_read_word(lut_res_left_sin_pan + pan[3])) >> 8, 0); - Dac4::Write(((uint32_t)(volume[3]) * pgm_read_word(lut_res_right_cos_pan + pan[3])) >> 8, 1); + Dac1::Write(4095, 0); + Dac1::Write(4095, 1); + //Dac1::Write(((uint32_t)(volume[0]) * /*pgm_read_word_near(lut_res_left_sin_pan + */ (pan[0])) >> 8, 0); + //Dac1::Write(((uint32_t)(volume[0]) * /*pgm_read_word_near(lut_res_right_cos_pan +*/ (1024 - pan[0])) >> 8, 1); + Dac2::Write(volume[1] >> 4, 0); + Dac2::Write(volume[1] >> 4, 1); + //Dac2::Write(((uint32_t)(volume[1]) * /*pgm_read_word_near(lut_res_left_sin_pan + */ (pan[1])) >> 8, 0); + //Dac2::Write(((uint32_t)(volume[1]) * /*pgm_read_word_near(lut_res_right_cos_pan +*/ (1024 - pan[1])) >> 8, 1); + //Dac3::Write(((uint32_t)(volume[2]) * /*pgm_read_word_near(lut_res_left_sin_pan + */ (pan[2])) >> 8, 0); + //Dac3::Write(((uint32_t)(volume[2]) * /*pgm_read_word_near(lut_res_right_cos_pan +*/ (1024 - pan[2])) >> 8, 1); + //Dac4::Write(((uint32_t)(volume[3]) * /*pgm_read_word_near(lut_res_left_sin_pan + */ (pan[3])) >> 8, 0); + //Dac4::Write(((uint32_t)(volume[3]) * /*pgm_read_word_near(lut_res_right_cos_pan +*/ (1024 - pan[3])) >> 8, 1); } } + +TIMER_0_TICK { + TickSystemClock(); +} +