|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Digital Line Level DACs, Digital Crossovers, Equalizers, etc. |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
|
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
Not sure if I'm in the correct part of the Forum, so please move if needed.
For my Twisted Pear Metronome ASRC I want to build an Arduino based IO expander to control the settings of the SRC4192. Main components will be the i2c isolator ADUM1250 and IO expander PCA9555. I attched an Eagle printout of a possible circuit. As I'm just a diy-er I would be grateful for some input before I order the parts. Some questions I have: - does the circuit look ok? Not that I expect you to read the datasheets for me of course (I tried) but perhaps you recognize the components and have some experience with them. - Can you suggest a better regulator? I need about 210 mA max and don't want to use a smd component and it should be as quiet as the regulator used on the Metronome (LP2985). - Is it ok to put the ADUM1250 on a browndog adapter? I have to give credit to diyaudio member GLT for all the info on his blog (H I F I D U I N O). This is where I learned a lot about the Arduino and found the suggestions for the ADUM1250 and PCA9555. Any help would be great. Thanks, Jeroen |
|
|
|
#2 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
And here a (not so good) pic of the test setup. I can read both the buttons and the appleremote. Time to hook it up to something...
|
|
|
|
#3 |
|
diyAudio Member
Join Date: Oct 2004
|
Hi, thanks for the credit :-). Apple remote huh? you must share the code!
At first sight, the circuit looks fine (but I have not implemented them myself). Regarding the regulator, you can't find anything with lower noise that is not smd. The lt1963 should be lower noise than that in the Metro.
__________________
www.hifiduino.wordpress.com |
|
|
|
#4 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
For the appleremote it was a bit hard to find the codes. From searching the web I sort of learned that it uses the NEC protocol; 9.5ms/4.5ms start pulse and then 4 bytes data. It seems that the third byte is the command and the fourth the appleremote id.
Below is the test code I used. The method is the same as on the HIFIDUINO log but now repeated 4 times to catch all four bytes. The lcd commands are just to show the results. // get ir key int getIRKey() { int duration=1; int result1=0; while((duration=pulseIn(IRPIN, HIGH, 100000)) < 4000 && duration!=0) { // wait for sequence } // get byte 1 int mask = 1; int test1 = 0; // get 8 bits for (int i = 0; i < 8; i++) { // get pulse length duration = pulseIn(IRPIN, HIGH, 1700); // get 1 and update bit if (duration > 1400) { result1 |= mask; test1++; } // shift mask to next bit mask <<= 1; } // get byte 2 int result2=0; mask = 1; int test2 = 0; // get 8 bits for (int i = 0; i < 8; i++) { // get pulse length duration = pulseIn(IRPIN, HIGH, 1700); // get 1 and update bit if (duration > 1400) { result2 |= mask; test2++; } // shift mask to next bit mask <<= 1; } // get byte 3 int result3=0; mask = 1; int test3 = 0; // get 8 bits for (int i = 0; i < 8; i++) { // get pulse length duration = pulseIn(IRPIN, HIGH, 1700); // get 1 and update bit if (duration > 1400) { result3 |= mask; test3++; } // shift mask to next bit mask <<= 1; } // get byte 4 int result4=0; mask = 1; int test4 = 0; // get 8 bits for (int i = 0; i < 8; i++) { // get pulse length duration = pulseIn(IRPIN, HIGH, 1700); // get 1 and update bit if (duration > 1400) { result4 |= mask; test4++; } // shift mask to next bit mask <<= 1; } lcd.clear(); lcd.setCursor(0,0); lcd.print(result1); lcd.setCursor(0,10); lcd.print(test1); lcd.setCursor(1,0); lcd.print(result2); lcd.setCursor(1,10); lcd.print(test2); lcd.setCursor(2,0); lcd.print(result3); lcd.setCursor(2,10); lcd.print(test3); lcd.setCursor(3,0); lcd.print(result4); lcd.setCursor(3,10); lcd.print(test4); return result3; } |
|
|
|
#5 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
Order placed at digikey. There is a leadtime though of a few weeks for the adum1250's...
|
|
|
|
#6 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
It works!!
![]() That is, I can control the red and green led with the apple remote... The pic is a bit vague but the lcd says "right" and the green led is on. Next is to find out how I can control the spdif input selector on the TP CS8416 receiver module before it goes onto print and into the DAC. Funny toy this Arduino. Jeroen |
|
|
|
#7 |
|
diyAudio Member
Join Date: Oct 2004
|
JeroenR, Nice work.
I've started to look at your code. (because I also want to use an Apple remote). According to the NEC protocol, the encoding is "pulse distance modulation" SB-Projects: IR remote control: NEC protocol That means that each pulse is 560 usec and you measure the distance between pulses. Your code counts as 1 if duration > 1400, but duration will never be > 1400 according to the NEC protocol. Can you explain further? Thanks.
__________________
www.hifiduino.wordpress.com |
|
|
|
#8 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
Thanks.
Take a look at Apple Remote Arduino shield - Hack a Day Above link also points too a library, in this case for sending, not receiving. A little quote from the library : "Notes: 1) Apple's remotes use the NEC IR protocol, which is better described here: SB-Projects: IR remote control: NEC protocol It uses a 38 kHz carrier wave ( hence the OscWrite call) and uses a "pulse distance" encoding. In other words, the LED is ON for the same amount of time - it is the duration OFF that matters. The protocol header is a 9ms on, followed by 4.5 ms off. A '1' value is .560 ms on, followed by 1.690 ms off. A '0' value is the same on pulse, followed by .565 ms off. The 'end' header is a .560 ms on pulse. 2) The total data transmitted is 32 bits. " It is some time ago but as the irpin as always high, should I then not be measuring the "off's" as high's? I'm writing this from work so I'm not too sure. And... the code is just test code that does work. It could be it works by accident. ![]() Jeroen |
|
|
|
#9 |
|
diyAudio Member
Join Date: Oct 2004
|
If that is the case, then it will work (after figuring out what to do at the byte boundaries). I'll have review and see how the ir receiver works :-)
__________________
www.hifiduino.wordpress.com |
|
|
|
#10 |
|
diyAudio Member
Join Date: Jan 2005
Location: Amersfoort
|
Here is the code I used in the last test.
Last edited by JeroenR; 6th May 2010 at 07:40 PM. Reason: forgot attachment... duh |
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dynamic Range Expander | systemerror909 | Everything Else | 12 | 25th March 2012 12:29 PM |
| Digital Range Expander / Compressor? | weinstro | Digital Source | 0 | 24th September 2007 05:00 PM |
| DIY Expander/Sampler??? | AudioAngel | Instruments and Amps | 10 | 16th November 2005 04:00 PM |
| Dynamic range expander | eRiCdWoNg | Everything Else | 1 | 30th December 2003 01:05 AM |
| Dynamic Range Expander | CarAudioMage | Everything Else | 0 | 26th October 2003 01:24 AM |
| New To Site? | Need Help? |
| Page generated in 0.11560 seconds (87.90% PHP - 12.10% MySQL) with 11 queries |