Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

MIDI keyboard on PIC16F84. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Musician

Comments on the article Comments on the article

The proposed 48-key MIDI keyboard is designed to work in conjunction with a personal computer (PC) or keyboardless synthesizers. It serves 16 MIDI channels. The built-in knob can be used to either control the volume or manipulate one of the 31 controllers. The use of the PIC16F84 microcontroller (MC) made it possible not only to simplify the device circuit, but also to significantly reduce the cost and complexity of execution, abandoning the traditional i8051 MC in this area.

Schematic diagram of the proposed MIDI keyboard is shown in the figure. Its basis is MK DD7, which performs the basic operations of polling all manipulators and organizing a MIDI interface. Multiplexers DD1-DD6 are designed to implement dynamic key polling. Eight subkey contact groups are connected to each of them, and the signal from the output is fed to the corresponding input of port B of MK DD7 (only DD1 is fully shown in the diagram, the rest are switched on in the same way).

MIDI keyboard on PIC16F84
(click to enlarge)

The volume control - a variable resistor R10 - is included in the RC circuit of a single vibrator assembled on a DA2 timer. The position of its engine is determined by the duration of the pulses received at the input of RB6 DD7. The single vibrator is triggered by pulses coming from the RA3 output, which simultaneously controls the operating mode indicator - the HL1 LED. The program that controls the operation of the MK DD7 polls the keyboard. As soon as a key press or release is detected, a procedure is called that sends the corresponding MIDI message [1]. Since the PIC16F84 does not have a built-in universal asynchronous serial transceiver (UART), the program implements the software organization of the MIDI interface using simple shift operations.

When calculating the position of the slider of the resistor R10, its configuration as a controller manipulator or as a volume control is taken into account. In the first case, the read value is compared with the poll recorded in the last cycle, and if the difference is established five times in a row, then the corresponding MIDI message is sent. The position of the R10 resistor slider is digitized by the controller into a five-bit code, and thus the device is sensitive to its 32 different positions. If R10 is "configured" as a volume control, the necessary information is sent along with keypress events.

With the SB49 button, the device is switched to the configuration mode, as indicated by the HL1 LED. In this case, no keystroke messages are sent to the output of the device.

Pressing any of the first 16 keys (i.e., connected to the DD1 and DD2 multiplexers) switches the MIDI channel, any of the 32 others selects the corresponding controller number, which will be controlled by the R10 resistor. If the SB17 key is pressed (its contact is connected to the X0 input of DD3), R10 is configured as a volume control, otherwise (by pressing SB18, SB19, etc.) - as a MIDI-koh-troller keypad, the number of which is assigned by pressing the SA18-SA48 keys (SA18 - controller O, SA19 - controller 1, etc.).

Program codes in the form of a hex-file are shown in the table. The first byte of line 9 (number 29h) is a constant that specifies the number of the note from which the keyboard starts. In the author's version, the initial note is F3 - F of the third octave (note number 41, accepted in MIDI messages). If you use a different keyboard, you should correct this constant and recalculate the checksum of line 9.

The source code of the program and some other additional materials for the article

MIDI keyboard on PIC16F84
(click to enlarge)

The printed circuit board for the device was not developed - Most of the parts (microcircuits DD7, DA1, DA2, resistors, capacitors, quartz resonator) are mounted on a breadboard, all connections are made with MGTF wire. To reduce the length of the harness going to the key contacts, multiplexers DD1-DD6 are installed directly under the keyboard. The power supply connected to the XP1 connector must have an output voltage of 6 ... 12 V at a current of about 50 mA.

With minor modifications, K561KP2 (DD1-DD6) can be replaced by K561KP1 multiplexers. In addition to the PIC16F84 MK, the PIC16F84A or PIC16CR84 can be used in the device. Direct replacement with PIC16C84 or PIC16F83 is not possible. As R10, you can use any variable resistor indicated on the resistance diagram with functional characteristic A. The XS1 socket is a standard five-pin ONTS-VG-4-5 / 16-r (DIN-5).

The keyboard practically does not need to be adjusted and, if the parts are in good condition and there are no installation errors, it starts working immediately after turning on the power. If the position of the slider of the resistor R10 is determined incorrectly, you should select the capacitor C3 and the resistor R11. If you have a sequencer program, you can connect the keyboard to a PC and check the correct operation of the device as a whole. To connect to a PC, an adapter is used that provides optoelectronic decoupling of the interface, for example, similar to that described in [2].

If you constantly use the keyboard with a PC, you can use the switching converter [3] for power supply by connecting it to the +5 V source of the game port. To reduce the current consumption of R12 in this case, it is advisable to replace it with a resistor of higher resistance or to exclude the HL1 LED altogether.

Literature

  1. Studnev A. MIDI keyboard. - Radio, 1993, No. 11, p. 32-34.
  2. Rev N. A simple MIDI keyboard for PC. - Radio, 2000, No. 3, p. 25, 26, 44.
  3. Vlasov Yu. A simple converter with independent excitation. - Radio, 1996, No. 7, p. 50.

Author: A.Borisevich, Sevastopol, Ukraine

See other articles Section Musician.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Free Internet from Facebook 06.08.2014

The Facebook social network, owned by one of the richest and youngest billionaires Mark Zuckerberg (ranks 16th in the Forbes ranking with a capital of $ 32,5 billion), has provided residents of the African state of Zambia with the opportunity to visit Facebook and 11 other sites from their smartphones without charging for mobile traffic. This opportunity was provided in cooperation with the Airtel operator and is available only to its subscribers, the company said.

In addition to the mobile version of the Facebook website (m.facebook.com), including the messenger (m.facebook.com/messages), subscribers are provided with free access to the local version of the Airtel website, AccuWeather, eZeLibrary, Facts for Life, Google, Go Zambia Jobs, Kokoliko, MAMA, Wikipedia, WRAPP and Zambia uReport.

The eZeLibrary website is designed to introduce you to the laws of Zambia and is currently under development. Facts for Life focuses on children's health, Go Zambia Jobs and Kokoliko on local company jobs, MAMA (Mobile Alliance for Maternal Action) on motherhood and family planning, WRAPP (Women's Rights App) on women's rights, and Zambia uReport on fighting the spread of HIV - infections.

Subscribers can access these sites in three ways: through the Internet.org application, having previously downloaded and installed it on an Android smartphone, through the Internet.org website, or through the Facebook application for Android.

"Using the Internet.org app, people will be able to access a range of health, employment and community-friendly resources without charging for mobile internet. We hope this will increase the number of internet users and help them find useful information that they previously was not available," they commented on Facebook.

Free access to 12 sites is the first step in the Internet.org initiative sponsored by Facebook. The social network has enlisted the support of Nokia, Samsung, Ericsson, MediaTek, Qualcomm and Opera Software. Together, the partners hope to make the Internet accessible to more people in developing countries. As part of the initiative, Facebook is also developing communications-enabled drones to "deliver" the internet to far-flung corners of the planet.

Other interesting news:

▪ Platinum atoms oxidize carbon monoxide at room temperature

▪ Clothes with memory will adapt to the owner

▪ Opaque transparency

▪ MSP430 with Full-Speed ​​USB 2.0

▪ A new way to pasteurize milk

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Power regulators, thermometers, heat stabilizers. Article selection

▪ article On the thief's hat is on fire. Popular expression

▪ article Who and when discovered that doctors in hospitals need to wash and disinfect their hands? Detailed answer

▪ article Kupen pharmacy. Legends, cultivation, methods of application

▪ article On-board vehicle control system with speech output of information. Encyclopedia of radio electronics and electrical engineering

▪ article Carrot Sprayer. physical experiment

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024