micro-manager / mmCoreAndDevices

Micro-Manager's device control layer, written in C++
40 stars 108 forks source link

Arduino realize 4 analogue output with TLV56X8 #502

Open asincerity opened 2 weeks ago

asincerity commented 2 weeks ago

Hello, I noticed that arduin can be combined with TLV5618 to achieve two channels of analog output, but this is usually not enough. I found a TLV56X8 DAC module which supports outputting 4 analog outputs. Can I ask if this firmware can be supported with certain modifications to work with this module. Below is the circuit diagram of the TLV56X8, if this is possible this will fully utilize the capabilities of the arduino and be easy to use for researchers, thanks for being able to read this question.

da6a9677567df1fc8b65d1e4da0907e

asincerity commented 2 weeks ago

The channels of the four-channel DAC output signals are realized by CS1 and CS2, while in the recommended TLV5618, there is only one CS channel, and the channels are switched by the high and low voltages of this pin. So it seems that we only need to add in the Arduino script the switching of the channels by the level of CS1 and CS2, the original CS channel is connected to pin 5 of the Arduino, and now with four channels we can add CS2 to pin 6. Then we should need to add two DAC channels in the Arduino driver of the micromanager, and I can see that it can be easily done in the Arduino driver. I see in micromanager there is a dll file for arduino which should be the driver, but I don't have the knowledge and experience, is it easy to accomplish this?

Translated with DeepL.com (free version)

nicost commented 1 week ago

That looks like a very nice board. Regretfully, I do not see it for sale in the US, and also can not find more documentation about it. It does look like you need at least one extra digital pin to control that board. This will need some modifications to the Arduino firmware code and likely also (modest) changes to the Micro-Manager Arduino device adapter. Let us know how you progress!

asincerity commented 1 week ago

Yes, this requires an additional pin6 to control CS2. CS1 and CS2 to switch between the four channels. In fact, even with the same wiring as the recommended TLV5618 and only pin5 connected to CS1, the board's OUT1 and OUT2 analog outputs can be controlled by DAC1 and DAC2 in the micromanager. If pin5 is connected to CS2, it can realize the control of CS2. This means that we only need to add a pin6 control condition for channel selection when outputting analog signals in Arduino. At the same time, we need to add the corresponding DAC2 DAC3 in the Arduino device adapter. But I don't have the relevant knowledge, so I would like to ask the author of this firmware and adapter or other seniors. I would like to ask if you can implement these changes quickly or have some guidance? image