abbrev / tascam-rc-10-remote

TASCAM RC-10 remote control
15 stars 2 forks source link

trouble making this work #1

Open jonorthwash opened 4 years ago

jonorthwash commented 4 years ago

I'm having trouble getting my Tascam recorder to respond to signals as generated by this code, even when shifting the serial signal to 3.3V. I was wondering if @abbrev or others might have any insights.

I have the following configuration:

The next thing I plan to check whether there is an appropriate TTL signal coming from the TX pin. EDIT: I've now checked, another microcontroller reports receiving the following signals on sending record: 139, 203, 11; and the following signals on sending stop: 136, 200, 8. But (obviously, perhaps) only for 5V signals, not 3.3V signals.

Beyond that, my only guesses are, in order of likelihood, (1) that I'm not doing something right, (2) that there's a hardware compatibility issue, or (3) that there's a problem with the reverse engineering of the protocol. I'm also likely going to buy an actual RC-10 to verify that the recorder actually responds to signals from it.

In the meantime, I'd be interested in hearing from someone who has experience making this work. Does anything I'm doing stand out as wrong?

jonorthwash commented 4 years ago

I'm also curious whether those who've made forks (@0x4d0x44, @cleverfox, @skpsound) have had success with these command codes.

ghost commented 4 years ago

I planned to do this with my dr-40 but forgot about doing it eventually. So no success on my side. Now when you reminded me about that solution i will better buy rc-10, even when the price is hight for that piece of hardware. Got it in hand before, and it's similar to LED strip controller..maybe some hack is possible.

Good luck!

cleverfox commented 4 years ago

I made synchronizer with JVC camera based on stm32 for DR-40 and it worked well. If you interested I will upload it to github. It's easy to cut down cam era's LANC interface and add keys.

jonorthwash commented 4 years ago

@cleverfox, I'd be very interested in seeing that code. What I'm making is also for synchronisation of another device with my Tascam recorder.

jonorthwash commented 4 years ago

@cleverfox, did your microcontroller send a 5V or 3.3V signal to the DR-40?

cleverfox commented 4 years ago

@jonorthwash Stm32's i/o is 3.3v. As far as I remember I didn't add any level conversion schematic.

cleverfox commented 4 years ago

Here it is https://github.com/cleverfox/lanc_dr40_trigger.git It uses atomthreads and libopencm3 This project more like proof of concept, I used it few times, but it has no widely tested

@cleverfox, I'd be very interested in seeing that code. What I'm making is also for synchronisation of another device with my Tascam recorder.

psca11 commented 4 years ago

I was getting excited at the prospect of being able to remote trigger my DR-40 from an arduino for all sorts of uses. But your reports of trouble making this work are pouring a bit of cold water on my hopes :) From doing some googling, I found another blog on this topic: Parts 3 and 4 of this http://www.arduinoos.com/2018/11/tascam-sound-recorder-part-3/ are interesting - it describes some simple additional components to decouple the serial output signal of the arduino from the input of the DR-40. But I'm slightly struggling to understand why that's needed... presumably because it's not advisable to simply hook up the arduino tx pin straight to the tip connector of the 2.5mm input jack (and the arduino GND to the sleeve)? Also: In the above link, there's mention of the DR-40 having an internal pull-up resistor between the 3V (ring) and the Signal (tip). I think this means that by default the DR-40 is seeing HIGH (3V) on the signal input (when nothing is plugged into it).... and to me that would go some way to explaining why the author of the code talks about inverting the control signals such that arduino HIGH maps to DR-40 LOW (and vice versa). But they don't really go into enough detail to explain this fully!

So, I wonder, could the distinctly simpler-looking code in the GitHub project be used in the above blog context - i.e. could the two approaches be combined somehow? I ask this mainly because the blog post code is hard for me to decipher.... I'll probably get there eventually but it strays into some darker parts of arduino that I've yet to get my head around.

The physical electronic interface between arduino and DR-40 also puzzles me slightly - I sense a definite need to have something sitting between the two devices.... but quite what, I'm not sure.

Any thoughts welcome. I really really want to crack this! :)

psca11 commented 4 years ago

By the way I'm pretty certain the 5V out of the TX pin of the ardunio shouldn't be passed straight to the signal input (tip of 2.5mm jack)... that just feels wrong to me.

jonorthwash commented 4 years ago

Yeah, so I got an RC-10, found it "didn't work" with the DR-40. I also tried downstepping the 5V of my microcontroller to about 3.3V with a resistor bridge, and that didn't work either. And so I exchanged the DR-40 for a new one. On the new one, out of the box the RC-10 didn't work, so I investigated some and found the remote setting. The default is for a different remote and doesn't support the RC-10 or this code. I changed it to the RC-10 setting, and everything worked as intended, including my code (based on the code here) using the resistor bridge with my 5V microcontroller. In the end, I probably didn't have to make the exchange, but I now have no way of knowing.

psca11 commented 4 years ago

One thing I've just noticed: that blog author's code describes the bit definition for each control signal as follows (BS=button state, F=function) - clearly in this interpretation bit 7 is never used.


7 6 5 4 3 2 1 0
X BS BS F F F F F

But in our GitHub project, the BS bits are shifted leftwards by one: 10000000 11000000 00000000 (#define START_MASK 0x80

define REPEAT_MASK 0xC0

define END_MASK 0x00)

psca11 commented 4 years ago

@jonorthwash Can you shed a bit of light on your "resistor bridge"? My excitement is returning having read your reported success.

jonorthwash commented 4 years ago

by default the DR-40 is seeing HIGH (3V) on the signal input (when nothing is plugged into it)

This is actually how serial communication works, to my understanding. A constant 3.3V signal is 0, and when it goes to 0V, you get a 1. Test any serial connection you have available to confirm.

jonorthwash commented 4 years ago

@jonorthwash Can you shed a bit of light on your "resistor bridge"? My excitement is returning having read your reported success.

Sorry, the correct term is "voltage divider". See e.g. https://www.allaboutcircuits.com/tools/voltage-divider-calculator/. I used high-value resistors (>1MΩ).

psca11 commented 4 years ago

This is actually how serial communication works, to my understanding.

Happy to take your word for it. But presumably that means the Tx pin of the arduino is by default spitting out 3.3V, and if any data is sent out on it, the 1/HIGH bits appear on that pin as 0v?

If you're willing to share detail of how you hooked up your arduino to the actual 2.5mm jack I'd be very grateful.

psca11 commented 4 years ago

Ah forget my last comment @jonorthwash - I realise you described it all just fine right in your top-level post

jonorthwash commented 4 years ago

Happy to take your word for it. But presumably that means the Tx pin of the arduino is by default spitting out 3.3V, and if any data is sent out on it, the 1/HIGH bits appear on that pin as 0v?

Yes, exactly.

If you're willing to share detail of how you hooked up your arduino to the actual 2.5mm jack I'd be very grateful.

I don't have the exact pinout in front of me, but I found I only needed the RX and GND pins. I plan to post the whole circuit and code once I finish up the project—all that's really left are final touches (enclosure and cabling), but it's kind of on hold for the moment. But let me know if more details will help (and if so, which ones specifically).

jonorthwash commented 4 years ago

Btw, if you use an IC level shifter, the 3.3V line is helpful too.

jonorthwash commented 4 years ago

Ah forget my last comment @jonorthwash - I realise you described it all just fine right in your top-level post

Ah, indeed. Also note:

I am able to measure a 5V signal from TX when not writing, which I understand is normal for TTL.

psca11 commented 4 years ago

Thanks @jonorthwash Would I be correct to say that you using TX=>tip of jack and GND=> sleeve of jack (you wrote RX but maybe a typo?)? And as regards TX - from what you've said it seems you stepped down the 5V to 3.3V using a voltage divider (so 5V direct out of TX becomes 3.3V going to tip of jack)?

jonorthwash commented 4 years ago

Would I be correct to say that you using TX=>tip of jack and GND=> sleeve of jack (you wrote RX but maybe a typo?)?

Yes, this sounds right, and is consistent with what I wrote at the beginning. Again, I'm not looking at it, but can spend some time checking if it would help. (I didn't find anything wrong with my understanding of the pinout before getting it working).

And as regards TX - from what you've said it seems you stepped down the 5V to 3.3V using a voltage divider (so 5V direct out of TX becomes 3.3V going to tip of jack)?

Exactly.

psca11 commented 4 years ago

So, resistors to use for stepping 5v down to 3.3v ..... 2K2 + 3K3 ?

jonorthwash commented 4 years ago

So, resistors to use for stepping 5v down to 3.3v ..... 2K2 + 3K3 ?

That would probably work, yes, but I might start with higher values.

jonorthwash commented 4 years ago

So, resistors to use for stepping 5v down to 3.3v ..... 2K2 + 3K3 ?

That would probably work, yes, but I might start with higher values.

Better advice on what is best/ideal might be found on https://electronics.stackexchange.com/. I'd be interested in hearing if you find what sounds like a more definitive answer.