IO Expander for TP Metronome - diyAudio
Go Back   Home > Forums > Source & Line > Digital Line Level

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
Reply
 
Thread Tools Search this Thread
Old 3rd April 2010, 12:01 PM   #1
JeroenR is offline JeroenR  Netherlands
diyAudio Member
 
Join Date: Jan 2005
Location: Amersfoort
Default IO Expander for TP Metronome

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
Attached Images
File Type: jpg ioexpand.jpg (49.7 KB, 156 views)
  Reply With Quote
Old 3rd April 2010, 05:05 PM   #2
JeroenR is offline JeroenR  Netherlands
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...
Attached Images
File Type: jpg DSC01512.jpg (312.9 KB, 151 views)
  Reply With Quote
Old 4th April 2010, 07:32 AM   #3
glt is offline glt  United States
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
  Reply With Quote
Old 4th April 2010, 09:37 AM   #4
JeroenR is offline JeroenR  Netherlands
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;
}
  Reply With Quote
Old 6th April 2010, 09:19 PM   #5
JeroenR is offline JeroenR  Netherlands
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...
  Reply With Quote
Old 5th May 2010, 05:35 PM   #6
JeroenR is offline JeroenR  Netherlands
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
Attached Images
File Type: jpg DSC01575.jpg (381.9 KB, 110 views)
  Reply With Quote
Old 5th May 2010, 09:29 PM   #7
glt is offline glt  United States
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
  Reply With Quote
Old 6th May 2010, 09:52 AM   #8
JeroenR is offline JeroenR  Netherlands
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
  Reply With Quote
Old 6th May 2010, 05:19 PM   #9
glt is offline glt  United States
diyAudio Member
 
Join Date: Oct 2004
Quote:
Originally Posted by JeroenR View Post
Thanks.


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
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
  Reply With Quote
Old 6th May 2010, 08:39 PM   #10
JeroenR is offline JeroenR  Netherlands
diyAudio Member
 
Join Date: Jan 2005
Location: Amersfoort
Here is the code I used in the last test.
Attached Files
File Type: txt io_demo.txt (3.7 KB, 14 views)

Last edited by JeroenR; 6th May 2010 at 08:40 PM. Reason: forgot attachment... duh
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Range Expander systemerror909 Everything Else 16 31st May 2012 02:42 PM
Digital Range Expander / Compressor? weinstro Digital Source 0 24th September 2007 06:00 PM
DIY Expander/Sampler??? AudioAngel Instruments and Amps 10 16th November 2005 05:00 PM
Dynamic range expander eRiCdWoNg Everything Else 1 30th December 2003 02:05 AM
Dynamic Range Expander CarAudioMage Everything Else 0 26th October 2003 02:24 AM


New To Site? Need Help?

All times are GMT. The time now is 08:41 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2