advertisement


Buffalo II - Assembly for the Electronically Bewildered.

Status
Not open for further replies.
Opps sorry guys, you can't help me when I type rubbish.

Yes I connected to the I2C bus NOT i2s

So far I have identified a few issues.

Operation of the encoder anti clockwise often crashes the Arduino
Clockwise sometimes crashes but not often.

There are known encoder issues, the Arduino is attaching an interrupt to the encoder, my crashes my be due to the interrupt calls. I had to debounce the encoder and button at 1/4 sec to get the button selection even looking like its working. I think normal debounce would be just a few mSecs.

The Arduino wont change its setting fields when standalone from the Sabre, this may be correct if it writes directly to the Sabre? There again it wont when connected to the Sabre.

My hooky Leonardo causes me to use an older version of the compiler, Arduino speak its IDE 1.0.0, The Leonardo support had been disabled from this version, I changed the IDE configuration to get Leonardo support. Also the firmware (bootloader) in my Leonardo has been super seeded.

What data I have found covering Arduino I2C connection shows a level converter being used. Buffalo I2C is 3v3 and most Arduino are 5v0. I just reconfigured my Leonardo for 3v3 on its board voltage selector, this may be giving me some problems. I have a level converter on order

Certainly the hooky Leonardo has caused me much trouble and a new one has been ordered.

This Arduino lark is real GOOD FUN though I have to say.
 
I've been doing this with a 3.3v Arduino and a Buffalo II with an S/PDIF multiplexor.

I'm guessing your problem is setting up the Sabre to suit the input arrangements of the Buffalo III. I can't help with the specifics because this is a problem I've put off till next week. There's quite a lot of implicit help in the hifiduino source.

I hacked up the original code quite comprehensively, changed the UI and set up input selection for the multiplexor. As it stood the remote really didn't work and the encoder reading was erratic. Now the remote is reliable and the encoder is tolerable as long as you don't spin it. Really it needs hardware debounce.

This is Robert's pic of it in bodgetastic action at Scalford,

DSC00539.jpg


Paul
 
Thanks Paul, my Leonardo usb driver has crapped out again, I know its flaky as some times I have to down load twice or more. Perhaps this is why Leonardo support was withdrawn for IDE 1.0.0.

I will start afresh next week when the new Leonardo arrives.

Tony

Yes it would be a good starting point to set the Sabre correctly but specific details seem scarce and I have not quite gelled with navigating Hifiduino but it is a great resource.

I my hack the code right back to just reading a simple Sabre register and then build back up. Probably reading the Sabre mute light is a good starting point as I can toggle the light at will by stopping and starting the s/pdif stream.

Definitely have problems with my encoder.
 
Well the genuine Leonardo has arrived and pushing the encoder now navigates the screen entry fields. Rotating the encoder has little effect other than crashing the Arduino. This all with no Buffalo I2C connection.

Next I added the spark fun level converter and this hangs the Arduino even without Buffalo connection.

So I ditched the level converter and connected the I2C directly, and had some activity.

The Buffalo stops outputting sound, but the Arduino changes from 'NoLock' to '44000' so I assume some two way control is happening.
Rotating the encoder now has no effect at all so not much chance of changing the settings.

The encoder is a cheap ebay that is just described as 20 position and has indeed 20 detents, that's all I know.

New encoder on order RS

Oh yes the Arduino volume automatically ramps following boot up, faster when not connected to the Buffalo, slower when connected, I expect its due to getting the I2C writes made.

I tried some variation in the encoder interrupt.

// attachInterrupt(0, rotEncoder, FALLING); // ISR for rotary encoder on pin 2

// attachInterrupt(0, rotEncoder, RISING); // ISR for rotary encoder on pin 2

// attachInterrupt(0, rotEncoder, HIGH); // ISR for rotary encoder on pin 2

// attachInterrupt(0, rotEncoder, LOW); // ISR for rotary encoder on pin 2

attachInterrupt(0, rotEncoder, CHANGE); // ISR for rotary encoder on pin 2 Original not working

Overall some success but no banana yet

Tony
 
Hi Tony B

Great posts and an interesting project and if it’s not working yet it soon will be I’m pretty sure of that.:cool:

Top marks for patience and endeavour.:D

You’ve got much further down the road than I would have.;)

Keep up the good work
 
Top marks for patience and endeavour.:D

Nah this is not paiience, now some years ago and my first regulator, that was patience :D

Thanks for the encouragement.

I think I just need to get the encoder working and prod the right settings into the DAC and I will have music.
If the worst comes to the worst I can hack the code back and still get some data out of the Buffalo and onto the screen but this Arduino is good fun and cheap also at £16

Tony
 
I was wondering if there was a difference between the Uno and the Leonardo that might explain your encoder problem. But I can't see one at a glance.

I used a Uno for development and a SparkFun 'Pro' in my DAC. They both behaved the same. I couldn't find a good way to do software debounce though. Mine only works reliably when turned relatively slowly, a 'spin' can cause it to get the direction wrong. The remote works OK though.

Paul
 
Well there does seem to be a difference between the Olimexino-32U4 Arduino Leonardo and the genuine Arduino Leonardo board.

The code works a lot better on the genuine board for some reason, but I do know the USB driver had been pulled for my first Olimexino board on IDE 1.0.0, so my method of re enabling the driver was perhaps not so clever.

With the genuine board I have a up to date USB driver for IDE 1.0.1

Regarding differences between Leonardo and Uno, I agree they seem the same other than the Leonardo has enhanced function with USB drivers to let the Leonardo emulate keyboard and mouse, and the I2C port has its own dedicated terminals rather than using the analog terminals that the Uno does.
This was one of my first mistakes as I wired the Leonardo I2C from the analog as the diagram but then discovered that there are dedicated terminals.

Spining my encoder has little efect other than causing a crash now and again. New encoder has just arrived and will

Tony
 
Well the new encoder is fitted, its eighteen pulses and eighteen dents so I understand this will be less problematic.

Still no control but....

I have found that I miss understood the volume control, its attenuation and I thought it was gain.

Turning the encoder when not in menu select can start to ramp the volume up or down depending on which way the encoder is turned. The encoder only needs turning a short while and the volume continues to ramp to either 99dB or 00dB.

Suddenly at around 40dB I heard gardeners question time :D:D:D
Whoopidooo.

Sound quality is crappy but it is sound.

It is not possible to change any other data items yet, turning the encoder when in menu select mode has no effect.

Anyway its another small leep...
Tony

EDIT

May have found a problem in so much as pin 2, the encoder interrupt pin is at 3v3 which is very odd as this board has all pins at 5v0 and not selectable. Also after taking pin 2 to ground with the encoder it stays at a few tenths of a volt even when the encoder is disconnected.

Also found some mention of Leonardo interrupt bugs
One listed here


Also found that my display likes a different back light potentiometer arrangement than shown in the standard picture. Mine is series connected in the 0v line and the display is brighter now.
 
I have the same setup as PaulR who has been very helpful (and patient). I have not yet connected it to my buffalo3. When i start it the figures come onto the screen but when i try to adjust in either direction and any speed then the figures turn to jibberish. I have not yet fitted a debounce.
Any ideas or different code would be most welcome.
Is it correct to drag all 6 files, one at a time into the sketch.
 
Which six files?
Maybe I missed something...

I used B10b from here

I think your encoder interrupt routine is perhaps continually firing, the jibberish could be all possible fields being displayed very quickly? It is a problem I had amongst many others all related to the pin 2 interrupt being naughty.
Try increasing the software de-bounce or changing

attachInterrupt(0, rotEncoder, CHANGE); // ISR for rotary encoder on pin 2

for either

attachInterrupt(0, rotEncoder, FALLING); // ISR for rotary encoder on pin 2

attachInterrupt(0, rotEncoder, RISING); // ISR for rotary encoder on pin 2

attachInterrupt(0, rotEncoder, HIGH); // ISR for rotary encoder on pin 2

attachInterrupt(0, rotEncoder, LOW); // ISR for rotary encoder on pin 2



My little saga continues.
I am sure my problem is the Leonardo now having stripped the code back to just the interrupt which either keeps interrupting for no input or does nothing at all, or drags my pin 2 down.
I even tried various examples of encoder interrupt that I found and non work, all other hardware removed and simulating the encoder with two simple switches.

Tony
 
Also make sure that your rot. encoder corresponds with the one GLT has specified.

I here have an encoder that gives two pulses/click instead of one pulse/click. At volume control is no big deal, but at menu control, it sometimes is a little challenging getting the desired result.
 
Yes I changed my encoder for 18 pulses and 18 clicks.
I also found the clicks did not align correctly between forward and reverse rotation.
Forward always gives both A and B pins open at rest. (the click position)
Reverse usually gives A and B pins made at rest, a tiny bit of pressure in the forward direction takes the state to off.

Tony
 
Phew what a box of crap this turned over.
First the hooky Leonardo had USB driver problems and would not use the latest compiler, the second genuine Leonardo had some interrupt problems, looks like its so new that it is yet to be fully developed.
Some problems along the way with the I2C level converter, I now drive the Buffalo-III I2C bus at 5 volts, its 5 volt tolerant so it seems.
My display back light is slightly different regarding its regulation compared to what diagrams are shown on the relevant forums as are its led supply terminals.
First encoder was crappy, second encoder has the right spec but a little intermittent alignment problem when rotating left but its good enough to use.
Both Leonardo's had occasional hangup problems at start-up.
Now got Arduino number three, a genuine Uno r3

A virtue of all this pile of pants is I got to understand a little of Arduino programing over the last few weeks and have come to terms with a good chunk of the code.


Guess what


I am as happy as a clam at high water.


Yep the little devil works a treat :D:D:D:D:D:D

Costs for this basic implementation are quite low (in the order of £40) if you happen on the right hardware :p

I don't propose to do a detailed 101 on Arduinoing the Buffalo-III unless some of you guys want to follow down this route.

Thanks to you guys who offered suggestions.
Oh and thanks to
GLT on HiFiDUINO
for making the code available, whomever you.



Next I have three Trident v3's to to compare to the v1s and the fleas, somehow I think more fleas will be called for, oh and that dual mono Buffalo.

Tony
 
Congrats! Very impressive troubleshooting. :cool:

I don't propose to do a detailed 101 on Arduinoing the Buffalo-III unless some of you guys want to follow down this route.

Yes, I would very much like to follow your lead! I've been wanting to Arduino for a while and have been thinking that it would be a great PFM thread. After all this effort, you deserve the credit and fame that only a PFM write-up can provide. ;)
 
Yes please write it up, I've got a buff 2 but I guess it's similar? It would be good to use with my mix as well. Does anyone know if that works? Oh and what about using a remote control with it?

Stefan
 
Status
Not open for further replies.


advertisement


Back
Top