Question about cogs, dacs and pins
Reinhard
Posts: 489
Suppose I have more cogs running. Everyone creates a different waveform. It is certainly allowed that I can output each waveform on the same dac/pin. Maybe that's a stupid question, but I want to be sure I won't break anything.
edit: what I mean is an addition from two or more waveforms in hardware.
Reinhard
edit: what I mean is an addition from two or more waveforms in hardware.
Reinhard
Comments
To mix two signals into a DAC, they would need to be summed before setting the DAC output value. You can use some locations in hub RAM for cogs to write their values into. The cog that sets the DAC would read and sum the valuea, then set the DAC.
I then just have to make sure that the individual samples are then added and output synchronously. This has something to do with the LOCK mechanism. I'll take a closer look at that.
Thank you.
maybe like an FPGA.
Here's result of 80MHz sysclock and 320MHz sysclock:
a piano octave on the keyboard, C ... C #, with mixer and filter effects.
Not as spectacular as Ahles mix / driver, but it's a completely different approach.
When you compile and load, you get this menu:
then you need an Osci on P0/P2 or change the pins .
Used the audio accessory on P6 and P7. Lol, a piano it isn't.
I note that -O2 creates a call to FCACHE_LOAD_ at the tone1() while loop, just after the audio init. There is an audible click so I figure the init occurs but the audio loop never seems to run. There is no tone.
EDIT: Oh, it might be the cordic optimising code, it seems to have dropped the GETQX instructions ...
Here's a more optimised arrangement. Note I've added a preceding GETQX, this is just precautionary clearing of any dead result catching of prior errant cordic op. It only handles a single op in the pipeline so isn't a perfect solution.
EDIT: Ha! -O2 optimisation eliminates that preceding GETQX. So much for precautions.
EDIT2: Thinking about it now, the preceding GETQX isn't likely to help in compiled code. It is a problem with buggy aborts from heavily pipelined hand crafted assembly.
Then no signals are generated.
if you then press 'a' on the keyboard, a frequency of 262 Hz is output on one channel.
At 's' -> 278 Hz etc. to 'k' -> 524 Hz. This is an octave on the scale. Something is only output on the other channel if the filter is switched on. The other two global frequencies are there for summation, which then results in a beat. I didn't use any optimization. and with --fixedreal there are no problems with the float constants either.