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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Interfacing CVs and microcontrollers.
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
reve



Joined: Feb 23, 2008
Posts: 149
Location: USA

PostPosted: Wed Jun 09, 2010 11:33 am    Post subject: Interfacing CVs and microcontrollers.
Subject description: (again)
Reply with quote  Mark this post and the followings unread

So I'd like to interface my modular CV signals to a microcontroller based LFO. The microcontroller ADC is expecting 0-5v positive. My envelopes are going 0-10 positive and my analog LFOs are +/- 5v. I'd like to handle the input as efficiently as possible, so I was hoping to pick some of your collective brains.

It seems like a voltage divider followed by a diode clamp would get the incoming voltages where I need them to be. But I also want manual control – so I would also want a pot wired to 5v and ground. And I might want multiple CV inputs. Smile

Aaaannnnd that's where I run into trouble. As I already have four opamps on the outputs of my simple digital project, I was hoping to get out of constructing like, a DC mixer. Is there a way around that? Could I just use a couple zeners and just straight clip the voltage or something to keep inside the 0-5 box?

Doing it right is more important than doing it easy here, but... I’d like both right and easy if all y'all have any suggestions. Smile
Back to top
View user's profile Send private message
clee



Joined: Dec 08, 2009
Posts: 42
Location: Chicago

PostPosted: Thu Jun 17, 2010 4:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

You're going to have to build a DC mixer if you want to mix CV inputs. Or bring each CV input to a PIC pin and share the A/D converter (the harder of the 2 I would think).

As far as protecting the PIC from overvoltage, I'm having the same issue with a Quantizer I'm building, I'd be interested in some ideas others have. Just using a zener and a resister will give you a very non-linear response near 5 volts.

Here are 2 bits of info:

This is nice, but the voltage break is changed by the input impeadance
http://books.google.com/books?id=1NcSBP2OA-QC&pg=PT278&lpg=PT278&dq=precision+clipper+op+amp&source=bl&ots=oLn5X37G35&sig=IFR5vOZfbEpnXTR4WEpw9TSXo2A&hl=en&ei=UH8RTLaeJZCUMvPC7cgF&sa=X&oi=book_result&ct=result&resnum=6&ved=0CDAQ6AEwBQ#v=onepage&q=precision%20clipper%20op%20amp&f=false

and this tread seems to be saying don't worry about it

http://www.electro-tech-online.com/micro-controllers/22046-i-o-pin-over-voltage-protection.html

but I'm not so sure...

_________________
life in many forms...
http://clsound.com
Back to top
View user's profile Send private message Visit poster's website
PickNick



Joined: Oct 16, 2009
Posts: 82
Location: BP

PostPosted: Fri Jun 18, 2010 7:20 am    Post subject: Reply with quote  Mark this post and the followings unread

hi!

here is some info about modified Edruid LFO/sync in, FM in...:

http://www.acoupel.com/LFO/Schema/Schema%20LFO%20edruid.htm

and the original schema with optional external CVins:

http://www.electricdruid.net/forums.html?page=projects.lfo9
Back to top
View user's profile Send private message
reve



Joined: Feb 23, 2008
Posts: 149
Location: USA

PostPosted: Fri Jun 18, 2010 11:37 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for the responses, guys. Extra thanks to Wavemultiplier... I see now the problems with the nonlinearity in the zener solution -- it winds up working as a voltage divider. Boo. Hiss.

That said, it looks like both AVRs and PICs have internal protection diodes in place as long as you use a current limiting resistor in series. The bad is that it winds up biasing the other ADC inputs when the protection diodes kick in. :/

So here's my crazy idea: (for my scenario) we've gotta build a DC mixer, ya? So I've got an inverting opamp followed by a voltage follower. What if I used a rail to rail op amp powered by 0v/+5v as the voltage follower? A regular opamp would work for protecting the micro from overvoltage, but... it'd mess up the scaling, which needs to be real close to 0-5v.

Would that work?
Back to top
View user's profile Send private message
PickNick



Joined: Oct 16, 2009
Posts: 82
Location: BP

PostPosted: Fri Jun 18, 2010 12:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

for -5/+5 cvin maybe?

http://www.acoupel.com/sequencer/schemas/ACS%20Sequencer%20schema.pdf

for multiple 1v/oct cvins///0-8v:

http://www.electricdruid.net/datasheets/VCLFO9DDatasheet.pdf

sorry if i misunderstood something Smile
Back to top
View user's profile Send private message
clee



Joined: Dec 08, 2009
Posts: 42
Location: Chicago

PostPosted: Sat Jun 19, 2010 6:37 am    Post subject: Reply with quote  Mark this post and the followings unread

Here is what I came up with the other day. I have not actually hooked this up to a PIC yet, the person doing the programing has it, but it SHOULD work. Resister values may change.

The circuit is putting out about -1 volt when going negative right now. I need to try a schottkey diode for D1 and see if it gets it to -.3v

R6 sets the CV from 0 to 5v R7 sets CV IN to no gain at the center, full gain with the wiper at CV IN and Inverted full gain with the wiper at GROUND

EDITED: Error IN DESIGN! javascript:emoticon('Embarassed')


voltage input to PIC.jpg
 Description:
 Filesize:  106.68 KB
 Viewed:  450 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

voltage input to PIC.jpg



_________________
life in many forms...
http://clsound.com

Last edited by clee on Sat Jun 19, 2010 3:03 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
Rykhaard



Joined: Sep 02, 2007
Posts: 1290
Location: Canada

PostPosted: Sat Jun 19, 2010 8:23 am    Post subject: Reply with quote  Mark this post and the followings unread

PickNick wrote:
hi!

here is some info about modified Edruid LFO/sync in, FM in...:

http://www.acoupel.com/LFO/Schema/Schema%20LFO%20edruid.htm

and the original schema with optional external CVins:

http://www.electricdruid.net/forums.html?page=projects.lfo9


Thankee for those links. Smile I've just ordered 5 x 16F684's. I'm going to try working with this, to teach myself working with the PICKit 3 - backwards. Study the code for these devices and from THAT direction, learn how to properly work with everything, in modifying them further / etc. Smile
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
clee



Joined: Dec 08, 2009
Posts: 42
Location: Chicago

PostPosted: Sat Jun 19, 2010 3:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

So, don't build the circuit I posted. The 2 pots interact with each other. The clipper does work though.

Craig

_________________
life in many forms...
http://clsound.com
Back to top
View user's profile Send private message Visit poster's website
Rykhaard



Joined: Sep 02, 2007
Posts: 1290
Location: Canada

PostPosted: Sat Jun 19, 2010 3:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wavemultiplier wrote:
So, don't build the circuit I posted. The 2 pots interact with each other. The clipper does work though.

Craig


No worry. I've posted a request for code, at Electric Druid's website.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Junk Rhythm



Joined: Jan 07, 2008
Posts: 81
Location: San Francisco, CA

PostPosted: Sat Jun 19, 2010 4:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

Rykhaard wrote:
No worry. I've posted a request for code, at Electric Druid's website.


I thought the ASM code and HEX file was included on the Electrc Druid website?

_________________
[twitter] [blog] [flickr] [toppobrillo] [buzz]
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Rykhaard



Joined: Sep 02, 2007
Posts: 1290
Location: Canada

PostPosted: Sat Jun 19, 2010 6:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

g.p.macklin wrote:
Rykhaard wrote:
No worry. I've posted a request for code, at Electric Druid's website.


I thought the ASM code and HEX file was included on the Electrc Druid website?


Uh oh .... maybe I were blind in the eye that would have seen it then. Surprised I sent him off email, requesting permission for his code, explaining my dilemma in learning and having ordered the 16F684's today ...

Shall see. And, I'll go back and have a look ... feeling silly if it's still up there. Surprised Smile
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
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