Ravager Posted January 14, 2015 Report Posted January 14, 2015 Hi guys, I'm currently in the process of planning a PIC-based capacitive touch device (2D panel, 12cm x 12cm). First and foremost I want to use it via USB but eventually it could communicate via serial connection. So there is a chance it might output data for midibox projects. Wondering what would be the best way of talking to a midibox I had a look at the serial-register-based DOUT modules (e.g. http://ucapps.de/mbhp/mbhp_doutx4_r5.pdf ). So what we have here is an SPI-based communication and a hardware layout for a 2x5 pin header which I could easily use. I'm just having a hard time deciding on what to do with power levels. If no USB power is provided the device could be supplied by the 5V power from the midi box (also made available through the pin header). However, since it's a 3.3V IC a power regulator will have to be used. Easy. But I guess the SPI signal levels from the midibox master will be 5V as well, right? So do you think I'll run into some problems when my 3.3V PIC microcontroller will receive e.g. an SPI clock at 5V? I guess it will always have to send its data (MISO-path) at 3.3V, right? What would be suitable (yet simple!) hardware workarounds to provide a bus interface that is flexible in terms of signal levels? Quote
sneakthief Posted January 14, 2015 Report Posted January 14, 2015 Do you mean something like this? http://www.ebay.com/sch/i.html?_nkw=5v%203.3v%20level%20converter&clk_rvr_id=764133331262&mfe=search Quote
latigid on Posted January 14, 2015 Report Posted January 14, 2015 For a chip solution you could use certain Schmitt trigger ICs that run off 3.3 V but have 5 V tolerant inputs. The 74LVC14A springs to mind, but please check! Quote
TK. Posted January 14, 2015 Report Posted January 14, 2015 Do you want to connect it to a MIOS32 based core? In this case the solution would be easy: use J16 for 3.3V supply, or J19 for 5V supply Best Regards, Thorsten. Quote
Ravager Posted January 14, 2015 Author Report Posted January 14, 2015 I wonder how these eBay PCBs work. You basically only see what could be a bunch of transistors. in theory getting the level down could be accomplished by using a zener diode while amplification could be done by an appropriate MOSFET. (assuming that my device voltage is generated from the host voltage by using a regulator IC) if I let my device operate somewhere between 2.3V-3.3V and assume midibox (or whatever SPI master there is) runs at 3.3V-12V the situation is pretty clear: Device inputs (SCK, LCK, ...) always require voltage reduction (zener diode) while Device outputs (ser data, ...) need amplification. do you think this will work? Quote
TK. Posted January 14, 2015 Report Posted January 14, 2015 It depends on the microcontroller which is connected to the SPI device. Modern microcontrollers are typically supplied at 3.3V, but they have 5V tolerant inputs -> no voltage reduction required. For level shifting (3.3V -> 5V) a 74HCT based buffer is sufficient, see also the MBHP_CORE_STM32F4 schematic (http://www.ucapps.de/mbhp/mbhp_core_stm32f4.pdf) where I'm using a 74HCT541 to shift the outputs levels of two independent SPI ports from 3.3V to 5V I don't know any MIDIbox which requires more than 5V at the SPI port ;-) Best Regards, Thorsten. Quote
Ravager Posted January 16, 2015 Author Report Posted January 16, 2015 I have done some further research. Most of the inputs actually are 5.5V tolerant so I'll just roll with that. The outputs may also produce 5.0V in open-drain configuration when using an external pullup. I'm just not sure whether this is also true for the SOUT pin of the SPI module that is routed through an remappable peripheral pin. So I decided to use a single-channel buffer IC (NC7SZ125). Guess I'll be fine with this. FYI: I'm using a PIC24FJ128GC010 Thanks for your help, guys Quote
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.