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

Decoders for joystick commands from video game consoles. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

When developing electronic devices, there is often a need for a convenient remote control panel. In many cases, a joystick from a video game console can serve as such a remote control, you just need to decode its signals. The author of the article managed, using microcontrollers of the AT89 family, to develop very simple decoders for commands given using joysticks from popular video set-top boxes. They can be built into any amateur designs.

The idea to develop microcontroller decoders for different types of joysticks appeared as a result of acquaintance with the article [1]. The "Dendy" joystick signal decoder proposed there is rather complicated (assembled on four K561 series microcircuits), is not protected from the bounce of the joystick button contacts and has a low load capacity of the outputs. These problems were solved by manufacturing a functionally similar device on just one chip - a cheap AT89C2051 microcontroller. Additionally, a function of sound confirmation of pressing the joystick buttons has been introduced, each of which corresponds to a tone of a certain height.

Decoders for joystick commands from video game consoles

The decoder circuit for the "Dendy" joystick is shown in fig. 1, and in table. 1 - firmware codes for the FLASH-ROM of the microcontroller DD1. You can read about the principle of operation of this joystick in [2]. The timing diagrams of its signals are also shown there. The decoder converts them into logic levels at the outputs of ports P1 and P1.0 of the microcontroller. A pressed button corresponds to a low level, not pressed - a high level at the corresponding output. Signals A and B can be removed not only from the pins of the microcontroller indicated on the diagram, but also from its open-drain outputs - lines P12 (pin 1.1) and P13 (pin XNUMX), respectively.

Decoders for joystick commands from video game consoles
(click to enlarge)

The HA1 piezo emitter is designed for sound indication of joystick button presses. Capacitors C3, C4 and a quartz resonator ZQ1 are included in a typical microcontroller switching circuit. Capacitor C1 - blocking power supply, C2 is necessary to generate an initial reset pulse. The +5 V voltage is supplied from the power supply of the controlled device.

On fig. 2 shows a diagram of a decoder for commands given using the joystick of the SEGA Mega Drive-2 game console. A description of this joystick and its signals can be found in [3]. Since the required number of input and output lines of the microcontroller in this case is greater than in the previous one, it was necessary to replace the 20-pin AT89C2051 microcontroller with a 40-pin AT89C51.

Decoders for joystick commands from video game consoles

The firmware codes for its FLASH-ROM are shown in Table. 2. The joystick is connected to the XP1 connector, the decoded commands are removed from the ports P1, PXNUMX of the microcontroller.

Decoders for joystick commands from video game consoles
(click to enlarge)

On fig. 3 shows a diagram of another version of the decoder.

Decoders for joystick commands from video game consoles

It works with joysticks from consoles "Sony PlayStation" and "Sony PlayStation 2". In the memory of the microcontroller DD1, you should download the codes from the table. 3.

Decoders for joystick commands from video game consoles
(click to enlarge)

A little about the principle of information exchange between these joysticks and the decoder. Having previously set a low level on the SEL line, the DD1 microcontroller generates a sequence of five groups of eight low logic level pulses on the CLOCK line on each. The pulses of the first three groups synchronize the exchange of service information via the lines COMMAND (from the decoder to the joystick) and DATA (in the opposite direction). For each of the 16 sync pulses of the last two groups, the joystick responds by setting a logic level on the DATA line, which displays the state of the next button. The order of polling buttons coincides with the order of listing the output signals of the decoder in the diagram (see Fig. 3, from top to bottom). At the end of the polling cycle, the microcontroller sets the SEL line high.

The pin numbering of the XS1 socket corresponds to the version "PS one" specified on the board of the video set-top box. It is possible to connect to the decoder both a conventional digital joystick and a digital-analog ("Dual Shock") joystick. In the first case, the "JoyL" and "JoyR" outputs are always at a high logic level, since there are no corresponding buttons on the levers of the digital joystick.

If necessary, the decoder can be powered with 5 V instead of 3,5 V indicated in the diagram. In this case, the excess voltage is quenched by two KD522B diodes (or other low-power silicon ones).

All three versions of the decoder can be equipped with ZQ1 quartz resonators at any frequency from 4 to 8 MHz. A further increase in the frequency up to the limit for the applied microcontroller is possible, but undesirable, since it is accompanied by a decrease in the polling period of the buttons and an increase in the tone of the sound signals. The polling period is 20 ms at a quartz frequency of 4 MHz. If necessary (it is determined empirically), the survey period can be doubled. To do this, it is enough to connect pins 2 and 3 (see Fig. 1), 26 and 27 (see Fig. 2) or 21 and 22 (see Fig. 3) of the DD1 microcontroller. These compounds are shown in the diagrams with dashed lines.

The proposed decoders will work microcontrollers AT89C51, AT89C2051 with any alphanumeric indexes, such as AT89C2051-12RS. The numbers in the index indicate the maximum frequency of the quartz resonator, MHz, the letters P - PDIP package, S - SOIC package (for surface mounting), C or I - operating temperature range, respectively, 0 ... +70 ° С (commercial) or -45. ..+85 °С (industrial). To load the memory of microcontrollers, I recommend using the programmer described in [4].

All capacitors are ceramic, for example, K10-17. Sound emitter HA1 from the ZP series or another piezoceramic without a built-in generator.

Microcontroller firmware files along with program source codes for all decoder options

Literature

  1. Kuleshov S. Joystick Dendy - remote control panel. - Radio, 2002, No. 4. p. 21.
  2. Ryumik S. Features of the circuitry of eight-bit video set-top boxes. - Radio, 1997, No. 10, p. 27-30.
  3. Ryumik S. Features of circuitry of 16-bit video set-top boxes. - Radio, 1998. No. 5, p. 27-29.
  4. Ryumik S. "Parallel" programmer for AT89. - Radio, 2004, No. 2, p. 28-31.

Author: S.Ryumik, Chernihiv, Ukraine

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Floating atoms to measure gravity 25.11.2019

A group of researchers from the University of California at Berkeley has found a new way to measure the forces of gravity and the effects associated with these forces. The basis of this method is to measure the smallest differences between atoms in a state of quantum superposition, which are held in a "floating" state by laser light inside a vacuum chamber. The Berkeley researchers believe that this new method, in some cases, will be more convenient and useful than the traditional methods of making such measurements that are currently used.

The current standard way of measuring gravity and conducting experiments with the earth's gravity is to drop various objects from a certain height. At the same time, objects are dropped inside vertical pipes, inside which a vacuum of great depth is created and which are at the same time a screen that blocks the influence of a number of external factors on highly sensitive measuring equipment.

Unfortunately, such methods give scientists the opportunity to observe the effects of gravitational forces for only a fairly short time, in addition, the results of such experiments are often distorted by the unintentional influence of external magnetic and electric fields. The new method allows gravity to be measured in a way that does not use any falling or moving objects at all.

To measure gravity with the new method, a cloud of cesium atoms is sprayed inside a small vacuum chamber. After that, with the help of flashes of laser light, these atoms are placed in a state of quantum superposition, separated into pairs that occupy fixed positions in space. Moreover, everything is organized in such a way that one atom of the pair is always higher than the second atom.

The measured value in this method is the value that numerically reflects the wave component of each atom, which, being a quantum particle, has the property of quantum-wave dualism, being both a particle and a wave at the same time. Differences in the measured values ​​of particles located at different distances from the Earth, and allows you to calculate the value of gravity with a fairly high accuracy.

Note that the new method of gravity measurement has a number of significant advantages. With its help, you can carry out measurements for an arbitrarily long time, thereby raising the accuracy of the values ​​obtained. In addition, the same method can be used not only to measure the forces of terrestrial gravity, but also the forces of gravitational interactions between two particles, such as the cesium atoms used in the experiment.

Due to the small size of the vacuum chamber, this chamber is much easier to shield and protect from all possible undesirable external influences. Thanks to this, in the future it will be possible to create a sufficiently portable device that can be used to measure gravity at various points on the earth's surface and make similar measurements from low earth orbit.

A new method of measuring gravity could be an extremely useful tool for scientists working on the problem of dark matter and energy, and allowing to test other fundamental physical things, such as the principle of equivalence.

Other interesting news:

▪ Mobile Spies Deactivated

▪ Smartphone Smartisan T2

▪ What is healthy for a cat is death for a mosquito

▪ Chargers help power grids

▪ Announcement of PCI Express 5.0

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Microphones, radio microphones. Article selection

▪ article Dancing from the stove. Popular expression

▪ article Which city in sign language is represented by two pistols pointing at each other? Detailed answer

▪ article Barley sowing. Legends, cultivation, methods of application

▪ article A simple electronic ballast based on the IR2153 chip. Encyclopedia of radio electronics and electrical engineering

▪ article Power supply indication block. Encyclopedia of radio electronics and electrical engineering

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