Portapack application development tutorial (11) Add built-in microphone

Now my portapack has built-in battery + switch and built-in speaker. In order to make it more like a walkie-talkie, I plan to install a built-in microphone.

In fact, a long time ago, the old portapack produced by Xingtian Wireless had a built-in microphone. Later, the new model removed this function.

I am going to add it back now, I have evaluated it and need to change the software and hardware.

I have uploaded the software part to github. Just like the built-in speaker before, I added a software switch. The software switch can switch between the microphone with the 3.5mm headset or the built-in microphone. Its specific implementation principle is to use 56 pins according to the datasheet of the AK4951 sound card chip, 5 pins are used for power supply, and 6 pins are used to receive sound wave signal input.

In addition to changing the software, you also need to change the hardware. A 2k2 resistor is connected to the 5 pin, a 1u capacitor is connected to the 6 pin, and the two pins are connected to the positive pole of the electret and the negative pole of the electret is grounded.

 

The detailed process is as follows:

Here are some excerpts from the pictures in the datasheet. My software and hardware modifications are based on these pictures.

It can be seen that the internal mic, which is the internal mic, uses the three pins of MPWR1 (power supply) and LIN1 RIN1 (left and right channel input). The power supply must pass through a resistor, and the input port must pass through a capacitor. And the resistance and capacitance can refer to external mic, which should be the same.

As you can see in the figure above, the MPWR1 and RIN1 LIN1 we want to use are the 3 pins on the chip, respectively.

According to this picture, the current mic should only be connected to the left channel (LIN2) and power supply (MPWR2), not the right channel (RIN2). In order to simplify the welding steps, I plan to connect the built-in microphone to only one channel RIN1. ,.

Next, take a look at the datasheet and study how to enable the 5 and 6 pins I want on the software.

This is to control the power supply. You can find the microphone-on function called by the original code mictx. Look at the original mpwr-related assignment should be 1. Changing it to 0 will switch the power output from mpwr2 to mpwr1. In addition, pmmp must be 1, so that the power supply will be enabled. You can test it. When you turn on mpwr1, you can measure 2.4v on pin 5.

Here is to select the microphone, the original code should be 0b01, because LIN2 is used, now you need to change LIN1/RIN1 to 0b00.

The other remaining modifications are only the modifications on the interface, which is convenient for operation. You can switch the microphone to be used directly on the interface.

See the video:

https://www.bilibili.com/video/BV16Q4y1A76r

Guess you like

Origin blog.csdn.net/shukebeta008/article/details/106246600