Print This Post Print This Post

No-Frills 6-Input Stereo Line Mixer

I wanted a small (physically) mixer to accept line signals that was both cheap and low-cost, for use as both an input expander for PC Soundcard input and also for general use in recording. Looking around the web reveals a whole host of designs, most of which are either over-blown, badly-designed or are just rubbish. My spec was simple and is as follows:

  • Flat frequency response 40-40,000Hz
  • Low Noise
  • Will run off a single polarity supply as low as 9 volts
  • Wide tolerance of input levels
  • Nominal Input Impedance ~1KΩ
  • Low cost

Normally this sort of thing is best realised with a few well-chosen low-noise op-amps, and this is the method chosen here. However, such an approach is somewhat boring, so I decided to give myself a little more practise at assembling SMD circuitry and implemented the design using SOIC op-amps. I realise that this puts off some who would otherwise be interested in building the project, so I’ve included the Eagle project, (see bottom of post for download) and it would be a simple matter to substitute the SMD op-amps with their ‘normal’ PDIP cousins if required, as there is plenty of room on the PCB. The circuit also lends itself to expansion (or contraction!) if required.

Construction complete and under test.

Construction complete and under test.

6-Input Stereo Line Mixer Schematic

6-Input Stereo Line Mixer Schematic

Schematic. In the schematic above I used 2 X TL074 for the input stages and power-supply splitter, and an LM833 for the output stages. The latter is what I had to hand, and a suitable substitution would be the TL072 (rather than the TL062 given on the schematic). Gain of the input stages is set to around 6, so that the application of a 600mv signal will result in about 3.5v output with a a given pot set to maximum – about as much as is possible with the low supply voltage.
The supply itself is split by a spare op-amp IC3D to give a common GND that is exactly half of the supply voltage, which should applied +ve to pin 1 on SV2, -ve to pin 3 on SV2. If you already have a split supply, then break the connection from the output (pin 14) of IC3D to the junction of the two 100nF capacitors, and connect GND directly to pin 2 of SV2. The two 10K resistors R36, R37 could in that case be removed.

Construction. I’ve used a mix of ‘normal’ through-hole design and SMD for the components. The ‘top’ of the PCB has the SMD op-amps, resistors and 100nF capacitors, whilst the ‘bottom’ of the board has the electrolytics and other components including the level controls. Be careful when you print the photograph from Eagle that you ‘mirror’ the output for the top foil. Also be aware that as shown in the photo above, the controls are mounted below the PCB and run from left to right. (Input to output) I fitted a 5mm LED in series with a 560 ohm resistor across the power supply as an indicator. I also fitted a 1N4001 diode (not shown on schematic) in series with the +ve supply input, to protect against inadvertent polarity reversal.

Line Mixer Top Foil

Line Mixer Top Foil

Line Mixer Bottom Foil or Links

Line Mixer Bottom Foil or Links

Line Mixer Components

Line Mixer Components

As you will see in the following, I am no expert in neat SMD assembly, although I did manage to get one or two of the 0603-sized resistors on the board at right-angles. However, it passes the first requirement – it works. The photos below were taken with my Agfa 2030 12Mp, no flash in closeup mode.

Close-up photo of IC1 circuitry

Close-up photo of IC1 circuitry

Close-up photo of IC2 circuitry

Close-up photo of IC2 circuitry

Close-up photo of IC3 circuitry

Close-up photo of IC3 circuitry

I left the choice of input and output socketry open. I was going to implement it with phono jacks on the PCB itself, but decided I wanted a 1/4 jack version as well, so didn’t bother.

Front and rear panel suggestions.

Front Panel suggestion

Front Panel suggestion

Rear panel suggestion

Rear panel suggestion

Components.
SMD resistors and Capacitors: A good way of getting a ’starter’ kit of these, is to buy one on eBay. There are several sellers there, and packs of several thousands of resistors and capacitors comprising the full ranges are available for a few pounds including postage.
LM833: Both RS Components and Farnell sell these. RS Components sell one priced at around £0.13 GBP each (in packets of 10)
TL074 and TL072: Again both suppliers above stock these common op-amps.
ESR, my friendly local electronics store, sell everything including PCB stock and chemicals, other than SMD components. They are reasonable in price, and there is no minimum order. They will also ship anywhere in the world. They can be reached here: http://www.esr.co.uk/
All pots are audio taper i.e. log taper.
All electrolytics are 16 volts. If you intend using a higher supply voltage, then these should be substituted for higher voltage items.
A full parts list can be obtained from the Eagle project. The student version of Eagle can be downloaded and installed free-of-charge.
Tools
You don’t need anything special here. SOIC op-amps are reasonably easy to solder. I use a headband magnifier, a good pair of fine-point tweezers and a 15 watt iron with a small chisel bit. Probably my biggest fault is ending up with too much solder on each joint – but I need more practice!

I do not sell components, but if I did, they would be Stella Artois – not Carlsberg!

Downloads
I’ve packed the Eagle project into a self-extracting EXE file (created with IExpress) here: http://joebrown.org.uk/LineMixer/LineMixerPCB.EXE
The front panels I used were designed using FrontDesigner, the project files are here: http://joebrown.org.uk/LineMixer/Line Mixer.FPL
and here: http://joebrown.org.uk/LineMixer/Line Mixer Back Panel.FPL

  • Share/Save/Bookmark
Print This Post Print This Post

Make a Yamaha Synth for less than £25.00

Introduction Specifications
First take a look at the specifications listed alongside. Look familiar? Well, to Waveblaster fans probably, as this is the spec. of the Yamaha DB50XG daughterboard, a phenomenally successful product in a long line of excellent audio/MIDI offerings by Yamaha.

For a while now, I’ve come across articles on using a second-hand DB50XG (or clone) as a stand-alone synthesizer, and last week, I took the plunge and ordered a board from Hong Kong via ebay. The supplier sent me an email saying delivery would take up to 20 days, actually it took 2 days. I drew up a schematic in Eagle, and made the whole unit, including a printed circuit board and separate power-supply yesterday. The result is now soak-testing on my bench.

What’s my first impressions? I’m blown away with the sheer quality of the sounds Yamaha have produced, and I’m only sorry I didn’t jump in earlier. In fact I’m thinking of building another, so as to run both in parallel for a really rich sound.
For once, this project contains no PIC and no software, and uses purely conventional components. (no SMD)

Links to the zipped Eagle project, and details of suppliers can be found at the foot of this post.

Tone Generation Method

AWM2 (Advanced Wave Memory 2)

Maximum Simultaneous Polyphony

32-note (last-note priority)

Multitimbral Capacity

16-Part (DVA : Dynamic Voice Allocation)

Internal Voice

Normal Voices

Total …………………………. 676

XG mode ………………….. 480

TG300B mode …………… 579

Drum Voices (Sets)

Total …………………………… 21

XG mode ……………………. 11

TG300B mode …………….. 10

Effects

Reverb (11 Types), Chorus (11 Types),

Variation (42 Types)

Power Consumption

2 W

Shown below is the near-completed synth. This clearly shows the Yamaha daughterboard, with it’s 26 pin header top right, plugged into the breakout-board I made. On the BOB, are mounted everything else except the power-supply, which was kept deliberately separate.

I mounted a small fan, underneath the DB50XG, and provided an exit vent for warm air beside the audio output sockets, thus ensuring that heat is drawn away from the unit, and from the heatsinks on the three regulators.

My almost-completed synthesizer.

My almost-completed synthesizer.

In the following schematic, you will notice that most of it is concerned with powering the daughterboard. I’ve provided on-board, sufficient to support the simple addition of a 12v-0-12v AC supply, and that of 7v-0. The DB50XG requires +12v, -12v at low current (~40ma) and a 5volt supply of at least 300ma. (my board drew 280ma)

You may prefer to use an existing supply, (or supplies) and omit if necessary some of the PSU components. In the spirit of keeping costs low, I re-used 3 unused ‘Wall Wart’ power supplies, by removing the innards from the plastic cases and refitting these carefully in a new box. Most of these units are not regulated and the two supplies I used for the 12v sources were slightly in excess of 16 volts – on load. The other supply was nominally rated at 9 volts and this too, was kicking out nearly 16 volts. Even with a small heatsink, I felt that this was asking a bit much of the 7805, so I fitted a 13 ohm 5 watt resistor (2 X 27 ohm 2.5watt resistors in parallell) in series with the +ve terminal.
Note that if you use a DC input (as I did) you should ensure that the +ve terminal from the negative voltage supply goes to GND, and the -ve terminal of the positive supply goes to GND. The 5 volt supply can be connected any which way how to the bridge rectifier, letting the diodes route the current correctly.

I added 3 LEDs to show that each supply was operative, and a reset switch both on-board and on the front panel.

I used a high-quality opto-isolator as interface to the TTL-level input of the DB50XG, and coupled the left and right-hand audio outputs out to the phono sockets via a couple of 270 ohm resistors. These should protect the output stages of the on-board op-amps in the event of shorting them to GND.

The small 12volt fan plugs onto one of the 12volt supplies – ensuring the the fan is pushing air into the box.

During testing and with the lid off, I used the unit without any heatsinking, the 7805 regulator got quite hot, the others moderately warm. The chips on board the DB50XG get warm also (the board dissipates 3 watts), so I strongly urge heatsinking the regulators and providing the fan, if the unit is to be in a closed box.

The DB50XG BOB Schematic

The DB50XG BOB Schematic

Below, close-up of populated BOB. On version 1.01 I’ve left more room on RH side for panel mounted reset switch. The small outlet vent top-right now has a small piece of steel gauze glued in place.

Close-up of populated BOB

Close-up of populated BOB

Another view of the unit.

Another view of the unit.

The completed unit in use.

The completed unit in use.

DB50XG BOB Component and link side.

DB50XG BOB Component and link side.

DB50XG BOB Foil Side

DB50XG BOB Foil Side

The zipped Eagle project files are here: http://joebrown.org.uk/images/DB50XG/DB50XG BOB.zip

ESR, my local friendly component suppliers can supply everything apart from the DB50XG. They offer a reasonable and speedy mail-order service, with no minimum quantity, and will ship anywhere in the world. ESR are here: http://www.esr.co.uk/

I got my DB50XG board on ebay, from double-fish1981 for $19.99 (US dollars – about £12.50) post free.
The following information can be found (at time of writing) on ebay:

This card is NEC XR385 midi card, which is an exact clone of the Yamaha DB60XG. The DB60XG is similar to the DB50XG.

Yamaha DB50XG/DB60XG Sound Daughter Board SW1000XG

FREE SHIPPING

  • Share/Save/Bookmark
Print This Post Print This Post

SFBV – The Water Is Wide

No excuses for adding this charming song about unrequited love – an all-too-familiar theme in my life!

The Water Is Wide – Anonymous

The song is available as a PDF download here: The Water Is Wide

If you haven’t got at least an Acrobat reader on your machine, then you won’t be able to see what is embedded below.

The sheet music follows:

And the Musescore project file is here: http://joebrown.org.uk/SFBV/WATRWIDE.mscz

  • Share/Save/Bookmark
Print This Post Print This Post

SFBV – The New York Trader

Instead of yet another coding session, I took the morning off, got a guitar and finally licked my transcription of this song into shape. It’s rarely heard these days, probably some people find the 5:4 time ‘challenging’. But I like it – a lot.
The original (anonymous) music I’ve amended slightly to fit in with the version I like best – that of Hedgehog Pie – think 70’s, think bell-bottoms, think flutes, think mutton-chop sideburns – hang on, here’s a pic!

I’ll be updating the relevant SFBV post, but thought I’d stick it here in the meantime.

BTW The time signature of this song reminded me of an old and dear friend, who sadly is no longer with us. Fred Atkinson was a brilliant musician, and worked most of his life playing and teaching piano. Fred had played in the ‘old’ days on local BBC programs such as workers playtime etc., etc., but in the time that I knew him, was working in a combo in Newcastle.

One night the band was asked to play Dave Brubeck’s ‘Take Five’, and to Fred’s dismay, because most of the guys he was playing with couldn’t cope with the 5:4 signature, they insisted on playing it in 4:4. He told me this story with all the disgust and contempt he could muster, and Mrs. Atkinson (Margaret) asked him to calm down and not to get too excited. Bless them both, I loved them.

Why am I telling you this? For f***s sake, don’t play or sing this song in 4:4!!!
JWBD4 3rd Aug 2010

The New York Trader – Anonymous

The song is available as a PDF download here: The New York Trader

If you haven’t got at least an Acrobat reader on your machine, then you won’t be able to see what is embedded below.

The sheet music follows:

And the Musescore project file is here: http://joebrown.org.uk/SFBV/new york trader.mscz

  • Share/Save/Bookmark
Print This Post Print This Post

While you were out…

It’s been a while – too long in fact, since I took a look at the stats for any of the sites I run. A complete change of emphasis about what is important and what is not has occurred since the ‘jump start’ in Hospital back in the early spring. Now I’m not complaining. I’ve been more settled mood-wise, than for many years, and it continues, with the odd hiccup, but you know what I mean.

The resolutions I made last year, to cut down on current projects, and curb my unstoppable desire for new ones have been abandoned, although quite a few projects have been completed. I try these days to spend more time with the guitar, and finally writing out properly, almost all the songs I like to sing (Songs For Broken Voices – on this site) I can practise these in a timely and organized way.

Today I took a glance at the stats for http://connectable.org.uk, thinking that as now I only update this only occasionally, interest would be down – it’s not. Already this year the site has had over 1.1 million hits, and that’s twice what it had last year at this time. http://joebrown.org.uk has improved also, with almost doubling of hits to nearly 0.5 million.

By far the most popular articles on connectable.org.uk are still the PIC USB designs, whilst on joebrown.org.uk the SFBV mentioned above, and the Stories remain very popular. Glancing at some referrers I notice one or two hard-core porn sites have pingbacks to a few of the stories!!

Talking of stories, my dropping one of my medications has resulted in a much shorter night, and the thought-engine performing as though on amyl nitrite, though I just as fast delete large sections of the story I’m currently working on, as add them, so progress is more variable.

Another mood-enhancer has been the ’summer’ – if I can describe what we get here in Newcastle as summer. But my love affair with light carries on mostly unhindered, apart from the really dull days – yes there have been some.

Now that things seem a little more settled, I’ve even been toying with the idea of finding myself a fun-loving baby-boomer girl again, to cuddle, amuse, entertain, and possibly even love. So watch this space.

BFN Joe 28 July 2010

  • Share/Save/Bookmark
Print This Post Print This Post

Photographs of Seaton-Sluice Beach & Newbiggin-by-the-sea

http://cullercoats.joebrown.org.uk/#22

These photos can also be seen here: http://cullercoats.joebrown.org.uk/#22.0

More photos at: http://cullercoats.joebrown.org.uk/#home

  • Share/Save/Bookmark
Print This Post Print This Post

SMD Printed Circuit Boards – How Hard Can It Be?

Well, er – sometimes very hard.
Producing a circuit board sucessfully, on a one-off basis, using ad-hoc methods and tools is manageable – up to a point. The amateur is faced with all of the variables that are simply factored out in mass-production – temperature, light, chemical strength etc., etc. This is all bad enough for what used to be ‘normal’ size technology – IC’s with pin-spacing at 0.1″ etc., but a whole new set of problems arises when things are scaled down and surface-mount components are to be used.
The easy part is drafting the schematic and drawing the circuit board on your PC. After that, it’s uphill all the way until the last solder joint short-circuit has been cleared, and it’s not hard to see why SMD is regarded by some, as yet another nail in the coffin marked ‘amateur electronics’.

I think this is a shame, so I’m going to indulge in some neck-stretching. No, I’m not an authority on photography, chemistry or any of the other ‘ys’ that are involved these days in PCB production, but I’ll describe my methods, which have met with some moderate success, in a bid to keep interest alive, and encourage those who are put off by SMD to give it a go.

First of all, there are no special tools required for SMD PCB production over and above what you already use successfully for other PCBs, with the possible exception of some serious magnification aids. I will show in this post that these need not be expensive if you are prepared to ‘hack’.

Nor are special boards or chemicals. What is required is a reasonably strict regime in the way that you go about the manufacture, make notes of the detail of your successes, and those of your failures, and hence learn by any mistakes.

Let’s start. You’ve drawn up your board – I’ll use a recent small header board as my example, shown exported from Eagle in the pic below. As an idea to scale, the pin headers are at 0.1 inch pitch.

PIC 18F6620 PCB Top Foil (Printed from Eagle)

PIC 18F6620 PCB Top Foil (Printed from Eagle)

I printed this foil pattern (in black) onto best quality (£0.10 per sheet) Laser Transluscent Film. I chose all the high quality graphics settings on my Samsung Laser printer, switched off toner saving and switched on ‘Darken’. I cut a piece of ‘economy’ (paper & fibreglass) FR4 board and exposed the board with the negative for 60 seconds in my light-box. This has 4 X 16watt Sylvania Black Light tubes, and is commercially made.

I developed the exposed board immediately in MEGA Electronics developer, made from SENO 4006 concentrate, mixed according to their instructions in the ratio 9 parts tap water to 1 part concentrate. This develops fast, faster and blazingly fast, depending on temperature, and how many boards you’ve already developed with it, and I’m always careful to under-develop, wash, inspect and re-immerse if necessary, rather than ruin by over-development. So far so good, but let’s stop there and rewind.

While you are fiddling about cutting the board, switch on your etch tank to warm up (if you’ve got one) or warm up your solution of ferric chloride in a teflon-coated pot. Prepare at least 2 jugs of water, and lay out your plastic dishes, one for develop, one for wash. It is also useful to have a bucket for waste water. A good way of seriously upsetting your significant other is doing ANY of this in the kitchen – find a spot that is well protected against the irreparable harm ferric chloride does to almost any surface.

Back to the story. If you are happy with the developed board, wash thoroughly then pop it into the ferric chloride solution. While it bubbles away, replace your wash water, and clear away your developer. Even with a bubble-tank, I find agitating by lifting the basket up and down frequently speeds up the process. When the board looks nearly finished, take it out and wash thoroughly, then inspect with an eyeglass, making sure that you aren’t over-etching. AT NO POINT during this process rub the surface of the board with ANYTHING. If you want to dry the board for inspection DAB it softly with soft paper.

Now, take a look at the pic above. The white perimeter ends up as a photo-resist area on the board. It is an excellent indicator of when things are cooked, or slightly over-cooked, because I etched my board fully, and the perimeter was almost all eaten away. When you are happy, wash well.

Now I had something that looked like the pic below. Note that the photo-resist is still on the board. Note also a short circuit just to the right of the six-pin header on the left-hand side. I corrected an over-generous width on both traces in my Eagle design, and cut the s/c with a sharp scalpel. Despite the odd ’suspicious-looking’ area, there are no other shorts on the board. (I buzzed it) There is a definite break on the 1st trace from the bottom of the board – probably a hair caused this, but it’s not serious. If the break was on one of the traces near the chip, it would be more problematic.

PIC 18F6620 Board after etching

PIC 18F6620 Board after etching

The next photo shows the board after I’d cleaned it with cellulose thinners. I DONT ’scrub’ the board as advised sometimes, as this inevitably leaves minescule bits of copper and photo-resist wedged into the track edges. The bright marks on the board show where I’d started to buzz it for shorts, and the scratches on the left show where I’ve cleared the s/c. I’ve also clipped the board to size and chamfered the corners.

PIC 18F6620 Board Resist removed.

PIC 18F6620 Board Resist removed.

Is that it? Well it could be, but I like to tin my boards, as it greatly eases soldering. I use MEGA Electronics Immerse Tin Powder mixed according to the instructions, with 90gm of powder to 1 litre of hot tap water, ensuring the solution is cooled before dipping the board. The finished, tinned board is shown below – now get it drilled and start soldering!

18F6620 Board - Tinned and ready to solder

18F6620 Board - Tinned and ready to solder

BTW All photos were taken with my hand-held Agfa 2030 in macro-mode, with no flash, in daylight next to a window. I reduced these down from 4000px square to roughly 800px in this post.

For those like me who are short of lamp-oil, some aid to visual inspection of the PCB is essential before, during and after soldering.
I use the 8X inspection magnifier pictured, made by Waltex, which will resolve down to less than 1/10 of 1mm. (pretty small) If you like a big picture then hack a half-decent web-cam to bits and mount the business end onto the top of the magnifier as shown. For really serious magnification, I have a similar arrangement mounted on a small cheap microscope.

Waltex X8 Magnifier

Waltex X8 Magnifier

Waltex X8 Magnifier with CCD (web-cam)

Waltex X8 Magnifier with CCD (web-cam)

And Finally…
Yeah – you guessed right. In creating the notes for this post, I deliberately walked through the whole procedure, making the test board as shown. Concentrating on capturing my actions, I forgot to produce a ‘mirror’ from Eagle for the Top (and only) track foil pattern of the board. The result? A board that is the mirror image of what was really wanted. Now this isn’t the 1st time I’ve done this, nor probably the last. In the past I’ve been known to bend back IC pins through 180 degrees and mount the chip upside down. How easy is that with SMD? Well very, actually, but it’s not so good when you have to mount the pin-headers on the ‘wrong’ side of the board. You have been warned!
The following (and last) pic shows the soldered and working wrong-way-round 18F6620 header plugged into my test-motherboard. (to which I’ve added pin header sockets to on the bottom of the board)

Brute-force and ignorance win the day! (Dont do this at home)

Brute-force and ignorance win the day! (Don't do this at home)

MEGA Electronics can be found here: http://www.megauk.com
ESR also stock everything mentioned, and their site is: http://www.esr.co.uk

  • Share/Save/Bookmark
Print This Post Print This Post

From The Throne Room – June 4th 2010 – F J Camm, where are you?

Because of my total inability to ‘do nothing’, whilst in the Throne Room, on my way I usually pick up at random, a magazine from my enormous stash of electronics mags from the past. Most of these magazines are now long extinct, and I’ve often mused as to the reason. The truth is there are probably several reasons, not the least being the attempts by Margaret Thatcher at social enginnering, in trying to turn us all into barrow-boy traders, instead of engineers – our real heritage and strength.

Leafing through the content of ‘Practical Electronics’ circa 1990 (I’ve been deliberately vague here to spare the author’s blushes) I came across the following drivel in an article entitled ‘Computers’:

“…blah, blah. To sum up then, machine code is ok for small programs up to 1K for a fixed purpose or where speed is essential, eg a fast computer game. Assemblers are used where timing is critical and an efficient code is required. High level languages are used where there are a lot of unskilled programmers or where a very large program is being written which might require constant or even drastic alterations.”

I’ve reproduced the above verbatim, including the several lexicographical omissions and errors. There are two important facts obvious from the above. The author hasn’t a (expletive deleted) clue what he’s talking about, and the editor of the magazine either dosn’t know either, or simply dosn’t care, or hasn’t actually had oversight of the article.

Sadly, this is only one example of the complete shite that abounds in today’s popular magazines, the further evidence of a dumbed-down, Blue-Peter approach to technology, and worse. That would-be young engineers are buying this rubbish naively expecting it to be both informative and accurate, neither of which is true anymore, is a crying shame.

The only proper destination for this stuff is to cut to size, and hang it on the nail – trouble is, even the paper is of poor quality, and would be far too scratchy for my delicate skin.

JWB 04 July 2010

  • Share/Save/Bookmark
Print This Post Print This Post

My New MIDI Merger uses 10 MIPS £1.00 PIC Microcontroller!

Updated 9th August 2010

Completed prototype MIDI Merger/Indicator

Completed prototype MIDI Merger/Indicator

This unit provides 4 autonomous MIDI inputs and 1 MIDI output. Note this is a ‘proper’ MIDI Merger – all 4 MIDI inputs can be used at the same time, unlike other ‘designs’. The unit also provides an indication of the channel number being played, and has shown itself to be capable of expansion into a full-blown controller.
The PIC microcontroller I used – 18F4320 was being sold off cheap, at £1.00 each by Crownhill Associates, in Ely – but don’t pester them for any 18F4320’s at this give-away price, as I bought the rest of their stock!
It’s always worthwhile to take a glance at their website, as inevitably they have PICs at discounts you wouldn’t find anywhere else. A purchase I made this week, was 5 PIC18F6620s – a 64-pin TQFP monster PIC – at only £2.00 per pop!

The intention here is to provide details of the schematic and photographs/advice on construction. The PIC code will be discussed more fully on http://picprojects.info.(shortly) All source-code is provided in this post, together with Eagle project files for the printed circuit boards.

The front panel on the prototype - I used Front Designer

The front panel on the prototype - I used 'Front Designer'

The schematic is below. Apart from the PIC and it’s crystal, the other main components are 4 6N138 opto-isolators, 5 on-board DIN sockets, a voltage regulator, and a few resistors. I mounted the LEDs on a separate interface/indicator board, and the schematic for this is shown later. The handful of pin headers are used to add a key matrix and FTDI USB-TTL lead, for upgrading the software, using an internal bootloader.

MIDI Merger/Indicator Schematic using PIC 18F4320

MIDI Merger/Indicator Schematic using PIC 18F4320

Following are some views of the PCB. Note these are not all to the same scale. The complete Eagle project for the PCB is available for download.

Component size of printed circuit board. (I mounted my LEDs on a separate board)

Component size of printed circuit board. (I mounted my LEDs on a separate board)

Printed circuit bottom foil pattern

Printed circuit bottom foil pattern

Midi Merger PCB top showing links (or top foil)

Midi Merger PCB top showing links (or top foil)

The assembled prototype, together with user-interface.

The assembled prototype, together with user-interface.

View of the unit before front panel fitted.

View of the unit before front panel fitted.

Rear view of unit showing MIDI sockets and DC power socket

Rear view of unit showing MIDI sockets and DC power socket

As shown in the main schematic, the unit functions as a MIDI-Merger and Indicator. With the addition of a keypad, extensions to this are easily added. I added the following, mainly because I find them useful.

  • MIDI Minimum volume (set on a channel-by-channel basis)
  • MIDI Channel re-assign – Re-assign any MIDI Channel to another
  • Filter-out unwanted MIDI commands – Get rid of those pesky pitch-wheel messages from your MIDI Guitar Unit!

The front panel I have shown above – I created a separate user-interface board that incorporated a 16-key matrix, and duplicated the reset switch and LEDs.
The 4 resistors are 10K in value and the capacitor is 100nF. I used small TACT switches and extra-bright 3mm LED’s. I used 2- double-row pin headers to connect everything to the main board.

MIDI Merger User Interface Board Schematic

MIDI Merger User Interface Board Schematic

MIDI Merger User Interface Board - component side

MIDI Merger User Interface Board - component side

The MIDI Merger User Interface foil pattern

The MIDI Merger User Interface foil pattern

The MIDI Merger User Interface links (or top foil)

The MIDI Merger User Interface links (or top foil)

Photo showing match between front panel template and User Interface board.

Photo showing match between front panel template and User Interface board.

Construction

I’m going to be bold here and tell you to forget buidling electronics in the way that instructions are given with a self-build electronics kit – you know the ones that start by telling you to stuff the board in the strict order: Diodes, Resistors, Pin Headers, Capacitors, blah blah. You will no doubt have experienced disappointment when the gizmo didn’t work, and there followed a long tedious trail of fault-finding.
My method of constructing Microcontroller projects was borne out of the experience of developing both the schematic and the software, making fault-finding a complete nightmare unless a simple procedure is followed – iterative development, or if you prefer it creep before you walk.
Take a look at the photo below – yeah there ain’t much on the board yet – but we know the PIC is working, because we’ve made an LED light up with it. Take a look at the ‘main’ procedure in any of my software and you will find a simple LED turn-on, just to give me confidence that the oscillator is working – (crystals can be destroyed with excessive heat when you solder them) and my program works.
But even before we get here, you should have buzzed out every pin on the PIC socket to it’s neighbour, looking for shorts, then switched on the unit with only the regulator installed, and tested that you get 5 volts where it should be and nowhere else.
Note too, that I’ve connected up an FTDI USB-TTL cable to the main UART on the PIC. The 1st thing I always program onto my PIC’s is a bootloader, and that will be sufficient for you to test that the PIC is working and load up your ‘real’ software when you are ready.

Add components in a logical sequence – functionality is the key. In the case of this board, adding a MIDI input stages components, buzzing for shorts then live test is the order of the day, before moving on to the next.
Also, if you have the bootloader installed, and the board connected to your development PC, if there are problems, comment-in/out relevant sections of code to ascertain that your hardware is working. The flash memory is good for 10,000 updates – I promise you, you won’t need this many!

Do a little at a time, then test, then another small step, then test -you got it?

Do a little at a time, then test, then another small step, then test -you got it?

Do (only) a little more, then test again.

Do (only) a little more, then test again.

Until its nearly complete.

Until it's nearly complete.

Oh, and there’s just one more thing – always start with a clean and uncluttered work-environment!

Always start with a clean and un-cluttered work environment.

Always start with a clean and un-cluttered work environment.

Below, I’ve posted an annotated waveform captured from the Merger whilst it was being developed. The Blue trace was captured with one probe of the ’scope on the collector of the opto-isolator darlington transistor. The red trace was generated by my code and was captured on PortB, bit 7.
BTW The picture is dumped direct from the PicoScope program. I annotated it using the excellent (and free) PhotoImpact 12, from ULEAD.
Also interesting is that the complete Note-On 3-byte sequence has been transmitted and received within 1ms – a credit to the UART on my keyboard (built in 2004 using a PIC16F876A), and the excellent response time of the INT0 edge interrupt on the 18F4320.

Waveform of MIDI sequence 0x92, 0x30, 0x7f and sample points.

Waveform of MIDI sequence 0x92, 0x30, 0x7f and sample points.

At the end of this post, I’ve given the part list for the main schematic generated from the Eagle project. A similar list can be generated for the User Interface board, so I won’t repeat this exercise. All parts, apart from the PIC, but including suitable PCB stock, are available from my favourite (and incredibly handy) electronics stockists ESR. Their prices are reasonable, there is no minimum quantity restrictions and they will deliver anywhere in the world. Their website is here: http://www.esr.co.uk

FTDI Shop sell the USB-TTL cables I use for uploading code to the PIC (and using TinyBld, debugging the code) These are available here: http://apple.clickandbuild.com/cnb/shop/ftdichip?op=catalogue-products-null&prodCategoryID=105&title=USB-TTL+0.1%94+Socket
Note that you should purchase the 5 volt version. (unless you are using the 3V3 low-power PIC)

The TinyBld PC PIC Bootloader is available free at: http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
and I’ve provided a modified Tinybld source file and MPLAB project specifically for this project as a zip here: TinyBld for PIC18F4320

Update: 9th August 2010: Added example Synth EDIT commands as follows: Program Change, SYSEX Select XG Mode, XG Bank Select
(see source-code for details of syntax etc.)
Release2 Source and project file are here: http://joebrown.org.uk/images/MIDI Merger/NewMIDIMergerRel2.zip
The original source-code and MPLAB project file are available here: MIDI Merger Project Files

The Eagle Project Files are here: MIDI Merger PCB Files

and I will post and date updates as they happen. Note you will need the C18 Microchip compiler to build the project. The free student version is perfectly adequate for this. The compiled hex file is included for those simply wishing to instal the firmware.

The source-code, with special emphasis on the implementation of the interrupt-driven software UARTs, will be discussed more fully at http://picprojects.info This will be done shortly.

The Front Designer project file is zipped here: Front Panel For MIDI Merger

An annotated hi-res Interface schematic is here: http://picprojects.info//MidiMergerInterface_Annotated.PNG showing links to port pins and resistors on the main board.
On this (and in the source-code) you will see that I have interfaced the key matrix as follows:

Columns (inputs)
Bit3 Bit2 Bit1 Bit0
RA5 RA4 RE1 RE0
Rows (outputs)
Bit3 Bit2 Bit1 Bit0
RE2 RC2 RC1 RC0

Which are the 2 pin headers next to the oscillator crystal.

Parts List for MIDI Merger/Indicator main schematic.

Part Value
   
B1 RB1A
C1 33p
C2 33p
C3 100n
C4 100n
C5 100n
C6 100n
C7 100n
C8 100n
C9 100n
C10 100n
C11 100n
C12 100n
C13 10uF
D1 1N4148
D2 1N4148
D3 1N4148
D4 1N4148
IC1 PIC18F4320 (see text)
IC2 7805
J1 2-pin 0.1″ pin header
J2 2-pin 0.1″ pin header
J3 2-pin 0.1″ pin header
J4 DCJ0202 DC power socket PCB mounting
LED1 LED3MM
LED2 LED3MM
LED3 LED3MM
LED4 LED3MM
LED5 LED3MM
LED6 LED3MM
LED7 LED3MM
LED8 LED3MM
LED9 LED3MM
LED10 LED3MM
LED11 LED3MM
LED12 LED3MM
LED13 LED3MM
LED14 LED3MM
LED15 LED3MM
LED16 LED3MM
LED17 LED3MM
OK1 6N138
OK2 6N138
OK3 6N138
OK4 6N138
Q1 10MHZ
R1 220
R2 220
R3 220
R4 10K
R5 220
R6 220
R7 220
R8 220
R9 220
R10 220
R11 220
R12 220
R13 220
R14 220
R15 220
R16 220
R17 220
R18 220
R19 220
R20 220
R21 220
R22 220
R23 220
R24 330
R25 330
R26 330
R27 220
R28 330
S2 Small TACT switch
SV1 MA05-1 5-pin 0.1″ pin-header
SV3 MA04-1 4-pin 0.1″ pin-header
SV4 MA04-1 4-pin 0.1″ pin-header
SV6 MA05-1 5-pin 0.1″ pin-header
SV7 MA06-1 6-pin 0.1″ pin-header
SV9 MA03-1 3-pin 0.1″ pin-header
X1 MAB5SH PCB DIN Socket 5-pin 180degs
X2 MAB5SH PCB DIN Socket 5-pin 180degs
X3 MAB5SH PCB DIN Socket 5-pin 180degs
X4 MAB5SH PCB DIN Socket 5-pin 180degs
X5 MAB5SH PCB DIN Socket 5-pin 180degs
  • Share/Save/Bookmark
Print This Post Print This Post

Astonished? I was not!

Warning. This post contains ranting and incompletely-redacted profanities. Read at your own risk.

Candidate for Prize For The Most Useless Product Of 2010

Candidate for Prize For The Most Useless Product Of 2010

Astonished I wasn’t. Despite a heavy-weight list of powerful agents contained in it’s formulation (non-ionic surfactants and perfume), this product failed to give satisfactory results in tests on my sink – in fact it was f**cking useless.

However there is mitigation. After several hours of testing on various surfaces to find any at all it would clean, I discovered it’s only just less effective than tepid water at removing green algae from my uPVC window-frames.

So – don’t throw out the vinegar and brown paper just yet.

Warning by WIKI. Some surfactants are known to taste good to animals, ecosystems and humans.
Interesting – I didn’t know ecosystems had taste buds – we live and learn, but best not let your dog lick the window-frames.

  • Share/Save/Bookmark