Author |
Message |
amos_joseph
Joined: May 09, 2005 Posts: 50 Location: Lincoln, NE
|
Posted: Tue Sep 25, 2007 11:36 am Post subject:
Interfacing a microcontroller with a modular |
|
|
I've been working on some microcontroller projects for my modular lately. Right now I've got the firmware finished for a module that uses an external MIDI clock to generate triggers at various intervals (32nd, 16th, 8th, quarter, half, and whole notes at the moment). It also has it's own internal BPM clock so it can run on it's own without midi.
My question is: Is it okay to just wire the microcontroller pins directly to an output jack? Should I be using a resistor or maybe a transistor to buffer the output? My breadboarded prototype works fine both straight off the pin or though a 1K resistor. I just want to make sure I'm doing things "right" when I start drawing up the circuit board layout.
I'm pretty good with the digital side of electronics, but the analog side still leaves me scratching my head on occasion. |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Sep 25, 2007 12:46 pm Post subject:
|
|
|
When you connect a synth output to your processor output by accident that might kill the processor. So I'd make some protection against this, probably by isolating the output with a transistor. Just a resistor might work as long as the output is an output but on processor startup it will probably start as an input. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Dave Kendall
Joined: May 26, 2007 Posts: 421 Location: England
Audio files: 3
|
Posted: Tue Sep 25, 2007 2:21 pm Post subject:
|
|
|
Hi.
I'm looking at a similar problem with a hardware pulse generator/midi decoder that I've been working on. (for *way* too long it seems.. )
I've had OK-ish results with op amps wired as comparators on the output, to give some protection, and at the same time give +10V triggers from a +5V source. I used an LM358 in single supply configuration, but looking at the scope traces on the output, the pulse leading and falling edges are slightly rounded compared to the +5V trigger input. Slew rate?
I'm not *sure* this is a problem, but I suspect that the steeper the lo-to-hi transition of the pulses, the better all round....
Would it be better to go with a transistor output buffer, or maybe there's a faster responding opamp that will be happy in single supply mode?
I've found and tried a couple of circuit snippets with NPN trannies that seem "sharper' than opamp comparators but all of them are inverting, and are prone to the output signal voltage being pulled down by some (un-buffered?) modules.........
I haven't found any non-inverting circuits. PNP instead?? I seem to have drawn a blank here....
If anyone knows of an good non-inverting transistor buffer circuit that can do upwards level shifting, that's not unduly affected by being connected to modules that can pull the voltage down (the otherwise cool, but as yet input-CV-un-buffered VCF6C does for example...) I'd be very interested.....
cheers,
Dave |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Sep 25, 2007 2:40 pm Post subject:
|
|
|
Normally I'd invert the signal in the software. When that's not possible (because the software is closed or anything) the only thing I can think of is using two transistors. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Sep 25, 2007 2:50 pm Post subject:
|
|
|
Re. the output being pulled low by the input of the following circuit, that could maybe be solved by using an output that pulls high instead of low, that is using a high side switch. When that would invert the problem (the input pulling the output high instead), a push-pull configuration with two transistors will be needed, although you can always experiment with lowering the collector resistor in the output.
You could also have a look at non-inverting power drivers with a push-pull output and built in level shifting, I saw TI makes some stuff like that (*1) (probably Maxim and others do so as well).
(*1) Like the UC2708, to be found at : http://www.datasheetcatalog.com/texasinstruments/645/ _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
amos_joseph
Joined: May 09, 2005 Posts: 50 Location: Lincoln, NE
|
Posted: Tue Sep 25, 2007 3:05 pm Post subject:
|
|
|
Blue Hell wrote: | When you connect a synth output to your processor output by accident that might kill the processor. |
Would something as simple as a diode do the trick? |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Sep 25, 2007 3:15 pm Post subject:
|
|
|
amos_joseph wrote: | Would something as simple as a diode do the trick? |
Guess so
You said you could afford to put 1 k in the output, that helps. Make it two diodes one to ground one to Vcc and add some resistance as well after it for current limiting. Or leave the resistor out and trust that all possible outputs you'll connect by accident will have current limiting at the output - it doesn't need to be functional you just want to keep things from blowing up. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Dave Kendall
Joined: May 26, 2007 Posts: 421 Location: England
Audio files: 3
|
Posted: Tue Sep 25, 2007 3:26 pm Post subject:
|
|
|
Hi Jan.
Quote: | Normally I'd invert the signal in the software. |
It's an all-CMOS device, no code used, just wires (yes I know it's mad, but what the hell.... ) so it's re-wire time...I'll try it.
Dave |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24081 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Tue Sep 25, 2007 3:42 pm Post subject:
|
|
|
Dave Kendall wrote: | It's an all-CMOS device, no code used |
Oh yes I remember that from the old days _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
|