Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts

Sunday, June 24, 2012

BuildBrighton MIDI Workshop

We had a great time over the weekend at the BuildBrighton MIDI workshop.
Not only did we cover the basics of Arduino programming, but there was even time to go through some electronics fundamentals - switches, resistors, potentiometers, voltage dividers and more!

The afternoon session was pretty awesome - once we'd de-mystified the MIDI protocol (note on, note off messages plus some excellent midi-thru examples from Jason, creating chord builders and arpeggiators) we got down to the serious business of making some noise!


It'd be great to say we had a jam and made some music, but we didn't really get much further than making cool noises, chord changes and whooshing arpeggios. But everyone on the course came up with their own unique ideas for implementing MIDI. At the start of the day, the most ambitious idea was a keyboard synth clone or a midi drumkit.

After the workshop, people were talking about light-to-sound modules, interactive art installations - even MIDI Flip-Flops. That's what the workshop was really always about!


(Jason in action during the BuildBrighton MIDI workshop, untangling a rat's nest of wires)

Thursday, June 21, 2012

Arduino MIDI playground boards

In preparation for the BuildBrighton Midi Workshop this weekend, we've been busy etching and making up boards for the attendees to use with their Arduino microcontrollers.

These take the form of "shields" which sit on top of the main Arduino board.
Jason did a great job designing the circuit and PCB and Steve really made them look the business with his custom silkscreen/sticker job.

After etching and drilling, the stickers had to be carefully lined up. The easiest way to do this was to hold the board up against a bright light, and apply the sticker, taking care to get the pin holes shining through from the back into the correct places on the sticker front.


To make adding the components easier, we used a drawing pin to prick a small hole in the sticker at each point where a hole had been drilled on the PCB.  The end result was quite impressive!


After populating and soldering all the components onto the board(s) they're finally ready for testing before the big day. We wanted to make sure that we spent as much time as possible working around MIDI and actually creating something like an instrument, rather than lose half-a-day or more running a soldering workshop, so each lucky attendee will get a pre-made MIDI shield as part of their day's training.


Included on each board are
Opto-isolator (to conform with the MIDI specification)
4 x pushbuttons
8 x LEDs
1 x potentiometer (variable resistor)
1 x LDR (light dependent resistor)
1 x MIDI in DIN socket
1 x MIDI out DIN socket
Through headers to allow boards to be stacked on top of each other
1 x jumper to disconnect the LEDs to allow the digital output pins on the Arduino to be re-purposed

All in all, making the boards has been a lot of work, but we think they're worth it. They look really impressive when soldered up, and we're looking forward to seeing what ideas other people can come up with for them.


Friday, June 10, 2011

First mBed development

As a PIC developer, and member of BuildBrighton, I often get a bit of stick from the others who are avid Arduino fans. The very reason most people love Arduino is mostly the reason why I don't get along with it - it's not the C-based language or abstraction (both of which I already use quite extensively when writing Actionscript for Flash) but what really bothers me is the over-reliance on libraries.

When I write PIC code, I tend to pore over reams and reams of boring (and confusing) datasheets, try to understand what is going on inside that little black box of magic, and write code to make it do exactly what I want.

Arduino has become successful because of the massive community of people who write code for it and post the results as "libraries" that other users can simply download and include in their projects. That's great provided the code is well written in the first place. There are a lot of people successfully using Arduino for their projects who don't really understand a single line of code! But by plugging together a few different libraries, you can get a working prototype up and running fairly quickly.

Despite my prejudices towards library-based coding, the lure of an ARM7 processor with built-in ethernet was just too much! The mBed development kit I was sent seems perfect for building quick and easy prototypes with very little knowledge of the underlying hardware. I've never built an ethernet stack, nor would I know where to start, but the mBed website provides a number of libraries and examples showing how to build a working HTTP client (some code that runs on the microcontroller and retrieves web pages from a URL is all I was after!)

Now the gripe - it's been over a week since this little thing arrived through my letterbox and I set to working immediately on ideas to try out it's hardware features. Since I'd already got access to most of it's peripherals through the PIC 18F series, I concentrated on the one thing it trumped a PIC with - ethernet support.

Yet nearly a week later, and despite the supposedly simple copy-and-paste approach to coding with the mBed system, I've yet to make a working HTTP client!

I have the 2368 series board (which has an 60Mhz ARM7 onboard, later versions such as the 1768 have a Cortex-M3 CPU running at 100Mhz) but not one of the HTTP client examples from the mBed website works.
Some of the other guys at BuildBrighton use the 1768 type mBed kits and the code works first time for them - but on my board, it just keeps locking up. (Some of the other guys at BuildBrighton just laugh and say I need to get an Arduino with an ethernet shield, but pfffft.)

I've used the same RJ45 sockets as the others, tried to communicate over the same networks, connecting to the same routers/hubs and while their boards all return HTML data almost instantly, whenever my board hits a HTTP GET type command, it just locks up!

And so the point of this grumble - it's still relatively early days for the mBed system. Which means the community is still pretty small - and the support just isn't there yet. I've been posting to forums asking for assistance, but haven't yet had any reply that has proved useful (whenever anyone at the Skiff has an Arduino-type problem, they can post a question and expect half a dozen answers within a few hours!). And the major problem - for me at least - is that I have no idea of what is going on inside those libraries to get to the bottom of why it's not working: which is mostly due to the way a library-based development system works. With a PIC, you work at almost byte and bit level - you can see every register and find out what is going on at the tiniest level. With the mBed system (and similarly, Arduino) all the clever, tricky, brain-hurting stuff is hidden away inside a few APIs supposedly making these things really easy to work with. Which is fine, when the libraries are well written and work all the time. But when they don't and there's no support, there's nowhere left to turn. Except, perhaps, back to my PICs.....