ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Decoders for joystick commands from video game consoles. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers 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. 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. 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. 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. On fig. 3 shows a diagram of another version of the decoder. 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. 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
Author: S.Ryumik, Chernihiv, Ukraine See other articles Section Microcontrollers. Read and write useful comments on this article. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ What is healthy for a cat is death for a mosquito ▪ 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 Barley sowing. Legends, cultivation, methods of application ▪ article Power supply indication block. Encyclopedia of radio electronics and electrical engineering
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |