Page 1 of 1

Connect guitar to STM32F407 guitar

Posted: Wed Mar 14, 2018 8:51 pm
by pcardoso73
Hello,
I am starting a project on guitar effects. As I already have an STM32F407 which is DSP capable I thought of using it.
As it has a MEMS microphone, I am considering removing to connect my guitar there.
As the microphone outputs a PDM signal (Pulse Density Modulation), I cannot connect the guitar directly to the board.
So I thought of interfacing the guitar, in some way, to output a signal in PDM format.
Is this possible ? Are there dedicated chips for this on the market or do I have to use a microcontroller ? And if the latter is the option to go, are there any examples on how to do this using a small microcontroller ?
Any ideas ?

Many thanks,
Pedro

Re: Connect guitar to STM32F407 guitar

Posted: Wed Mar 14, 2018 10:00 pm
by steved
You might do better to feed the guitar into an analog input on the F407; you might need a simple op amp to provide some gain. Then set an A-D converter going; this will give you a stream of digital values directly.

Re: Connect guitar to STM32F407 guitar

Posted: Thu Mar 15, 2018 8:35 am
by Giovanni
Hi,

A student of mine already did something like that:

https://www.youtube.com/watch?v=B6mewrg1pHA

Giovanni

Re: Connect guitar to STM32F407 guitar

Posted: Thu Mar 15, 2018 11:57 am
by pcardoso73
steved wrote:You might do better to feed the guitar into an analog input on the F407; you might need a simple op amp to provide some gain. Then set an A-D converter going; this will give you a stream of digital values directly.


Could I connect the guitar directly on an analog GPIO and use the internal ADC instead of an external one ?
The voltage of a guitar's can go as high as 2V I guess(for passive pickups). Do you know what's the maximum voltage amplitude that can be applied to an analog port on uC port ?


Giovanni wrote:A student of mine already did something like that

How did he connected the guitar to the uC ?

Many thanks.

Best regards,
Pedro

Re: Connect guitar to STM32F407 guitar

Posted: Thu Mar 15, 2018 2:47 pm
by steved
pcardoso73 wrote:Could I connect the guitar directly on an analog GPIO and use the internal ADC instead of an external one ?
The voltage of a guitar's can go as high as 2V I guess(for passive pickups). Do you know what's the maximum voltage amplitude that can be applied to an analog port on uC port ?

Almost. The voltage on any GPIO must always be between 0V and the chip's supply voltage (usually 3.0-3.3V). The guitar pickup will probably produce a voltage which goes negative as well as positive. Also, it may be designed to operate with a specific load impedance, which the processor may not provide. (And these are problems you might encounter feeding your guitar into any A-D converter). To give you best protection and flexibility, I'd suggest a simple operational amplifier circuit to do the level shifting and amplify (or attenuate) the signal as appropriate. Not exactly software, but something like the Microchip MCP6021 generates a mid-rail voltage as well as having a single op amp. Figures 3.3 and 3.4 in the data sheet show the basic configurations, and a search should yield many more options.