Simson91 Posted July 27, 2008 Report Share Posted July 27, 2008 Hi everyone,I am trying to build rasteris scratch controller(http://www.midibox.org/forum/index.php/topic,11167.0.html) (I'm amazed by it, respect!) I'm using the first c code he posted (can't use the other new one because of my PIC18F452). I'm almost done andI just build my encoder with a dual IR photodiode and an IR LED but the only MIDI output (after the one upload request in the beginning that shows that my PIC is up and running) I get is "CC Bank Select Value: 64""CC Bank Select Value: 0 " "CC Bank Select Value: 64""CC Bank Select Value: 0 "....when I let the encoder wheel (the one rasteri has avaliable to download in his thread) spin through my encoder. So in Traktor I can only spin in one direction.I guess its a problem with the quadrature but I don't know what possibly could be wrong with my encoder, I took a picture of it maybe it can help to find the problem. http://foto.arcor-online.net/palb/alben/45/749645/1280_6331653336346461.jpgHere is the link to rasteris wiki to show how my module is build: http://www.midibox.org/dokuwiki/scratchcontrollerI attached the code I am using right now too(thanks for sharing all this rasteri!). I hope this is all the information you guys need.Thanks for your time, Simonmain.c Quote Link to comment Share on other sites More sharing options...
rasteri Posted July 27, 2008 Report Share Posted July 27, 2008 Bank select is the crossfader. Are you sure you have the photodiodes in pins 3 and 4?You had better ground pin2 as well, that could be causing it. Quote Link to comment Share on other sites More sharing options...
Simson91 Posted July 27, 2008 Author Report Share Posted July 27, 2008 You were right, I connected pin 2 to ground and the Bank Select disappears. Now I don't get any midi signal. I thought about it and I forgot to ask if the encoder even sends a signal without a crossfader? Because I don't have one connected right now ::) Quote Link to comment Share on other sites More sharing options...
Simson91 Posted July 28, 2008 Author Report Share Posted July 28, 2008 Hi everyone,All right so I tested a little bit more and I noticed that the voltage at both pins (3 & 4) from 0V when its "off"(the IR LED is covered) only goes up to 0.02V when its "on". Is that even enough for the PIC to notice a change and send data? I accedently connected the 5V in of the photodiode with one of the out pins and I got midi signals like: "CC Modulation Wheel value: 63 CC Modulation Wheel value: 64 CC Modulation Wheel value: 65..."I don't get these just with the encoder wheel though (maybe the low voltage difference from on and off?).Thanks, Simon Quote Link to comment Share on other sites More sharing options...
rasteri Posted July 28, 2008 Report Share Posted July 28, 2008 The voltage should go up a lot more than that, in my case low is 1.5v and high is 4v.I don't really know what the problem could be. Try it in a bunch of different test circuits and stuff - e.g. maybe it wants ground instead of 5v at its common pin (i.e. stick it in the bottom half of the voltage divider), maybe it wants a different resistor value, etc. It's weird though, it looks IDENTICAL to the one I'm using...EDIT: Also check the LED is working and wired up properly Quote Link to comment Share on other sites More sharing options...
Simson91 Posted July 28, 2008 Author Report Share Posted July 28, 2008 The LED is working, I checked it with my digicam. I think the photodoide is not compatible with the 10k resistors, I don't have a clue though which other value I could take. ::) Quote Link to comment Share on other sites More sharing options...
rasteri Posted July 30, 2008 Report Share Posted July 30, 2008 Try it with some other value resistors in a circuit on its own - 500, 1k, 50k, 100k, etc. Try connecting it the other way round (with the common pin to ground and the resistors going to +5v). Or try another photodiode (if you're anything like me you have dozens of old mice lying around).Just try stuff! That's what I did :P Quote Link to comment Share on other sites More sharing options...
nILS Posted July 30, 2008 Report Share Posted July 30, 2008 I just built a fairly lofi version - printed out 12cm diameter gap thingie (180 evenly spaced gaps), put that between two CDs (removed the metal coating first ;)) and used it with an LED and ptohodiode from an old logitech mouse. Works like a charm. Since I don't have any hardware lying around that I could use to build it into a box, I just stuck the screw that's holding the CDs into a drill :-) Now I can fast forward songs. I can only get the "old" version without the touch sensor to work though. The new one (the Pins 4+5 version) doesn't output anything. I'll have to find out why - this is really fun without it though, too ;D Quote Link to comment Share on other sites More sharing options...
rasteri Posted August 5, 2008 Report Share Posted August 5, 2008 I dunno why the new version isn't working, maybe the voltage reference is not suitable for your photodiodes?Grab the newest (0.025) version of the code, it lets you adjust the voltage reference at the top of the source (COMPARATOR_THRESHOLD). Maybe try setting it to 0x07? If you just can't get pins 4/5 working at all, the new version also lets you revert to the old ADC behaviour (i.e. using pins 3/4) but still use the touch sensor. Uncomment the line that says #define USE_ADC_ENCODER. (you can also change the threshold for that should you so desire)Check the other thread http://www.midibox.org/forum/index.php/topic,11167.msg97390.html#msg97390 for the new code Quote Link to comment Share on other sites More sharing options...
stryd_one Posted August 5, 2008 Report Share Posted August 5, 2008 I dunno why the new version isn't working, maybe the voltage reference is not suitable for your photodiodes?IIRC we looked at it in channel and I had him test the voltages and that's exactly what it was. Quote Link to comment Share on other sites More sharing options...
nILS Posted August 5, 2008 Report Share Posted August 5, 2008 stryd_one is partially correct. I used the mouse wheel in the first version and the voltags were in a 0.7...3.2V range. With the printed out wheel I get 0.7V and 4.2V so I guess that's not the problem. I'll try the new code and let you know what the results are! Thanks rasteri this thing is fun ;D Quote Link to comment Share on other sites More sharing options...
stryd_one Posted August 5, 2008 Report Share Posted August 5, 2008 0.7...3.2V range. With the printed out wheel I get 0.7V and 4.2V Threshold's been 0.75V so far, so you're only *just* going below that, assuming your multimeter is very accurate (bad assumption ehehe) Quote Link to comment Share on other sites More sharing options...
rasteri Posted August 6, 2008 Report Share Posted August 6, 2008 Actually it's 0.75 * 5v, the comments in the code are misleading. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted August 6, 2008 Report Share Posted August 6, 2008 Heheh just a bit different ;) I guess I shoulda read the datasheet!Well the old voltages were too low to cross your high threshold, but it should be OK now ? Quote Link to comment Share on other sites More sharing options...
Simson91 Posted August 6, 2008 Author Report Share Posted August 6, 2008 By the way, my problem was solved with taking a new photodiode today. It already works with the little encoder wheel in the mouse but I didn't get it to work with the printed encoder wheel. I guess its not printed dark enough or something. Thanks guys, Simon Quote Link to comment Share on other sites More sharing options...
nILS Posted August 7, 2008 Report Share Posted August 7, 2008 I was afraid mine wouldn't be dark enough, so I printed the whole thing twice :-) That way I can layer them and get it to be darker and by rotating the discs against each other I can also change the gap width. Quote Link to comment Share on other sites More sharing options...
Simson91 Posted August 7, 2008 Author Report Share Posted August 7, 2008 The problem with mine was that the gabs where not wide enough so I scratched them a little wider, it works now but I'll try to print it again with bigger gabs. Quote Link to comment Share on other sites More sharing options...
nILS Posted August 7, 2008 Report Share Posted August 7, 2008 Since there wasn't a pdf or anything I just did some math, which seems to have been sorta correct. Rasteri used a disv about the size of a CD I think so the diameter was ~12cm, and he mentioned a number of gaps. So I calculated the width of his gaps from that info, and made my gaps the same width. That way I would have needed ~173 gaps. So I upped that to 180 to make it easier to draw - done. The gaps are evenly spaced (black bars are the same width as the transparent ones) which seems to work nicely. Quote Link to comment Share on other sites More sharing options...
Simson91 Posted August 7, 2008 Author Report Share Posted August 7, 2008 I used the pdf rasteri had in his thread. Which programm did you use to draw it ? Quote Link to comment Share on other sites More sharing options...
rasteri Posted August 7, 2008 Report Share Posted August 7, 2008 There's a double-res encoder wheel here : http://www.midibox.org/forum/index.php/topic,11167.msg97570.html#msg97570Inkscape is great for drawing this stuff.I have a bunch more wheels of different sizes + resolutions, just went to a print shop one day and printed out loads. I really need to make a website to hold all these files and stuff. Or get wiki upload access... Quote Link to comment Share on other sites More sharing options...
stryd_one Posted August 7, 2008 Report Share Posted August 7, 2008 You've got wiki upload access, everyone does :)MBWikidot Uploadat gmaildot com Quote Link to comment Share on other sites More sharing options...
nILS Posted August 8, 2008 Report Share Posted August 8, 2008 I used Inkscape and making this thing was a matter of 5 minutes. See attached file. Works fine for me, no idea if it'll work with different photodiodes as well.wheel.zip Quote Link to comment Share on other sites More sharing options...
Simson91 Posted August 9, 2008 Author Report Share Posted August 9, 2008 I made myself a new ecoder wheel too, nothing special. It work great now. The only thing that doesn't work yet is the touch sensor I'm probaly missing something, I connected it the way it is on rasteri's schematic.Does someone know what I'd have to add there? Quote Link to comment Share on other sites More sharing options...
nILS Posted August 9, 2008 Report Share Posted August 9, 2008 Hihi, yeah the simplicity of that thing totally threw me off as well. But since I couldn't get the updated version to work in the first pace (I even changed the source to ouput any changes from the wheel to the MIDI Out no matter if it was touched or not) I can't really tell you if my touch sensor works... Quote Link to comment Share on other sites More sharing options...
Simson91 Posted August 11, 2008 Author Report Share Posted August 11, 2008 I tried a couple more things with my touch sensor but it probaly can't work like it is now. I measured 4.15 V at RD1 which is connected through a 47k resistor to RD4 (J14) behind the 47k resistor I measured only 0.01V ??? which is probaly not enough to get any signal out of the PIC. Does anyone know what voltage it has to be on RD4 and how it should change if I touch the little wire I put behind the 47k resistor to get a signal? Thanks Simon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.