User Tools

Site Tools


wickedblade

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wickedblade [2009/08/10 09:19]
195.22.144.22
wickedblade [2011/11/29 14:40] (current)
smashtv old revision restored (spam kill)
Line 38: Line 38:
   * [[http://​www.muzique.com/​lab/​superbuff.htm|AMZ'​s talk of the superbuffer]],​ of which I will do a version with only 1 opamp   * [[http://​www.muzique.com/​lab/​superbuff.htm|AMZ'​s talk of the superbuffer]],​ of which I will do a version with only 1 opamp
   * [[http://​www.geofex.com/​Article_Folders/​cd4053/​cd4053.htm|Geofex'​s article on CMOS switching]] and other stuff   * [[http://​www.geofex.com/​Article_Folders/​cd4053/​cd4053.htm|Geofex'​s article on CMOS switching]] and other stuff
 +
 +Pedalboards that resemble what I'm doing here:
 +  * Fractal Audio Systems MFC101
 +  * [[http://​www.providence.jp/​providence_e/​pec_2/​pec_2.html|Providence PEC-2]]
  
 ===== Major design changes ===== ===== Major design changes =====
Line 45: Line 49:
   * channel switching, originally CMOS based (not working!) now uses relays   * channel switching, originally CMOS based (not working!) now uses relays
   * went from 8 to 10 effect loops, it will be stuffy but I think I can get it all to fit and still be particable(and be able to physically separate the signal out from the digital circuits)   * went from 8 to 10 effect loops, it will be stuffy but I think I can get it all to fit and still be particable(and be able to physically separate the signal out from the digital circuits)
 +  * went from 2 to 4 custom control footswitches
  
 ===== User needs ===== ===== User needs =====
-What I want is a pedalboard that handles banks of 5 patches, plus an additionnal tap tempo footswitch, and additional custom control footswitches (more on that later).+What I want is a pedalboard that handles banks of 5 patches, plus an additionnal tap tempo footswitch, and additional custom control footswitches (more on that later).
  
 So I need a total of 12 footswitches:​ So I need a total of 12 footswitches:​
Line 64: Line 69:
  
  
-=== Custom controls === +=== Custom controls ​(Cx) === 
-So how do the custom controls footswitches work? Basically, for any patch, you can specify that the custom controls will toggle the state of any of the loops, and you can specify ​CC to be sent when entering and leaving the custom control state (you might want to specify different parameters upon entering and leaving, so there is room for that). You cannot, however, send program change commands. The CC would typically be used to enable/​disable effects on my Replifex.+So how do the custom controls footswitches work? Basically, for any patch, you can specify that the custom controls will toggle the state of any of the loops, and you can specify ​MIDI controller change commands ​to be sent when entering and leaving the custom control state (you might want to specify different parameters upon entering and leaving, so there is room for that). You cannot, however, send program change commands. The Cx would typically be used to enable/​disable effects on my Replifex.
  
-I like this idea, because it offers the same kind of flexibility as having a switch for each and every loop, but in a smaller package. I doubt that I would need more than 2 custom controls. I could probably go up to 4 custom controls, since I have some room left on the chassis for 2 more footswitches,​ but I don't think that will be necessary.+I like this idea, because it offers the same kind of flexibility as having a switch for each and every loop, but in a smaller package. I doubt that I would need more than 2 custom controls. I will probably go up to 4 custom controls, since I have some room left on the chassis for 2 more footswitches,​ but I don't think they will be that necessary.
  
  
Line 118: Line 123:
   * 1 DINx4 module, to handle the footswitches and the edition buttons/​rotary encoders   * 1 DINx4 module, to handle the footswitches and the edition buttons/​rotary encoders
   * 2 DOUTx4 modules to handle the relays, the status LEDs and the 7-segment digits LEDs. 1 module is not enough, but I probably won't need to fully populate the 2nd DOUTx4, but it's nice to have the option of more DOUTs   * 2 DOUTx4 modules to handle the relays, the status LEDs and the 7-segment digits LEDs. 1 module is not enough, but I probably won't need to fully populate the 2nd DOUTx4, but it's nice to have the option of more DOUTs
-  * 1 bankstick, of which I will probably need only one EPROM (see next section)...+  * 1 bankstick, of which I will probably need only EPROM chips (see next section)...
  
 Here is the detail of what is going to be connected to the DIN/DOUT. Here is the detail of what is going to be connected to the DIN/DOUT.
  
 Digital inputs: Digital inputs:
-  * 12 footswitches (bank up/down, patches A..D, tap tempo, custom controls ​A-C+  * 12 footswitches (bank up/down, patches A..D, tap tempo, custom controls ​C1-C4
-  * 2 rotary encoders for edition (parameter select, parameter value change), that means 2x4 inputs+  * 2 rotary encoders for edition (parameter select, parameter value change), that means 2x2 inputs
   * 2 buttons (edit/​cancel button and store button)   * 2 buttons (edit/​cancel button and store button)
   * possibly 2 inputs to know if expression pedals are plugged   * possibly 2 inputs to know if expression pedals are plugged
-This amounts to a maximum total of 24 digital inputs.+This amounts to a maximum total of 20 digital inputs ​max.
  
 Digital outputs: Digital outputs:
Line 141: Line 146:
   * 12 relays for loops and buffers activation, on 2 separate shift registers, so that's actually consuming 16 outputs   * 12 relays for loops and buffers activation, on 2 separate shift registers, so that's actually consuming 16 outputs
   * 12 status LEDs for the loops/​buffers   * 12 status LEDs for the loops/​buffers
-  * 2 relays for channel switching operation+  * 2 relays for channel switching operation ​(make that 4, because I will need to use to darlington arrays of 8 entries each, so let's go to the full 16 relays count)
   * 2 7-segments LED digits, 8 inputs per digit, so that's 2x8 outputs   * 2 7-segments LED digits, 8 inputs per digit, so that's 2x8 outputs
   * 5 status LEDs showing which patch is activated   * 5 status LEDs showing which patch is activated
Line 165: Line 170:
 But this is the maximum continuous current draw, we have to take the pikes into account too. I've been told that aiming at 2A is a good choice, so I'll try to do that. But this is the maximum continuous current draw, we have to take the pikes into account too. I've been told that aiming at 2A is a good choice, so I'll try to do that.
  
-originally ​decided to go with a 9V power supply, because they are common in guitar effects gear. Most power supplies ​only provide 500mA, but I've managed ​to find a 9V 1A power supply. I thought that translated into 5V, that would mean that I should ​be able to draw 1.8A from these, which whould have been enough. Unfortunatelythe 7805 voltage regulator is linear, which apparently means that it won't provide more current at 5V than it would draw at the source. +As far as voltage is concerned, the PIC and associated ICs need 5V, the relays need 5V too, but for the input/​output buffers opamp, ​need to get as much headroom as possible. 9-10V might do the trick. Given that voltage regulator tend to drop about 2V from their input voltage, I'​ve ​decided to go with a 12V power supply. There are plenty of 12V 2A power supplies ​available, but they tend to be switching PSU, which we do not wantbecause they often add unwanted noise. I'​ve ​found a linear 12V 1.5A PSU instead ​at Thomann, the THOMANN NT 1215 C unitwhich is replacement ​for Casio productsIt is indeed linear (I've ordered ​it blindly, but it turned out good), the only caveat is that it has plug that is not the "​usual"​ DC 2.1mm jack, but it's easily swapped ​for anything you like.
-Since then, I found a 5V 2A power supply (PETERSON POWER SUPPLY 5V 2A at Thomann), which is significantly more expensive, but ensures that I won't have power supply problems. Also, the 5V input voltage means that the 7805 won't heat much, I think. +
- +
-I also found a 9V 2A unit: THOMANN NT 092Asimilarly priced. +
- +
-I thought for time that I could forget about these power supply units: the Sony PSP portable console uses a 5V 2A power supply, so that means that there are many that are readily available in video game stores, ​for a much lower price. I purchased one and it is indeed a 5V 2A supply. Howeverusing a 5V power supply would mean getting rid of the voltage regulator, since these have ~2V voltage dropout ​that makes them rather inoperant if fed with less than 7VThis is perfectly acceptable in some cases, but I'd rather keep the voltage regulator and associated bridge rectifier and caps, because they provide some sort of protection against wrong voltage and polarity, whereas if I just use a 5V supply I may fry the PIC (or other stuff) if I accidentally use a 9V power supply from my other effect pedals. So I have to revert to using a 9 or 12V 2A power supply. I happen to have a couple external cases for 3.5" hard drives, and these are fed with a 12V 2A power supply, so I think I'll use that, and I'll purchased a new power supply only if it turns out that I have too.+
  
 It appears to me that I need to manage 2 separate grounds for analog signal and digital signal. I don't quite know how to do that. I've been told I could put some kind of low pass filter somewhere, but I don't quite know how and where. I believe this should go between the digital and analog grounds, so that the analog ground gets a filtered version of the digital ground, but how should I go about it? It appears to me that I need to manage 2 separate grounds for analog signal and digital signal. I don't quite know how to do that. I've been told I could put some kind of low pass filter somewhere, but I don't quite know how and where. I believe this should go between the digital and analog grounds, so that the analog ground gets a filtered version of the digital ground, but how should I go about it?
Line 222: Line 222:
   * a linear regulator (LM7805 or L78S05)   * a linear regulator (LM7805 or L78S05)
  
-For the input and output buffers, I chose the OPA134PA ​for several reasons. First, it's a Burr Brown, and they are quite known for doing very audiophile stuff. I've swapped many opamps in my MP-1 with OPA2604 opamps, with great success. But here I chose the OPA2134 over the OPA2604 because it is, apparently, more transparent than the 2604, which is more tube-like sounding. All this is hearsay from the internet, of course, but I have to make a choice at some point. Anyway, I don't really want the buffers to be part of the sound coloration, here, so I'm trying these. Finally, I'm using two OPA134 instead of one OPA2134 because this way I can position them separately and maybe avoid some kind of feedback/​crosstalk/​whatever between input and output buffers.+For the input and output buffers, I chose the OPA2134 ​for several reasons. First, it's a Burr Brown, and they are quite known for doing very audiophile stuff. I've swapped many opamps in my MP-1 with OPA2604 opamps, with great success. But here I chose the OPA2134 over the OPA2604 because it is, apparently, more transparent than the 2604, which is more tube-like sounding. All this is hearsay from the internet, of course, but I have to make a choice at some point. Anyway, I don't really want the buffers to be part of the sound coloration, here, so I'm trying these.
  
 Here's the partlist for one buffer: Here's the partlist for one buffer:
-  * 1x OPA134PA or 1xOPA2134PA+  * 1x OPA2134PA (half of it actually)
   * 1x DIP8 socket   * 1x DIP8 socket
   * 3x 100k metal film resistors   * 3x 100k metal film resistors
Line 232: Line 232:
   * 2x 10µF electrolytic capacitors   * 2x 10µF electrolytic capacitors
  
-Note that I have to double the quantities because I want 2 buffers. Again, more information can be found on [[http://​www.muzique.com|Jack Orman'​s AMZ site]] (look for the "Basic Buffers"​ and "Super Buffer"​ pages).+Note that I have to double the quantities because I want 2 buffers ​(except for the opamp which is actually a dual opamp). Again, more information can be found on [[http://​www.muzique.com|Jack Orman'​s AMZ site]] (look for the "Basic Buffers"​ and "Super Buffer"​ pages).
  
-For channel switching I originally thought about using a CD4053 like geofex does, but it needs a -5V input besides the +5V and ground. And I don't have that. It doesn'​t look like it handles -2.5/0/2.5V well, so I'm looking for alternatives. The CD74HC4053EE4 by TI looks to be what I need, but I'm not experienced at reading datasheets... +For channel switching I have considered ​using a CD4053 like geofex does, but it needs a -5V input besides the +5V and ground. And I don't have that. It doesn'​t look like it handles -2.5/0/2.5V well, so I have to go another route. Here's a topic I opened on the forum on this matter: [[http://​www.midibox.org/​forum/​index.php/​topic,​13274.0.html|Connecting a HC4053 to DOUT]] 
-Here's a topic I opened on the forum on this matter: [[http://​www.midibox.org/​forum/​index.php/​topic,​13274.0.html|Connecting a HC4053 to DOUT]] +Another option is the "solid state relays",​ which are described in [[http://​www.uoguelph.ca/​~antoon/​gadgets/​relays/​relays.html|this page]]... But in absence of any advice on the subject, I will simply turn to good old SPST relays, like the Omron G5V-1-DC5 (which is actually an SPDT relay but us cheaper thant its SPST counterparts!).
- +
-I'm now turning my hopes to the "solid state relays",​ which are described in [[http://​www.uoguelph.ca/​~antoon/​gadgets/​relays/​relays.html|this page]]... But in absence of any advice on the subject, I will simply turn to good old SPST relays, like the Omron G5V-1-DC5 (which is actually an SPDT relay but us cheaper thant its SPST counterparts!).+
  
 From the Fender Hot Rod Deluxe schematics, I gather that to drive the "​drive"​ and "more drive" channel switches, aside from the relays I will need: From the Fender Hot Rod Deluxe schematics, I gather that to drive the "​drive"​ and "more drive" channel switches, aside from the relays I will need:
Line 243: Line 241:
   * 2 47ohms 1/4W 5% resistors   * 2 47ohms 1/4W 5% resistors
   * 2 22uF/25V electrolytic caps   * 2 22uF/25V electrolytic caps
-The schematics can be found easily on the net. Amps differ widely as far as channel switching is concerned, so better check the schematics to match your amp!+The schematics can be found easily on the net. Amps differ widely as far as channel switching is concerned, so you'​d ​better check the schematics to match your amp! A simple way of being easily compatible would be to simply wire the channel switching stereo input jack to the relays (one relay for the tip, and one for the ring) and make an external box to translate correctly your footswitch signal to that.
  
 ==== Loops wiring ==== ==== Loops wiring ====
Line 255: Line 253:
   * if send is unplugged and return is plugged, then signal in is ignored   * if send is unplugged and return is plugged, then signal in is ignored
   * if none are plugged, then signal simply goes from send RN/R to return TN/T, which means that the relay state doesn'​t matter.   * if none are plugged, then signal simply goes from send RN/R to return TN/T, which means that the relay state doesn'​t matter.
 +
 +===== Building process, things learned and things I would have liked to be aware of beforehand =====
 +(in progress)
 +
 +  * The SDCC compiler doesn'​t support a variable implementation in .c with '​extern'​ definition in .h nicely. Makes it difficult to design a nice architecture.
 +  * PIC limitations mean that you can't declare variables that use more than 256 bytes in RAM. This is the cause of the unintelligible linker error message "no target memory available for <​something>"​. I had a big struct that I just split into 3 smaller ones, now it's ok. I've looked for an explanation for a long time and only found it in a passing comment on another forum thanks to Google...
 +  * Compiling for the 18f4620 makes the linker output warnings about unrecognized PIC and using the generic PIC18cxx type. The warnings are apparently considered ok to ignore. I personally don't think warnings are ok in any from (and I fixed them, search the forum), but hey, I'm not coding the gputils or SDCC...
 +  * Code::​Blocks doesn'​t filter compilation warnings and errors very well, so it's better to check the build log tab, or you might entirely miss a message, or read only a partial message, when the full description would help.
 +  * It's often better to use a lot of //if// statements than //switch// statements, because the latter have a non-negligible overhead. Also, it is often much more efficient (memory-wise as well as performance wise) to use arrays where applicable.
 +  * Because of the banked structure of memory in the PIC, you should take special care where you put your data to avoid unnecessary BANKSEL instructions (these are the one that select a particular bank in assembly language). Similarly, I found that it's often better to work on a local copy (into a local variable) of a volatile global variable, than using it repeatedly: the compiler has no way of knowing if an interrupt routine has modified it and will read it back too often, including using BANKSEL instructions. Remember that declaring a local variable doesn'​t necessarily mean that there will be some space in RAM allocated for it, it could also be simple registers (it's often the case!).
 +  * The optocoupler in the CORE module (a 6N138) is a fragile thing, so buy a few spares, just in case
 +  * For use as a computer MIDI interface, you really need either a gameport MIDI cable (if you motherboard has a gameport) or a USB MIDI cable. I now know for a fact that my Line6 PODxt and my Boss DR-880 can't be trusted, even though they sport USB and MIDI outputs. The PODxt filters out SysEx messages and I couldn'​t get my DR-880 to forward anything.
 +  * Noise! It turns out that having the DOUT modules chained is a recipe for noise. Specifically 1kHz noise (if that's the frequency to which you set the shift registers refresh). After a hard time investigating,​ this gets fixed by star-grounding the grounds of each module to the ground pin of the big cap connected to the voltage regulator on the CORE module.
 +  * The documentation about MIOS_BANKSTICK functions is unclear about that, but it seems that if you want to use the page reading/​writing functions, you MUST have aligned adresses (i.e. adresses where (addr & 63)==0 ), otherwise all kinds of trouble appear
 +  * I would have dearly loved to know about the watchdog timer (WDT) before, that would have helped me understand why my app kept rebooting while it was trying to initialize the banksticks! Days on debugging have been wasted on this :(
 + 
 + 
 +
wickedblade.1249895945.txt.gz · Last modified: 2009/08/10 09:19 by 195.22.144.22