electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Arduino
Another MIDI-to-CV interface
Post new topic   Reply to topic
Page 1 of 2 [34 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Mon Oct 27, 2014 1:29 pm    Post subject: Another MIDI-to-CV interface Reply with quote  Mark this post and the followings unread

I've started designing my own MIDI-to-CV-interface for the modular I'm building.

I decided to roll my own, partly because I already had parts around that weren't incorporated in existing designs and I wanted to be able to expand the functionality easily.

On top of that, it was a chance to get acquainted with Arduino development, of which I had no prior experience.

I have very little experience with electronics design; I do have a basic understanding of circuits, common components, what they do and how they operate. I've been wading through tons of documentation, datasheets, asking friends who work in the field as well as fellow DIYers and makers, and I think I'm on the right track so far.

My design, which I've named the MegaVolt Wink, is based around the ATmega328 uC, an MCP4822 dual 12-bit DAC and a TL072 dual op-amp.

The DAC feeds CV into the op-amp which in turn buffers and amplifies it to a 0-8V range for 1V/oct tracking over several octaves. So far I've been able to calibrate it quite perfectly in software but I haven't actually hooked the thing up to any gear yet, so I'm uncertain how it will behave once I get there.

Posted Image, might have been reduced in size. Click Image to view fullscreen.

My hope is to avoid any need for analog trimming and rely entirely on software calibration; one thought I had was that one could hook the DAC up to an input on the uC and do an actual tuning pass, like you tune an analogue oscillator. It might be overkill, but if it turns out the conversion is too non-linear for some reason it's an option I might explore.

The two gate outputs are taken from the 328's digital ports through a pair of transistors in order to minimize current draw on the uC. There should be a software setting for different gate behaviour.

I've been considering what other outputs and features to include, right now it's pretty barebones with two CV outs and two gates, but there's also the possibility of a velocity output, in which case I might need a second TL072 or TL071 to handle buffering/amplification.

I've written a small C++ library to interface with the 48x2 DACs; it's bitdepth-agnostic and should work as well with 8-, 10- and 12-bit DACs. It uses an internal resolution of 16 bits and a simple dithering algorithm to increase the perceived resolution of the output. I have no idea how well it will work in practice, but I wanted a way to represent pitchbend more accurately since it's a 14-bit MIDI block. I'm uncertain if the resolution will be enough, otherwise there exists the possibility of using two DACs in parallel, one handling the more significant byte and the other the least significant.

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Anyway, still a lot of speculation and throwing around ideas. My next step is to incorporate the second channel of the TL072 - I've only been using one for testing so far - and to hook up some MIDI equipment through an optocoupler and start handling input. Where I go from there depends on what I need and/or feel like doing. Wink

I'd love some feedback from more experienced people, especially about my circuit design. I'm extremely uncertain about most of it, but I'm at least confident enough that I dare to post it here.

Posted Image, might have been reduced in size. Click Image to view fullscreen.

What I'm most concerned with - and most unsure about - is stuff like short-circuit protection, over-current protection resistors or diodes, etc. I want this thing to be safe to plug things into, I especially don't want to burn out my entire modular system because I forgot some stupid detail.

Cheers!

-- Andy
Back to top
View user's profile Send private message
DUBmatze



Joined: Feb 18, 2013
Posts: 150
Location: south Germaica (schwabilon)

PostPosted: Wed Oct 29, 2014 3:59 pm    Post subject: Re: Another MIDI-to-CV interface Reply with quote  Mark this post and the followings unread

oh nobody is replying ??

drakfluga wrote:
I'd love some feedback from more experienced people, especially about my circuit design.
ups that isnt me .... Wink
drakfluga wrote:
What I'm most concerned with - and most unsure about - is stuff like short-circuit protection, over-current protection resistors or diodes, etc. I want this thing to be safe to plug things into, I especially don't want to burn out my entire modular system because I forgot some stupid detail.
you got the 1k Resistors at the output i think this is the max you can do...

is this working with the 6N135? my tests with a 6N135 didnt work... and i switch to a 6N139.

i thinking about few things when i look at your schem:

maybe you can use just cmos inverters or buffers instead the transistors at the output (so you can use one of the left gates to make a midi thru - or two).

it could be very usefull to add isp headers. (but you sharing some pins with the dac. maybe you need a jumper here)

i woud use each free output Pin of the ATmega to make an gate from it. (listen to a note of a other midichannel) for drum triggering.

Verry nice and professional looking project. i realy like it.
Back to top
View user's profile Send private message Visit poster's website
elmegil



Joined: Mar 20, 2012
Posts: 2177
Location: Chicago
Audio files: 16

PostPosted: Wed Oct 29, 2014 9:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

Diodes on inputs are also good protection, but I don't know the particulars of how that is designed, unfortunately. There are lots of examples in Thomas Henry's work though.
Back to top
View user's profile Send private message
jbeuckm



Joined: Nov 30, 2008
Posts: 165
Location: Stockholm
Audio files: 9

PostPosted: Thu Oct 30, 2014 8:12 am    Post subject: Reply with quote  Mark this post and the followings unread

Great to see this - I have been working on a very similar design with 4822's.

@DUBmatze Could you just run the TTL into CMOS buffers to send the gates to the +12v rail? For instance, Craig Anderton's Hip Bass Drum suggests that a 10V trigger is better than 5V.

Other gate thought: I'm considering to add a latched demux to get lots of programmable gates and triggers going.
Back to top
View user's profile Send private message
DUBmatze



Joined: Feb 18, 2013
Posts: 150
Location: south Germaica (schwabilon)

PostPosted: Thu Oct 30, 2014 12:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

jbeuckm wrote:
@DUBmatze Could you just run the TTL into CMOS buffers to send the gates to the +12v rail? For instance, Craig Anderton's Hip Bass Drum suggests that a 10V trigger is better than 5V.
i think thats not possible. i think you have to use 2 Transistors at the output. there is a cmos chip for level up/down shifting: 4504. but i never got a hand on it...
Back to top
View user's profile Send private message Visit poster's website
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Sat Nov 01, 2014 5:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Hey, thanks for the replies! Great to see some interest, and I appreciate the input. Smile

I've been geeking out over the software mostly for a few days, been learning Arduino and getting back into C++ after a few years of Lua and Python. It feels so archaic somehow but still nice to brush up on my (admittedly pretty lame) coder skills. Smile

I went a little overboard with the whole concept of digital control, so I attached an LCD and started designing software to allow for setting stuff like MIDI channel, MIDI CC, CV adjustment, gate mode etc. It might be a bit over the top, but I'm having too much fun to be bothered with what's practical. Very Happy

Here's a concept image of the module, made to match my dotcom-inspired modular system:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

LEFT and RIGHT are buttons to change pages, each page has one setting which is controlled with the ADJUST pot. I've designed two versions of the module, one with 4 CV outs and one with 2. The 4-out version is called the GigaVolt, of course. Very Happy

I'm still figuring out what else to add to this bigger version, but I think I'll perfect the smaller one first and move on to the bigger one later. I'd rather finish something than taking on too much and just giving up.

I read up on the 6N136:s and they're apparently too low gain to use with MIDI, although I haven't actually hooked it up yet. I will attempt to remedy that with a transistor on the breadboard. I've already ordered some 138:s to replace it with on the PCB. The software is pretty much ready for testing now, so I'm going to try hooking up the MIDI equipment tonight and see if I can get some results out of this!

Cheers!
Back to top
View user's profile Send private message
jbeuckm



Joined: Nov 30, 2008
Posts: 165
Location: Stockholm
Audio files: 9

PostPosted: Sat Nov 01, 2014 8:00 am    Post subject: Reply with quote  Mark this post and the followings unread

@drakfluga LCD would be a great addition. Keep us updated on your v1 progress.

@DUBmatze The CMOS idea might add too much conversion circuitry. What about a cheapo quad op amp setup as non-inverting with gain=2? That seems like a convenient way to get ~10V low impedence gate signal from a TTL output.
Back to top
View user's profile Send private message
DUBmatze



Joined: Feb 18, 2013
Posts: 150
Location: south Germaica (schwabilon)

PostPosted: Sat Nov 01, 2014 10:38 am    Post subject: Reply with quote  Mark this post and the followings unread

jbeuckm wrote:
@DUBmatze The CMOS idea might add too much conversion circuitry. What about a cheapo quad op amp setup as non-inverting with gain=2? That seems like a convenient way to get ~10V low impedence gate signal from a TTL output.
a OP Amp will also be cool ...
i was only thinking 'bout the cmos buffers or inverters because it is so easy to make a midi thru from it and it can replace the buffer transistors in the original design:
Posted Image, might have been reduced in size. Click Image to view fullscreen.

adding a display isnt nessesary i think. (imho) i know other midi cv projects that configured with the first note send to it (lowest note, so no CV offset is needed / and the midi channel) so you only need a reset button... Wink just keep it simple... hehe
Back to top
View user's profile Send private message Visit poster's website
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Wed Nov 05, 2014 1:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hey!

Moving forward with the software, I'm currently building a dynamic data-driven configuration system so I can easily add inputs and outputs with a single line of code.

That way the software will be able to drive a completely modular design (as far as the ATmega can handle in terms of CPU power, at least). In other words, I'll be able to add outputs, gates etc at will, and expand the hardware design without major changes to the software. Smile

As for the hardware, I tried to use the 6N136 for MIDI input coupled with an amplifying tranny on the out. It worked, but it read a lot of gibberish commands so I ordered som 6N138:s and plugged one into the board instead. I still get some noise, but I suspect that's because of the breadboard and wiring which isn't exactly clean.

Once I have all the major components in place I'll design a PCB and assemble a prototype board. What's missing now is the gates and some LEDs. I've got one shift register hooked up to the LCD so I'm thinking of putting another one on LED and gate duty. I'm not sure how much overhead that means compared to direct port control, as I'm slightly afraid that I won't have enough CPU time to handle MIDI-CV conversion efficiently.

I might just go with putting the gates on the regular digital outputs of the ATmega. I'll run out of ports faster, but it will be slightly more efficient in terms of CPU usage.

And speaking of the gates, I'm not sure I understand why you thought it would be a bad idea to use transistors for buffering and amplification? I'm still not sure I understand the distinction in a buffer amplifier application. If the point is to simply amplify the incoming voltage and decouple power draw from the uC, isn't a tranny what I should be using?

So, are the 3904s on the gate outputs a bad idea? I could easily go with a TL072 or '074 instead for a dual or quad gate setup. It might even save some PCB space, come to think of it.

Anyway, work goes on. I'll post again soon, and thanks for showing an interest! Smile
Back to top
View user's profile Send private message
DUBmatze



Joined: Feb 18, 2013
Posts: 150
Location: south Germaica (schwabilon)

PostPosted: Tue Dec 02, 2014 12:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

drakfluga wrote:
And speaking of the gates, I'm not sure I understand why you thought it would be a bad idea to use transistors for buffering and amplification?
ups ... sorry i totaly missed your reply here. there is nothing wrong with transistors at the output. my sugestion was when u need a buffer ic for making a midi out you can also use that for the gate outs. (i always have the part cound in mind and the transistor and me is not the best story Wink ). I use nothing else but a 1k resistor on my ATmega328 on the outputs and i never killed a ATmega so far...
Back to top
View user's profile Send private message Visit poster's website
jbeuckm



Joined: Nov 30, 2008
Posts: 165
Location: Stockholm
Audio files: 9

PostPosted: Wed Mar 18, 2015 9:02 pm    Post subject: Arduino 4822 HOT TIP! Reply with quote  Mark this post and the followings unread

I just made some great progress on my arduino+4822 converter. I am working on four note polyphony and am using the 4922 code from here:

http://www.alhin.de/arduino/forums.html?n=8

The original uses delay(1) for each clock when sending data to the DAC. That means lots of milliseconds between the notes of my chords Sad But the 4822 datasheet lists the communication clock cycle in nanoseconds. So you can just change to delayMicroseconds(1) and it works great. MIDI timing is way better and I got pitchbend to work smoothly.

https://github.com/jbeuckm/atmega_midi_cv_polysynth
Back to top
View user's profile Send private message
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Sat Oct 29, 2016 6:03 am    Post subject: Reply with quote  Mark this post and the followings unread

Wow I had forgotten about this thread! It's been two years, and I shelved the project for a while, but am now up and running again!

I've been streaming development of the Megavolt on Twitch for the past few weeks, on tuesdays I have a segment on my stream called Tinker Tuesday where I do electronics stuff and coding etc. You're very welcome to check it at twitch.tv/andynatory Smile

The latest prototype of the PCB is now feature complete and I'm moving on to firmware development.

The design is pretty much as I left it two years ago, with some minor changes and additions. I'm probably going to move the gate trannies to the +15V rail, they're currently sourcing from +5V which goes through a regulator and I think that it might be a bit wasteful.

I'm also considering adding a second DAC for 4xCV and replacing the trannies with a TL074 for 4 gate outputs, all assignable in software of course.

Last night I hooked up the interface to my YuSynth VCO for the first time and had the greatest YUSS-moment in a long time when it turned out to track perfectly and the 1V/oct output was perfectly linear across 8 octaves without any drift or weird notes!

I'll be posting some pictures and more detailed info later. Right now I need to take the kids to a halloween party. Very Happy

Feels good to be back to this project, it's been a great learning experience and it's turning out a treat!

Cheers,
Andy
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Sun Oct 30, 2016 6:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

I recently started an Arduino project also. It started out just a clock to drive my turing machine module, but thinking of also adding LFO, sequencer and maybe MIDI. I designed an Arduino based 8 voice MIDI-CV/GATE circuit for my poly synth a while back.

I got an LCD and rotary encoder working, but I think I just fried the LCD Sad It still lights up and the code is able to read the ready status (everything freezes up if the LCD is removed since it's waiting for ready) but no characters are being displayed.

I tried PWM CV for the LFO which works so-so, but I think I'm just going to throw DAC's in it. Easy and works much better.

I'm thinking of making it into a shield that can be plugged into the Uno, not really sure if it's worth while vs just putting it all on one board.

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
sompost



Joined: Aug 17, 2010
Posts: 58
Location: Switzerland

PostPosted: Mon Oct 31, 2016 12:23 am    Post subject: Reply with quote  Mark this post and the followings unread

The "freezing up" of LCDs happened to me a few times, too. But it was never terminal. I'm not the most careful handler of components but never actually managed to kill a device. They're quite resilient.

Be sure to check the wiring/pins, perhaps plug the display into a circuit known to work. Also, a quick'n'dirty code change and nothing appears to work anymore. Uncomment all recent changes and try again. Unless you ran much more than Vcc into the display, I don't think you can fry it.

Good luck!

PS: True story: I once got an LCD running for a few moments and then saw garbage appear on the display. When checking the garbage, it appeared that one bit of the character code got lost. Many, many hours of debugging followed. I finally discovered that I had plugged one end of a pair of wires into the display and the other end of the other wire into the Arduino. So the pins were not connected, but apparently some part of the digital signal radiated (as in "radio") from one wire to the other.

_________________
Built: MFOS SLMS plus, SL Ultimate & Expander, 10 step seq; SLMS MkII; PAiA FatMan, Mutable-Instruments Shruthi-1; Jasper Wasp Clone
Building: Maddox MonoWave; Auduino; ASM-2; Minimoog Clone
Backlogging: MFOS 16 step seq; TH SN Voice; Takeda One Board Farm; Okita Vocoder; Page TR-9090; TH GM Voice, AY Voice
Back to top
View user's profile Send private message Visit poster's website
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Mon Oct 31, 2016 4:24 am    Post subject: Reply with quote  Mark this post and the followings unread

The LCD just stopped working while I was using it, I didn't make any changes. I've looked at the wiring and don't see anything wrong. I did accidentally hook up Vcc to my 12V supply which is why I think it's fried, though it was working for a little bit after I fixed the supply connection.

Not a big deal, I'll just have to find a suitable replacement to include in my next mouser order. Kinda bummed that I can't play with it till then though.

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Mon Oct 31, 2016 1:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

My friend just gave me his Arduino kit since he's not using it. So I have another LCD now and it's working
_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Sun Nov 06, 2016 12:07 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for the comments! gdavis; good luck with your project, sounds like fun! Smile

So last week I started looking more closely at the possibility of upgrading the Megavolt design to have more gates and CVs.

For gates, I looked around and read some forums etc, and settled on a design where I use a shift register - just one more pin on the ATmega328 - coupled with a ULN2803 tranny array. The array is fed by the +15V rail through a voltage divider, getting me ~9.6 or so V on the gate outs. It should be a fairly easy task to get it nicely laid out on the PCB, and it's just two IC's, a few resistors and filter caps, instead of the big mess the discrete trannies made with associated components - having eight of those on one board would've been impossible.

Then I was looking for a good quad DAC to replace two MCP4822's and stumbled on the LTC1458. It's only available as SSOP, which means opening a can of worms for me, since I'm etching my own boards. But I can't find any quad-channel 12-bit (or more) DACs in a through-hole package. An adapter board could work, but that still means soldering the DAC onto the adapter board. I would like to avoid that.

My main issue is that I want to keep the project approachable for almost anyone who wants to build it themselves. I don't want to go multi-layer PCB and I especially don't want SMD and vias to deal with. You should be able to etch your own board, solder in the components, program the ATmega and go.

So right now I'm coming up on the limit of what I can do in terms of using through-hole components and a small (7.5cm x 10cm) board. The ATmega, optocoupler, two shift registers (LCD + gates), a TL074 and two MCP4822's plus associated resistors, caps and I/O headers means routing the whole thing on a single layer is getting extremely difficult.

If I do move up to SMDs I probably would want to redesign the entire board, but I would rather have a working version using regular through-hole first, getting everything working, proper firmware etc, then move on to the next iteration.

So yeah, any input or thoughts are more than welcome. Smile
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Sun Nov 06, 2016 2:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

drakfluga wrote:
Thanks for the comments! gdavis; good luck with your project, sounds like fun! Smile

So last week I started looking more closely at the possibility of upgrading the Megavolt design to have more gates and CVs.

For gates, I looked around and read some forums etc, and settled on a design where I use a shift register - just one more pin on the ATmega328


Is your design pin limited? I just used 8 digital outs for mine, didn't see the point in messing with a shift register.

Quote:
- coupled with a ULN2803 tranny array. The array is fed by the +15V rail through a voltage divider, getting me ~9.6 or so V on the gate outs. It should be a fairly easy task to get it nicely laid out on the PCB, and it's just two IC's, a few resistors and filter caps, instead of the big mess the discrete trannies made with associated components - having eight of those on one board would've been impossible.

Care to share your circuit for this? I watched one of your videos and you seemed to be struggling a little bit with this.

Quote:
Then I was looking for a good quad DAC to replace two MCP4822's and stumbled on the LTC1458.


Did you see the MCP4728? That's what I was looking at. Much lower pin count than the LTC part, yikes!

Quote:
It's only available as SSOP, which means opening a can of worms for me, since I'm etching my own boards. But I can't find any quad-channel 12-bit (or more) DACs in a through-hole package. An adapter board could work, but that still means soldering the DAC onto the adapter board. I would like to avoid that.


Ya, dips keep getting harder to find. I don't really understand the fears people have of soldering SMD though, it's really not that bad. Flux pen and a nice small chisel tip soldering iron and it's pretty easy.

Routing a single sided board with SMD can be more difficult, but the MCP DAC shouldn't be too bad.

Quote:
My main issue is that I want to keep the project approachable for almost anyone who wants to build it themselves. I don't want to go multi-layer PCB and I especially don't want SMD and vias to deal with. You should be able to etch your own board, solder in the components, program the ATmega and go.


I've etched my own two layer boards and it is a pain. It's getting pretty easy to have boards made though, so that trade off is becoming something to think about more.

Quote:
So right now I'm coming up on the limit of what I can do in terms of using through-hole components and a small (7.5cm x 10cm) board. The ATmega, optocoupler, two shift registers (LCD + gates), a TL074 and two MCP4822's plus associated resistors, caps and I/O headers means routing the whole thing on a single layer is getting extremely difficult.

If I do move up to SMDs I probably would want to redesign the entire board, but I would rather have a working version using regular through-hole first, getting everything working, proper firmware etc, then move on to the next iteration.

So yeah, any input or thoughts are more than welcome. Smile


I went through the same thing. Making things accessible is great, but when you start hitting the limits it gets frustrating. For me, making the leap to SMD and double sided professionally made boards felt so liberating.

You might want to try doing a two sided SMD design even if you don't get it made just to see the difference. Then you'll be better able to judge the trade offs and make an informed decision on which way to go for any project.

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Mon Nov 07, 2016 12:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

gdavis; Again, thanks a lot for the input! Very much appreciated! Smile

gdavis wrote:

Is your design pin limited? I just used 8 digital outs for mine, didn't see the point in messing with a shift register.


It is, well, sort of. I do want to minimize the pin count on the ATmega - it actually makes routing easier too because I don't have to route 8 separate traces from the ATmega, it's enough with the SPI traces and then I can just put the s.reg and array next to each other - very clean!

Quote:

Care to share your circuit for this? I watched one of your videos and you seemed to be struggling a little bit with this.


Thanks for watching! I guess that was last Tuesday's then? That was a bit derpy, I hadn't really thought it through and ended up just winging it, which I'm not nearly experienced enough to pull off. Razz I'll try not to get myself in too deep tomorrow, watching me fail at PCB design and getting frustrated is probably not too entertaining. Razz

The circuit for the s.reg/tranny array thing is fairly simple, I'll attach a screenshot of my current layout below. You can see the shift reg with output lines to the tranny array, then through the resistors to gate outs. The entire board isn't routed completely, obviously, but that part is.

Quote:
Did you see the MCP4728? That's what I was looking at. Much lower pin count than the LTC part, yikes!


I did! And it's great, but it's I2C and I'm worried about supporting both I2C and SPI on the ATmega simultaneously. I've never looked into it and not sure it's even possible? I'm also concerned about speed, as I think SPI is considerably faster? The lower pin count is certainly appealing though!

Quote:
Ya, dips keep getting harder to find. I don't really understand the fears people have of soldering SMD though, it's really not that bad. Flux pen and a nice small chisel tip soldering iron and it's pretty easy.


I'm working up the courage to go SMD! Wink I don't have many SMD components around though, so I'm going to order a batch of cookie cutter stuff first of all - basic resistors, caps etc. Then I'll build up my store bit by bit as need arises. That's basically all that's stopping me atm.

Quote:
Routing a single sided board with SMD can be more difficult, but the MCP DAC shouldn't be too bad.


So you mean I should put the SMD components on the single copper side? I just figured that would be too inefficient as the SMD parts will take up space I could use for routing. But it might work I guess, it's worth a try! Just one SMD component might not be too bad.

Quote:
I went through the same thing. Making things accessible is great, but when you start hitting the limits it gets frustrating. For me, making the leap to SMD and double sided professionally made boards felt so liberating.


I've heard other say the same thing. Smile I guess I just need to take the plunge.

Quote:
You might want to try doing a two sided SMD design even if you don't get it made just to see the difference. Then you'll be better able to judge the trade offs and make an informed decision on which way to go for any project.


That's not a bad idea either. Yeah, you make a good case for trying it. I'm not at all sure how to go about it, it seems a lot different from through-hole design, but guess I'll just start out like normal with the schematic I have, change every package to SMD and go from there.


Screenshot 2016-11-07 20.26.16.png
 Description:
 Filesize:  32.53 KB
 Viewed:  515 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Screenshot 2016-11-07 20.26.16.png


Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Mon Nov 07, 2016 2:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

drakfluga wrote:
gdavis; Again, thanks a lot for the input! Very much appreciated! Smile

gdavis wrote:

Is your design pin limited? I just used 8 digital outs for mine, didn't see the point in messing with a shift register.


It is, well, sort of. I do want to minimize the pin count on the ATmega - it actually makes routing easier too because I don't have to route 8 separate traces from the ATmega, it's enough with the SPI traces and then I can just put the s.reg and array next to each other - very clean!

That's a good point. Just remember all that shifting adds delay between receiving the midi message and updating the outputs. But if it's fast enough...

Quote:
Quote:

Care to share your circuit for this? I watched one of your videos and you seemed to be struggling a little bit with this.


Thanks for watching! I guess that was last Tuesday's then? That was a bit derpy, I hadn't really thought it through and ended up just winging it, which I'm not nearly experienced enough to pull off. Razz I'll try not to get myself in too deep tomorrow, watching me fail at PCB design and getting frustrated is probably not too entertaining. Razz

The circuit for the s.reg/tranny array thing is fairly simple, I'll attach a screenshot of my current layout below. You can see the shift reg with output lines to the tranny array, then through the resistors to gate outs. The entire board isn't routed completely, obviously, but that part is.

This isn't going to work like you think. The tranny array common pin is not a pull up, it's connected to spike protection diodes for use with inductive loads like a motor. The outputs are open collector and need their own pull ups. All the output can do is drive low, there's nothing to make it go high except the leakage current through the diode which is very small.

Quote:
Quote:
Did you see the MCP4728? That's what I was looking at. Much lower pin count than the LTC part, yikes!


I did! And it's great, but it's I2C and I'm worried about supporting both I2C and SPI on the ATmega simultaneously. I've never looked into it and not sure it's even possible? I'm also concerned about speed, as I think SPI is considerably faster? The lower pin count is certainly appealing though!

Oh sorry, I was thinking you were already using I2C. I'm pretty sure you can use them both, they're different pins and blocks in the MCU, but ya, you probably want to avoid doing that if you can. The 4728 can support up to 3.4MBit/sec. I don't know if that's normal for I2C devices though.

Quote:
Quote:
Ya, dips keep getting harder to find. I don't really understand the fears people have of soldering SMD though, it's really not that bad. Flux pen and a nice small chisel tip soldering iron and it's pretty easy.


I'm working up the courage to go SMD! Wink I don't have many SMD components around though, so I'm going to order a batch of cookie cutter stuff first of all - basic resistors, caps etc. Then I'll build up my store bit by bit as need arises. That's basically all that's stopping me atm.

Quote:
Routing a single sided board with SMD can be more difficult, but the MCP DAC shouldn't be too bad.


So you mean I should put the SMD components on the single copper side? I just figured that would be too inefficient as the SMD parts will take up space I could use for routing. But it might work I guess, it's worth a try! Just one SMD component might not be too bad.

Ya, that's the tricky part Wink But if the SMD part is limited enough it might be doable. A few jumpers are easy to do if you need to cross traces and can make a big difference.

Quote:
Quote:
I went through the same thing. Making things accessible is great, but when you start hitting the limits it gets frustrating. For me, making the leap to SMD and double sided professionally made boards felt so liberating.


I've heard other say the same thing. Smile I guess I just need to take the plunge.

Quote:
You might want to try doing a two sided SMD design even if you don't get it made just to see the difference. Then you'll be better able to judge the trade offs and make an informed decision on which way to go for any project.


That's not a bad idea either. Yeah, you make a good case for trying it. I'm not at all sure how to go about it, it seems a lot different from through-hole design, but guess I'll just start out like normal with the schematic I have, change every package to SMD and go from there.

Ya, you'll have to rethink your approach to place and route a little bit, takes practice. Just wait till you start wanting to use parts only available in BGA Confused

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Tue Nov 08, 2016 1:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

gdavis wrote:

This isn't going to work like you think. The tranny array common pin is not a pull up, it's connected to spike protection diodes for use with inductive loads like a motor. The outputs are open collector and need their own pull ups. All the output can do is drive low, there's nothing to make it go high except the leakage current through the diode which is very small.


So, if I'm understanding you correctly, you're saying that I'll need a pullup to ~10V on each output, and this is because the current through the output is too low? Since it's just a low-current signal path? If I was using it to drive loads like servos, motors etc it would work like I've done it?

So I'd need 8 more resistors on there, which makes a whole lot of resistors.

I've googled some schematics where the ULN2803 is used but having trouble finding circuits where it's used as a logic/signal amp as opposed to load-driving. I can't find any example that looks substantially different from mine.

Can I change my design, is there another part I can use, or am I going about this completely wrong? I feel like such a noob! It seems every time I think I've got the hang of it, something bites me in the backside. Very Happy

Cheers!
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Tue Nov 08, 2016 6:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

drakfluga wrote:
gdavis wrote:

This isn't going to work like you think. The tranny array common pin is not a pull up, it's connected to spike protection diodes for use with inductive loads like a motor. The outputs are open collector and need their own pull ups. All the output can do is drive low, there's nothing to make it go high except the leakage current through the diode which is very small.


So, if I'm understanding you correctly, you're saying that I'll need a pullup to ~10V on each output, and this is because the current through the output is too low? Since it's just a low-current signal path?

You'll have plenty of current driving it low, but almost none driving it high. Think of the output like an SPST switch to ground. When the switch is closed, it's connected to ground so you get a good strong low. When the switch is opened, it's not really doing anything, it's just an open circuit.

Since this is an SS device and not a mechanical switch, you have some very small leakage currents that will make it behave weird when it's off.

Quote:
If I was using it to drive loads like servos, motors etc it would work like I've done it?

That's not really a valid comparison because you're trying to drive a high impedance input. When you connect a motor, one side of the motor is connected to the output and the other side is connected to a power source. So when the output is enabled, it's connected to ground completing the circuit from power, through the motor, to ground. When the output is disabled, it just opens up like a switch, there's no longer a current path through the motor so it stops. The leakage current is way to small to affect something like a motor.

Now, motors can also act as generators and when they are stopped suddenly can send a voltage spike back through the transistor. That spike can easily damage the transistor, this is why the common connection is there. When connected to the power supply, it suppresses the spike through a diode. But this relies on a low impedance path to the power supply. The voltage divider you've put on there would cause two problems - the spikes wouldn't be suppressed because the current will create a voltage drop across it and when the output is off it will provide a path to ground through the diode from the motor preventing it from shutting off all the way.

Quote:
So I'd need 8 more resistors on there, which makes a whole lot of resistors.

yep.

Quote:
I've googled some schematics where the ULN2803 is used but having trouble finding circuits where it's used as a logic/signal amp as opposed to load-driving. I can't find any example that looks substantially different from mine.

It's not really meant to do what you're trying to do. Darlington pair is meant to switch a large current on and off using a very small current to control it. It basically compounds the current gain of a single transistor.

Quote:
Can I change my design, is there another part I can use, or am I going about this completely wrong? I feel like such a noob! It seems every time I think I've got the hang of it, something bites me in the backside. Very Happy

I wouldn't say you're going about it completely wrong, it's just not quite as simple as one might hope. I don't think you can do this with as few components as you're trying to do. You're not the first one to struggle with this.

Like I said, you can use the tranny array with the pull up resistors, but then it becomes a balancing act choosing the resistor value - small enough to drive the output high enough and fast enough, while large enough to not consume too much power when the output is low (which presumably it will be most of the time).

I wouldn't use a voltage divider to source the 10V directly to the output, I'd buffer it with an opamp (with much larger resistor values in the divider) or use a voltage regulator or DC converter.

Another option would be to use opamps to amplify the output. You would need two quad opamp IC's to get 8 outputs and two resistors for each output so still a considerable number of components, but straight forward, low power and if you use TL074's, they have built in short protection on the outputs so it would save you that resistor. This is what I'm planning on doing at the moment.

OH, I just realized you also don't have a current limiting resistor between the shift register outputs and the tranny array inputs, this is another big problem.

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Wed Nov 09, 2016 10:31 am    Post subject: Reply with quote  Mark this post and the followings unread

Couple more thoughts:
Look into resistor arrays and networks. Resistor arrays are basically several resistors in a DIP. Networks have one end of all the resistors tied together, reducing pin count - perfect for pull ups.

As I was falling asleep, it came to me that something like a DG333 might work for driving gate outputs. It's basically 4 SPDT MOSFET switches. The switches can be controlled by 5V logic, but can switch larger voltages so you could connect the throws of each switch to +10V and GND. The control inputs are high impedance so you don't need current limiting resistors, and you don't need pull up resistors, it's basically working like a CMOS driver.

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
drakfluga



Joined: May 09, 2012
Posts: 49
Location: Gothenburg SE

PostPosted: Fri Nov 11, 2016 4:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

gdavis;

Read your last two posts a few times, and gave it a lot of thought.

gdavis wrote:

I wouldn't use a voltage divider to source the 10V directly to the output, I'd buffer it with an opamp (with much larger resistor values in the divider) or use a voltage regulator or DC converter.

Another option would be to use opamps to amplify the output. You would need two quad opamp IC's to get 8 outputs and two resistors for each output so still a considerable number of components, but straight forward, low power and if you use TL074's, they have built in short protection on the outputs so it would save you that resistor. This is what I'm planning on doing at the moment.

OH, I just realized you also don't have a current limiting resistor between the shift register outputs and the tranny array inputs, this is another big problem.


I think this is precisely what I'm going to do. Dual TL074's, with the shift register feeding the inputs. I can basically use the same setup as my CV outputs but feed them from the sreg instead of a DAC.

That was actually my plan initially - to just swipe the CV circuit right off and use it for gate, but I thought I could simplify it since it only needed to be constant voltage. Tried the discrete tranny solution, but it turned out messy with more than a few gate outs, so I figured a tranny array might work, but that just managed to dig me deeper into this mess. Sigh. Well, it's been a great learning experience at least! Very Happy

I completely forgot resistors on the sreg-outs. Wow, thanks, yes that's a pretty significant oversight. Wink

I've actually started playing around with an SMD-based version of the interface, designed for proper a proper fab run. I've switched from EAGLE to KiCad and it's growing on me. Both have their issues, but getting away from the limitations of EAGLE's freeware version is a big deal.

Smaller components, thinner traces, the option to use vias, and a double-layered board makes all the difference!

Will post some screens once I've wired the gate circuit up in KiCad.

PS. So, just to check my own (lack of) knowledge, the reason I can go with larger resistor values on the buffering opamp is because high input impedance, so very little drop in voltage across the divider? I'm always finding it difficult to know what to go for, I've tended to pick values in the 10k's, but maybe 100k's or even M's would be more appropriate here. Power conservation is important!

So maybe I should go higher on the CV outputs as well, right now I'm using 39k/27k to set the opamp gain, but maybe I should go 10x that or more?

Cheers!
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Fri Nov 11, 2016 5:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

drakfluga wrote:
gdavis;

I think this is precisely what I'm going to do. Dual TL074's, with the shift register feeding the inputs. I can basically use the same setup as my CV outputs but feed them from the sreg instead of a DAC.

That was actually my plan initially - to just swipe the CV circuit right off and use it for gate, but I thought I could simplify it since it only needed to be constant voltage.

Seems like it should be simpler, doesn't it?

I did some more searching and came across the CD4504B hex voltage level shifter. Seems like a winner to me if you can give up 2 gates or add another IC Wink

Quote:
I've actually started playing around with an SMD-based version of the interface, designed for proper a proper fab run. I've switched from EAGLE to KiCad and it's growing on me. Both have their issues, but getting away from the limitations of EAGLE's freeware version is a big deal.

I think KiCad is my favorite free layout program, though I haven't used it much for various reasons.

Quote:
PS. So, just to check my own (lack of) knowledge, the reason I can go with larger resistor values on the buffering opamp is because high input impedance, so very little drop in voltage across the divider?

Exactly.

Quote:
I'm always finding it difficult to know what to go for, I've tended to pick values in the 10k's, but maybe 100k's or even M's would be more appropriate here. Power conservation is important!

General rule of thumb is that the current through the divider should be at least 10X the current being drawn out of the divider. In most cases, this makes the effect of the load small enough to be considered negligible.

Quote:
So maybe I should go higher on the CV outputs as well, right now I'm using 39k/27k to set the opamp gain, but maybe I should go 10x that or more?

The trade off that needs to be taken into consideration is noise. The higher you go, the more susceptible it will be to noise. This will be much more noticeable on CV's compared to gates. Anything in the 10k to 200k (very rough) ballpark should be fine.

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 2 [34 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Arduino
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use