Excellent work and suggestion Neil.
Announcement
Collapse
No announcement yet.
Rotary Encoder question...
Collapse
X
-
-
Originally posted by neildavis View PostThe IR pin would allow you to control the volume "directly", without the long hold But the IR pin is more difficult, as it uses a 32-bit PPM stream to encode the key value.
I used the IR_protocol_analyzer software available here to look at the stream. It looks like there is a 15-bit header followed by 8-bit data and then the same 8-bit data "inverted", at a bit rate of 900Hz. It shouldn't be too hard to create the same stream with an Arduino micro. I've actually got all of the key codes figured out, but it would take some time to test the code and hook up a rotary encoder. But I still need to do an A/B test to make sure the audio quality is good enough to make the programming effort worthwhile.
I downloaded the IR protocol analyzer you suggested and confirmed that it uses the NEC 32-bit protocol. I connected an encoder to an arduino nano and wrote a quick sketch to read the encoder and then send the IR pulse sequence (IRremote library) for volume up and down via arduino pin 3 (pwm) to the IR pin on the audio board. I'm not getting a volume change on the board, so I need to verify that I have the correct hex code/raw data as well as make sure I have it connected correctly. Any suggestions?
Comment
-
Very good!. I just connected the "IR" pin to the input of my sound card and it read the data OK, but the program didn't convert it to digital data, and didn't recognize the format. But that makes sense because the IR pin is on the input side of the IR receiver, which demodulates the data from the carrier (usually 38KHz). Apparently the program works best with the modulated IR signal.
I converted all the timing values to bits myself, but I haven't gotten any further than that. The raw captured data for each key is in this zip file: http://www.audiodevelopers.com/temp/.../BMP_files.zip My preliminary conversion is in this Excel file: http://www.audiodevelopers.com/temp/...ma_remote.xlsx. Hope that helps...
Here is a tutorial on remote controls that I wrote many years ago. Maybe it will help: http://www.audiodevelopers.com/temp/Remote_Controls.ppt . This was from about 12 years ago, when I was decoding remote controls using 6801 assembly code.
Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe
Comment
-
BTW, I put an order in for a couple of 4-pin cables with 2mm pitch JST connectors. That way you can get power and ground for the Arduino CPU from that same connector. Digikey part number is 455-3155-ND. They are 12" long with female connectors on each end, so you can get two 6" single-ended cables from that part number.
Also: I just threw that speadsheet together rather quickly, and after looking at the NEC format again, I will be making changes (I only accounted for 31-bits, so that is one change...). But the information that you will need is there--just needs some minor corrections. What I labelled "Header" is actually the address field, and it needs to have both the 8-bit address and it's 2's complement. The data field should be correct, and I added up the data and its inversion for each key to make sure they added up to 255.
Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe
Comment
-
So, you guys are going about this by 'creatively piggybacking' where the input for the IR signal usually would go into the chip... so you can give it volume up/down prompts as though it were coming directly from the IR input... that's really creative.
Just trying to unravel the plot a bit so I understand... the thought is to write code somehow that will take a rotary encoders output to be converted so it will speak "IR volume up/down" language to the chip? Where is that code stored? Does it need a whole Arduino setup piggybacked with this, or can it be stored somehow on the existing chip? I thought that these little chips on these boards were pretty much ROM types... but then again, they remember where the volume is upon restart after shutdown, so that takes some type of RAM or whatever it would be called to 'store' the last state of the volume at least.
It is interesting watching this play out.
Many thanks for all the effort!
TomZZarbo Audio Projects Youtube Channel: https://www.youtube.com/channel/UCEZ...aFQSTl6NdOwgxQ * 320-641 Amp Review Youtube: https://youtu.be/ugjfcI5p6m0 *Veneering curves, seams, using heat-lock iron on method *Trimming veneer & tips *Curved Sides glue-up video
*Part 2 *Gluing multiple curved laminations of HDF
Comment
-
Originally posted by neildavis View Post.... This was from about 12 years ago, when I was decoding remote controls using 6801 assembly code.
Tom, you might find this interesting. For the amp filter equations, I had to re-learn mathematics I forgot from college in the late '70s. And to do that, I had to re-learn the precursor mathematics I forgot from high school in the mid '70s.
I gave up engineering 20 years ago. So Neil and SilverD will have to carry the torch on this ...
Comment
-
Originally posted by tomzarbo View PostSo, you guys are going about this by 'creatively piggybacking' where the input for the IR signal usually would go into the chip... so you can give it volume up/down prompts as though it were coming directly from the IR input... that's really creative.
Just trying to unravel the plot a bit so I understand... the thought is to write code somehow that will take a rotary encoders output to be converted so it will speak "IR volume up/down" language to the chip? Where is that code stored?
Does it need a whole Arduino setup piggybacked with this, or can it be stored somehow on the existing chip? I thought that these little chips on these boards were pretty much ROM types... but then again, they remember where the volume is upon restart after shutdown, so that takes some type of RAM or whatever it would be called to 'store' the last state of the volume at least.
Update: That USB port on the decoder board can be used to reprogram the device. The development kit has the programming tools and all of software, so that would be the really creative way to add more functionality. But that effort would be formidable, because the older code that I have looked at is not easy to follow, and there are a lot of missing pieces of information about the chip that might make code changes difficult. Also, there are almost no comments in the code about how it works. It's modular and is done by a skilled coder, but very hard to understand.Last edited by neildavis; 01-22-2020, 08:47 AM.Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe
Comment
-
Okay, I understand a little better how the process works. Thanks for filling in the details for me.
I'm no master of mathematics. I did take some college math for my Master's degree, but my wife had to help me understand how to do lots of it. That was 5-6 years ago, and I wouldn't like to try and reintroduce myself with that stuff, let alone stuff from high school. Me and math are like oil and water.
I just think you guys have been doing this higher-level stuff so long that maybe you don't realize how impressive it is to 'normal' non-engineer people that a 'person' can even figure this stuff out. I enjoyed programming in BASIC a little bit when I was a youth, but just for fun and nothing too crazy... Like I made little chickens walk back and forth on the screen of my little pocket-sized Tandy computer and later my TI994A, that kind of stuff.
TomZ
Zarbo Audio Projects Youtube Channel: https://www.youtube.com/channel/UCEZ...aFQSTl6NdOwgxQ * 320-641 Amp Review Youtube: https://youtu.be/ugjfcI5p6m0 *Veneering curves, seams, using heat-lock iron on method *Trimming veneer & tips *Curved Sides glue-up video
*Part 2 *Gluing multiple curved laminations of HDF
Comment
-
[QUOTE=tomzarbo;n1429998]Okay, I understand a little better how the process works. Thanks for filling in the details for me.
I'm no master of mathematics. I did take some college math for my Master's degree, but my wife had to help me understand how to do lots of it. That was 5-6 years ago, and I wouldn't like to try and reintroduce myself with that stuff, let alone stuff from high school. Me and math are like oil and water.
I just think you guys have been doing this higher-level stuff so long that maybe you don't realize how impressive it is to 'normal' non-engineer people that a 'person' can even figure this stuff out. I enjoyed programming in BASIC a little bit when I was a youth, but just for fun and nothing too crazy... Like I made little chickens walk back and forth on the screen of my little pocket-sized Tandy computer and later my TI994A, that kind of stuff.
TomZ
Closest I ever came to that, Tom, was to play a video game! And my math was prior to 1966!
Comment
-
Two updates to this thread.
First, I wired up a switch to allow comparing a high quality signal directly versus going through the encoder's line in A/D and output D/A. You can tell a difference, and the switch position that bypasses the encoder sounds more "alive", or clearer, or better...pick your adjective. But it wasn't an overwhelming difference, and there wasn't that much fidelity lost for a table radio or PC speaker application. I wouldn't pass the signal through the encoder for high-end applications, but if you are happy with SBC Bluetooth, it's an acceptable solution. I think that most people would find the losses through the decoder board to be OK.
Second, I got the remote control code working. I used a teensy 3.5 board that I had laying around to connect to a hex keypad (remember those?). I used the Arduino keypad library to scan the switches and return the remote control data that I needed to send to the decoder board through the IR pin. I could have used a rotary encoder or even a Bluetooth connection to read codes from a cell phone app, but I'll leave that fun for somebody else--I just wanted to make sure the IR pin was a viable way to control the board. And, it is working fine--I've got all of the main functions from the remote mapped to my keypad (my keypad only has 19 switches and the remote has 24, so a couple of the keys aren't mapped). The remote control codes and Arduino code to send the data to the decoder board are at this link.Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe
Comment
-
Just wanted to update this thread with some new information I found on the sellers site. This information is not from the seller himself, but from a buyer who worked out a few of these values on his own I suppose. Take with a grain of salt....
Add keys circuit key and GND through resistor: next-24k, pre-36k, play-22R, mode-51k, eq-16k, rep-4k7, rec-200k, mic-2k2
I don't see any values for volume up/down anyway which is what I was hoping for, but it may help someone who wants to mess with this on a deeper level.
Also, another bit of info for potentially triggering an amp... which seems obvious, but none of these seem to include...
Question: Is there any voltage output for relay switch? Also, for what is master volume encoder connection? for simple log potentiometer resistor?
Customer answer: There is no, but you can use the low -driven really connected to the left (near USB socket) LED backlight. it works.
This is also unconfirmed info. In the past I've used a physical switch for the amp, and just used the preamp on/off to power that.
Just wanted to post this for future reference.
TomZZarbo Audio Projects Youtube Channel: https://www.youtube.com/channel/UCEZ...aFQSTl6NdOwgxQ * 320-641 Amp Review Youtube: https://youtu.be/ugjfcI5p6m0 *Veneering curves, seams, using heat-lock iron on method *Trimming veneer & tips *Curved Sides glue-up video
*Part 2 *Gluing multiple curved laminations of HDF
Comment
Comment