Scheme for connecting a seven-segment 4-bit arduino. Seven-segment indicator. Yak to reconvert the seven-segment indicator

Seven-segment LED indicators are even more popular in the middle of the display of digital values ​​and the storage in the front panels of micro-ovens, pralny machines, digital year-olds, chillers, timers, etc. I’ll look around. To connect a seven-segment 4-bit indicator to a microcontroller, 12 lines of input / output are required. It is practically unfortunate for this to be victorious about the tributes of indicators with microcontrollers from a small number of visnovks. Obviously, it is possible to use different methods of multiplexing (the description of which can be found on the website in the section "Schemes"), or, in general, it can be used for the skin method, and it is often possible to use folding software algorithms.

The method of connecting the indicator behind the SPI interface is easily understandable, which is less than 3 lines of input / output of the microcontroller. At the same time, take care of keruvannya with all segments of the indicator.

To connect a 4-bit indicator to the SPI microcontroller of the bus, a special microcircuit driver is used. The microcircuit is built with seven-segment indicators from a remote cathode and a BCD decoder, segment drivers, multiplexing circuit and static RAM for securing the value of digits.

The strum through the segments of the indicators will stand without one additional resistor. An additional microcircuit is used to control the control of indicators (16 rubles) from the driver of the induced PWM.

The statistic diagram is displayed - the whole diagram of the display module with the SPI interface, which can be victorious in radio-amatory constructions. It’s not the circuit itself, but the robot with the microcircuit behind the SPI interface. The life of the +5 module is supplied to the Vcc connection, the signal lines MOSI, CLK and CS are designated for the commune of the meister-attachment (microcontroller) under control (MAX7219 microcircuit).

The microcircuit is installed in the standard included, from the primary components only a resistor is required, which is set through the segments, the supply diode is supplied and the capacitor is filtered, according to the life.

The data is transmitted to the microcircuit in 16-bit packets (two bytes each), which are placed at the insertion of a 16-bit register of the sensor along the skin front, which builds up the CLK signal. 16-bit packets are meaningful D0-D15, children D0-D7 are given data, D8-D11 are assigned to the register address, bits D12-D15 are not meaningful. Bit D15 - senior bit and the first accepted bit. If you want a microcircuit, you can use it with indicators that can be seen by the robot if you don't need it. They can be controlled at the DIG0 - DIG3 inputs, which have been inserted at the last right-hander, 4-bit addresses (D8-D11), which are displayed, the price is 0 × 01, 0 × 02, 0 × 03 and 0 × 04 (wіst. The register of digits is implemented on the basis of a built-in RAM with 8 × 8 organizing and can be addressed without prior notice, so the skin on the screen can display a number at any hour. At the beginning of the table, there are numbers and the register of control of the MAX7219 microcircuit.

Registry

Addresses

HEX-value

Ні operations

Decode mode

Number of indicators

Vimknennya

Indicator test

Restri management

Circuit MAX1792 with 5 control registers: Decode-Mode, Intensity control, Scan Limit, Display and Shutdown control.

Updating and displaying microcircuits

When feeding to the microcircuit, all registries are thrown off, and they are reset to Shutdown mode. In this mode, the display is displayed. To switch to normal robot mode, it is necessary to set the D0 bit to the Shutdown register (addresses 0Сh). If you can beat it, you can get rid of it, you can translate the driver from the receiver, and with all the registries it will be immutable. This mode can be set for economy of energy or in the signalization mode of the indicator flashes (the last activation and deactivation of the Shutdown mode).

The transfer of the microcircuit to the Shutdown mode is activated by the last transmission of the address (0Ch) and the date (00h), and the transfer of 0Ch (address) and then 01h (data) will turn to the normal mode of the robot.

Decode mode

For the additional register selection, decode mode (addresses 09h) can be used to decode BCD code B (displaying symbols 0-9, E, H, L, P, -) or without decode for skin digits. Skin bit at the register will display one digit, setting a logical one for displaying the included decoder for this series, setting 0 - the decoder will be enabled. If the BCD decoder is victorious, then it is taken until the youngest napivbyte is given from the registers of digits (D3-D0), when D4-D6 is ignored, when D7 does not lie in the BCD decoder and displays D7 points for 1 dozen. For example, when the last bytes are sent 02h and 05h on the DIG1 indicators (another type of right-handed people), the number 5 will be displayed. The lower tables have a new list of symbols, which are displayed when the microcircuit decoder BCD is displayed.

Symbol

Dani from registrakh

Included segments = 1

Empty

*Desyatkova point to stand up with bit D7 = 1

When the BCD decoder is turned on, the robots bit these D7-D0 indicate the lines of the segments (A-G and DP) of the indicator.

Management of indicators

The microcircuit allows the programmatically keruvati to clear indicators at the viglyadi in the wired PWM. The mode of SHIM is controlled by a young napyte (D3-D0) register Intensity (addresses 0Ah), which allows you to set one from 16 rubles. When all the bits are set to 1 byte, the maximum brightness of the indicator is vibrated.

Number of connected indicators

At the Scan-Limit register (addresses 0Bh), the number of sizes will be set, which can be serviced by a microcircuit (1 ... 8). For our version with 4 discharges, the register of maє buti has the value 03h.

Indicator test

The register, which is based on the mode, is located behind the address 0Fh. Installing bit D0 in the register, the coristuvach includes all segments of indicators, with all the registration of the control and data does not change. To enable the Display-Test mode, bit D0 is at fault for 0.

Microcontroller interface

The indicator module can be connected to any microcontroller, which has three input / output lines. Also the microcontroller of the device is an SPI device module, the indicator module can be connected as the setting on the bus. In addition to the SPI signal lines to the SDO (serial data out), SCLK (serial clock) and SS (slave select) microcontroller interface, there can be no connection to the MOSI, CLK and CS microcircuit low-voltage signal (module)

Since the microcontroller is not a hardware SPI, the interface can be organized programmatically. Recall from the MAX7219 microcircuit to fix the low level setting of the CS line, for which 16 bits of data are applied last (the most significant bit is transmitted first) to the MOSI line on the rising signal. Upon completion of the transfer of the CS line, a high standard will be established.

In the section, you can add the original text of the test program and the HEX file of the firmware, in which a special 4-bit detector can be implemented from the displayed value on the indicator module with the SPI interface. Vikoristovuvaniy microcontroller - an interface for software implementation, signal lines CS, MOSI and CLK of the indicator module connected to GP0, GP1 and GP2 ports, apparently. The microC compiler for microcontrollers PIC (mikroElektronika

To comment on materials from the site and reject general access to our forum, you need dawn .

Have a nice day! With a long and long time, interrupt the progression of mastering the course "Programming Arduino". In one of our previous lessons, we also worked on the last of the lights, now the instruction is going on for an hour to the onset of the beginning. The theme of the current statistics will be a 7-segment indicator.

Knowledge with a 7-segment indicator is available from two parts. In the first part, it is on top of it that it is "punchy" in theoretical warehouses, perhaps with "zalizom" and it can be written in simple programs.

Just the last time we started from the last of 8 svitlodіodіv, so also will be 8 (7 - svіtlodіodnykh smudge and 1 point). On the basis of the forefront, the elements of the set are not prompted in a row (one after the other), but in the singing order. Zavdyaki chomu, vikoristovuchi deprived of one component, you can enter 10 digits (from 0 to 9).

Another one of the most common indications is that the indicator is seen on a number of simple light-emitting diodes. At the new one there is a cathode (in the middle of the house). It is enough if one is from the cathodes from the earth ( GND). Anode for all elements of the individual indicator.

Small ledge. All of them are said to be carried up to 7-segment indicators and from the external cathode. Protect the indicator from the external anode. Connecting such indicators can be seen in the sutta, so I ask you not to cheat "the sin of the righteous." It is necessary to have a clear sense, which is the very type of a seven-segment player in your hands!

There are a lot of indications between simple LEDs and 7-segment indicators, є. For example: indicator, like і svitlodiodi, can be mounted in a row (last) for displaying two-three-, chotiry-digit numbers (rows). However, the Raja is not very fooled by the drive of self-assembly of segment sets. We sell "order" with single-grade indicators, on sale і bagato-graded indicators.

I am encouraged, you didn’t forget about the need for strum interchangeable resistors when plugged in. There are indicators: a resistor is responsible for the skin element of the indicator. 8 elements (7 + 1) - 8 resistors.

In my hand, a seven-segment device with 5161AS markers (external cathode) appeared. Contacts:



Schematic diagram

Saying earlier, in order to turn on the segment "A", it is connected to any spil contact (3 or 8) "ground", and on top 7 it will be fed 5B. If the indicator is from the external anode, then 5V is supplied to the anode, and to the "ground" segment!

Take a test stand. Dart one by one in order, repairing from the first nizhka, if you pay Arduino for another piece of paper. The ground is pluggable up to the 8 indicator.

In addition, as a stand of images, you can start before writing the firmware.

To reverse the indicator, I have written a program that is runnable. Viberemo element "A" і pomorgaєmo їm.


Now it flashes with the number 2.

To enter one number, you need to write n-number of rows in the code. Difficult, you don’t know.

І іnshy shlyakh. In order to put a number on the indicators, it is necessary to present a collection of it at the singing end of the bit.

Consistency table.

If the display lacks an anode, then 1 needs to be replaced by 0, and 0 - by 1!

One hundred percent hex - representing a digit in a byte view (we will talk in more detail about it in another part).

A number in two numerical systems can be written as follows: 0b00000000. 0b- Dviykova system. Zeros mean that all svitlodiodi vimkneni.

When plugged in, visnovki z 2 to 9 were inserted. 0b00000001. For the speck of the quarters, the right-handed person is bit. For a line in the middle of the indicator, a stop bit is displayed.

We write the butt of the figure 0.

To change the number of recruits in a speedy cycle, you can change all 8 bits. Zminnoyu Enable_segment to see the meaning of the bit, to read it. When the current flow is set, it will be in the standby mode ( in the presence of a signal).

Note: the bitRead () function reads the set of the specified bit and the rotation of the value of the set (0 or 1).bitRead (x, n)de, x - Number, bit, which needs to be respected; n - the number of the bit, the mill is required for rahuvati. The numbering is to be recited from the youngest bit (extreme right) numbered 0.

І for the completion of the first part, we will write a small chapel.

In an hour, the radio technology and electronics appeared, the ringing ring of the electronic annex that people supervised with small signal lights, buttons, toggle switches, bells (the signal of readiness of the microchvil's stove - dzin!). Deyaki electronic devices see a minimum of information, more will be used. For example, svitlodiodik, why should it turn up, at your Chinese phone charger to talk about those who charge is included in the net and in which there is a spill. Ale є y such parameters, for which bulo will be more efficient, I will be able to provide an active information. For example, the temperature on the street is the hour for the alarm clock. So, all the price can be used to light up also on light bulbs or light bulbs to light up. One degree - one ignition diode or a light bulb. The degrees of degrees are the style of indicators that can burn. Vvazhati svitlyachki - tse on the right may be tricky, but alas, you still need such svitlyvs, how to show the temperature to the exact tenth part of a degree? That vzagal, how would I occupy the area with light bulbs on an electronic device?

Practical seven-segment attachments for the visualization of the mother's guilt for at least eight lasting clews; Seven of them give access to some photovoltaic segments, and eight of them provide access to additional photovoltaic segments. The first display of the visualization of the display has a seven-segment display of the posterior anode; in the last drop of the display with a backward cathode.

When the keruvati display is from the back anode, the driver is guilty of the active-low output, in which the skin segment is driven by the high, alley low, the high is the segment. The driver is responsible for the active active output.

The first axis on the cob of the XX century, with the appearance of electronic lamps, the first gas-discharging indicators appeared.

With the help of such indicators, you can display digital information in Arabic numerals. Earlier, on the cix lamps, they robbed the indicator for attachments and other electronic attachments. There are no gas-filling elements that can get stuck nowhere. It’s a bit retro, it’s always fashionable, because there’s a lot of radio amateurs to pick up wonderful years for themselves and their loved ones at gas dischargers.

Outside of the explanation of the trocha, it is foldable, in such a way. If there is zero spill, the segment is practically invisible. However, if the spikes at the inputs are more positive or negative, the segment becomes effectively visible, but if the drive takes longer than a few hundred milliseconds, the segment can be permanently visible and not significant.

At the drain, the segment is included. In such a rank, the segment of inclusions in the qikh umovakh. Qia form to the drive zzvychay vіdoma yak system "bridge drive" with podvoєnnya springs. The sequence of the processes of the scheme is offensive. A simple cascade system, described earlier, is susceptible to a serious defect, the display will grow old for the hour of the actual period of time, but it will be stable and readable if it is a skin closure and an input shutter. Tsey "rozmitiy" type of display duzhe dratє, schob be amazed.

Minuses of gas-discharge lamps are a lot. We can talk about good fortune and talk about it. In our univeris dosi at the laboratory's cabinets, they operate the frequency on the gas dischargers.

With the appearance of light, the situation has changed dramatically. Svitlodiodi themselves eat a small strum. As soon as you place them at the required position, then you can see if information is available. All the Arabic numerals are enough for the visibility of all Arabic numerals. sem (stars and name seven-segment indicator) svitlodіonnykh smudge, how to curl up, in the singing rank:

On little 13, the diagram of the frequency detector is shown in detail, like a vicorist blocking of the display for podolannya vyshezdanny defect. Qia scheme pratsyuє in such a way. One hour, the input shutter is opened, and the doctors repair the input signal. The detector is triggered immediately after one second, and by stretching the period of the chotiribite clamps, the outgoing signals of the detector are not allowed to come to the display drivers; the display becomes stable during the period.

After a few seconds, the last is repeated, at the same time, the patients are re-enrolled, and then the pulses of the input frequency are released and for one second, stretching out the display gives you a continuous reading of the results in the foreground, etc.

as far as all such seven-segment indicators are added, the same is the eight segment - a point, for this purpose it is possible to show the whole and the fraction of the value of any parameter

In such a rank, the scheme of the baby 13 flaps a stable display, which is updated once a second; On a practical basis, the actual period of seeing that circuit on a tiny 12 can be broken in a ten-year period in a multiplier or an incomplete number of seconds, for thinking that the output display will be scaled by a certain rank.

Beat the respect, that the three-digit frequency scale can be used for a maximum frequency of 999 Hz with a one-second base, 99 kHz with a 100 ms clock base, 9 kHz with a 10-ms clock base and 999 kHz base.

an eight-segment indicator is used for the ID, or, in the old way, it is also called a seven-segment indicator, and it’s not a good thing.

A shorter, seven-segment indicator is a chain of svitlodiodi, rostasovani one and one in the singular order and proprietary in one case.

The whole method can be seen behind the other kids 14 and 15. It is acceptable that the pump is in position.

Through a splinter of quill, pass the changeover at position 3, display the number 3 snarlingly through a splinter of quill, the whole cycle of repairs is repeated again and again, and so far, until there is no end. In practice, it is close to 50 times of cycles, the skin is displayed for a second, the eye does not batter, the displays are connected and the display is displayed ok, but the display is clearly stable, which shows the number 327, which is the same number of the given dictations.

If you look at the diagram of a single seven-segment indicator, look at the axis like this:

Yak Bachimo, seven-segment indicator can be used as the back anode (OA), so i s by the galactic cathode (OK)... Roughly, it seems that if we have a seven-segment device with a backward anode (OA), then the circuits are guilty for a chain of closures, there is a "plus", and like a backward cathode (OK), then there is a "minus" for the earth. On a whim we will give a spring, such a light will light up with us. Let's demonstrate this in practice.

In practical multiplexers, the display stays high enough to keep the display clean. On fig. 15 readings of the butt endowed with the multiplexing method, which can be stuck up to a three-digit frequency. Tsei method of maє dvі basic perevagi.

As long as the terms are active, they smell like characteristics. Fig. 18 and 19. On baby 18, the technique of suppressing pulsations is shown, which is used to preserve the suppression of cob zero on a chotiry-valued display that reads the number.

We have an axis of such light indicators:

Yak bachimo, seven-segment players can be single and bagator-sized, tobto two, three, seven-segment players in one building. In order to convert the current seven-segment device, we have enough multimeter with the function of prodzvonyuvannya dіodіv. Shukaemo zagalny visnovok - can be OA or OK - by the tick-of-the-box method we are still amazed at the patronage of all segments of the indicator. Reversed three-row seven-segment:

In such a rank, the screen appears. By the way, the stench is simple at the victorian, to induce the stench at the house, and to sleep the stench. The stench can be cute, because they have something like polarity, but it means that the stench will get rid of it, if you switch it on correctly. As soon as you see positive and negative thoughts, the stench does not catch on fire.

Dratuє, so vono і є, tse tezh even karyno. The first wire is the cathode. The cathode is closed from the earth. In principle, we go all the way. For a spiral cathode, apply a strum to the contacts, as a result of the connection. Multiplexing. In order to find the display controllers, you don’t need to bother about mixing up your software security.

Oops, we have knocked one segment out of the way, in the same order of the inverted segment.

If you don't want to play a cartoon, you will need to reconvert the segments of the indicator. The unit of living is taken by, it is installed on a new 5 Volt, the resistor is 1-2 kiloOms to one terminal block, and the seven-segment device is changed.

7-segment display control

If you have є 4-digit multiplexes, 7th segment, the back anode. First, my guilty nobility, what type of display we have є, fragments є two possible forms: a back cathode and a back anode. Speech that you need to learn for a lesson. Zliva: graphical viewer of a 7-segment display, which shows one headroom for internal wiring and rozstashuvannya contacts.

At the end of the stage, I have to pay respect to the out-of-the-box application, you will know a little about it when the programs are locked up. Yakbi display buv with a single cathode, mi used to eat yogo. At the lower part of the statty there is a photograph of the circuit shown on my board to the prototype. We also need a library for more than one display.

What do we need a resistor? When feeding the light to the power supply, the repair will start quickly when it is turned on. At the same time, it can burn out. The wire is enclosed by the strum, after which it is inserted into the lance of the resistor. The report can be read at the tsy statty.

Pidrakhunok at sixteen view on one 7-segment display

Inadequate є those who stink є resource intensive. A specific display is a two-mark digit and two displays are two-mark. However, it will also preserve the digital control of the display brightness through an internal wide-dark modulator. Such views can have views on only 7-segment displays.

Tse zaoschazhuє contacts on the body, and then on the control. Apparently, the display will look like a back-to-back anode or a back-to-back cathode. Visnovok, which is shown to a segment, or dozens of points, is best suited for displaying tributes. 7-segment display, such as insurance for a specific 10-20 mA, as earlier, in order to be weak. For others, it is not necessary to sign contacts. The distance of the rozpodіl tsiy segment runtutsya on.

So it is itself an inverted chotirirozryadny seven-segment player from a Chinese radio receiver

I think that it is not to blame for the special difficulties of the winter. In circuits, seven-segment devices are connected from resistors to the skin. The chain is tied together with that, when svitlodiodi, when giving a spur to them, chew the strum and vigoryayut.

Iakshcho vikoristovuyutsya on the basis of the meaning, it is only in principle, but later in the program. The revision of the surrounding numbers to a specific template can be seen behind the help of the so-called. All of the segments may be dark. As a forerunner of the provisions for all the numbers, the table has been set.

Test programs will display digits from 0 to 9 on a 7-segment display last. The item number is stored in the registry nurse and increases by 1 at the boundaries of the cycle. As the register of dosyag is 10, I know to skip to 0. The cycle of admission is a cycle of cleaning, which is the guarantor, that the first hour to pass the offensive release. Call and do not ruin such new cycles of cleaning, but not about cleaning, but control of a 7-segment display. Vikoristovuvati timer for tsiyo - tse nadto bagato zusil.

In our day-to-day light, the seven-segment players are already interested in LCD indicators, which can be absolutely free of information.

But in order to be able to get away with it, you need a little more help from the circuitry of such attachments. The rest is simpler and cheaper for a single seven-segment indicator of nothing.

p align = "justify"> The actual problem і, also, tsіkava in th statty part, however, it is necessary to read the cycle without the middle. Beast of respect, as the meaning of a pilot can be a subordinate. Tse bezposeredno tied with this, why flash memory is a verbal character, and not byte-wise. The other butt on the same side is trying to get rid of it. There it is shown how, for an additional record of the table, the generation of bytes can be stored by an assembler. Tsіkavo also, for rosrakhunku, a register is required, to revenge the value 0.

Also, this constant is to blame for being included in the register and only when added to the register. It’s a fact that the fact is recorded in the programs, and the constants in the large number of views are constant 0. That’s a lot of programs to reserve the register from the ear itself for the whole and call it a zero register.

We will talk about digital indication at the top of the article.
Seven-segment LED indicators for displaying Arabic numerals from 0 to 9 (Fig. 1).

Such indicators are single-sized, as they represent only one number, or seven-segment groups, combined into one building, maybe more and more (bagator-sized). At the same time, the digits are subdivided by a decimal point (Fig. 2)

It's a pity, є a problem, because for the image, you need a lot of ports - there are 32 ports. Ale є kіlka shlakhiv. Zsuvny register is also described in the іnshіm handbook. The price has made it possible to set the required 32 out-of-order lines for three times. The principle of control does not appear to be from the control of one 7-segment display, only those like "vicinities" come up to the same meaning, as they appear and appear on victors of the last registries. At the given moment, however, there is no evidence of the first control option.



Fig. 2.

The indicator is called seven-segment through those that the symbol that is displayed will be around seven segments. In the middle of the body of such an indicator there is a light, a skin segment.
Letters and інші symbols on such indicators are problematic, so for the whole of it there is a 16-segment indicator.

The bottom can be multiplexed more times. Multiplexing means that not all displays turn on immediately, but only for a short hour. As soon as the change between the displays can be seen more, less people can take off, all the indicators, it seems, start at once, I want to see only one for one short hour. Thus, some displays can distribute around a segment of a segment, and everything that is required is 4 additional control lines for 4 displays, with bright display inclusions.

One aspect of control is the multiplexing frequency, which is a repeated cycle of transition from one display to the other. Guilty, but it’s the top one, and the only way to unite the display. Lyudske eye mlyava, in the cinema 24 frames per second, with a TV set, you will be on the safe side, but also the image is not very good, the skin segment is to be controlled not less than 100 Hz, so it is necessary to switch on the skin, take 10 minutes. In vinyatkovyh vipadkakh, however, to navit 100 Hz more and more can measure, for example, if the display collapses quickly, or if there is a transition from the piece djerels of the light, as it works with a wintry stream.

There are two types of LED indicators.
The first one has all the cathodes, tobto. Negative images of all lights, displayed at once and visible on the case.
The insignia of the indicator from the bottom to the anode of the skin svitlodiodiv (Fig. 3, a). Such a circuit is called the "external cathode circuit".
Likewise, the indicator, in some of the cutaneous light segments, is connected behind the circuit with the posterior anode (Fig. 3, b).



Fig. 3.

The skin segment of meanings is a type of letter. On little 4 is presented їхнє roztashuvannya.

Fig. 4.

Yak butt is easily visible, seven-segment indicator GND-5622As-21 red light. Before speech, іsnuyut and іnshі colors, fallen asleep from the model.
For the additional tri-volt battery, you can turn on the segments, and if you add a group of visnovks to the purchase and the tax on them, you can display the numbers. This method is not handy, so for control of seven-segment indicators it is easy to register the register with the help of the decoder. Also, it is not easy, the indicator plugs are switched on without prior to the microcontroller's inputs, but if the indicator is turned on when the indicator is low. On a little 5 views, a fragment of the diagram from the vicistories PIC16F876A.



Fig. 5.

To control a seven-segment indicator, the K176ID2 decoder is often victorious.
The microcircuit is designed to rewrite the double code, which can be stored from zero to one in dozens of digits from 0 to 9.

To make it clearer, like a trick, you need to use a simple diagram (Fig. 6). The K176ID2 decoder for the DIP16 building. Vіn maє 7 vyhіdnyh visnovkіv (visnovki 9 - 15), skin signs for the singing segment. The point control is not transferred here. Also the microcircuit can be 4 inputs (patterns 2 - 5) for giving a double code. On the 16th and 8th visnovok, it will be served plus that minus gratis. There are three additional ones, about which I will tell you a few more.



Fig. 6.

DD1 - K176ID2
R1 - R4 (10 - 100 kOhm)
HG1 - GND-5622As-21

The circuitry has 4 tumblers (you can have buttons), when they are pressed on to the inputs of the decoder, a logical one will be supplied to the plus. Before the speech, the microcircuit itself can live from 3 to 15 volts. At the same time, the whole scheme lives on as a 9-volt "crown".

The circuitry also has 4 resistors. It’s so called resistor, so it’s going to pull. Stink of consumption, sob guarantee at the logical entrance a low level for the daily signal. Without them, the display may not appear correctly on the indicators. Recommended to be victorious, howeversupport from 10 kOhm to 100 kOhm.

On the schematic diagram 2 and 7 of the HG1 indicator are not connected. If you connect to the minus of the DP connection, then the decimal point is displayed. And if you pay a minus on the pattern Dig.2, then there will be another group of segments (show the same symbol).

Enter the decoder in such a way that for displaying the numbers 1, 2, 4 and 8 on the indicators, you need to press only one button (on the model, the tumblers are installed, showing the inputs D0, D1, D2 and D3). The number zero is displayed at the time of the signal. When a signal is given to input D0, the number 1 appears. And so far. To display these numbers, a combination of tumblers is required. And as soon as the onslaught us, see also Table 1.


Table 1.

If you want to display the number "3", you need a logical unit of tax to enter D0 and D1. If you give a signal to D0 and D2, then the number "5" will appear(Fig. 6).



Fig. 6.

Here is an expanded table, yak bachimo yak ochіkuvanu figure, and th tі segments (a - g), which add qi figure.



Table 2.

Additional є 1, 6 and 7 microcircuit patterns (S, M, K as appropriate).

On the diagrams (Fig. 6) the 6th connection "M" of grounding (on the minus of the grounding) and on the outlets of the microcircuit is a positive spring for the robot with the indicator from the back cathode. If the indicator is victorious from the back anode, then on the 6th time the tribute is one.

If on the 7th sign "Until" the tribute is a logical one, then the indicator symbol is extinguished, zero allows indication. At the circuits of the grounding connections (for the minus).

A logical unit (plus liveness) is supplied to the first decoder window, which allows the conversion of the code to be displayed on the indicator. If the tax on the line (S) is logical zero, then enter to stop accepting the signal, and on the indicator you will see the exact sign.

Varto respect one tsіkava rіch: we know that the D0 toggle switch should replace the number "1", and the D1 toggle switch - the number "2". If you hit the tumblers, then the number 3 will hang (1 + 2 = 3). І in інshih vypadki on the indicator there is a sum of numbers, which becomes a complete combination. We are coming to visnovka, so the input of the decoder has been thought out and even more logical combination.

You can also look at the video to the full article.

On the way to the working people, I will tell you about the miracle of riches for the name of the 7-segment LED indicator. For a cob, scho tse take. The axis is such a thing. There is only one discharge, so it itself will be two, three and three. Bachiv sh_st number of razryadnyh. Pislya dermal discharge is worth a dozen point. As soon as there is a choice, then more often than not, for another order, you can create a two-mark for the indication of seconds at a given hour. Having chosen from the keys, let's move on to the scheme. It also has dynamical indication and for whom it is necessary. So, as the indicator is 7-segment, for the display of the figure it will be victorious in all 7 segments. The stink comes from Latin letters A, B, C, D, E, F, G and DP Marveling at the picture. From the skin segment of the svitlodiod retouching. All svitlodiodi one end of the meeting. For the anodes and cathodes, and the prototypes are called vivedens. It is easy to note, but for the representation of the figure, you need to pick up 8 visnos. One zagalny that sіm for segments. As long as there is a single charge, then there is no need to think about it, it's just that everything is done on one port. And what about the chotiri? We are multiplied by the chotiri thirty-two. Oh ... So over such an indicator 32 mega there will be one corpus. So rіch not go. Є two solutions. Our dynamic indication is static. Let's get out of the way, let's see how the indicator is turned on.

Qi scheme of transmission to dynamical indication. That I am all dynamic that static. What is the difference ?. Static indication - even if the skin discharge was set to burn continuously after its own number, and dynamic - even if the number was on the first discharge, then it was extinguished and on another discharge, and then it was irreparably extinguished. end the discharge. The last shot is passed over again to the first one according to the stake. As soon as it’s possible, it’s possible to back up the digital row, to run, and if it’s up to 50 Hz, then it’s impossible to beat the eyes. The axis in such a rank is dynamic and dynamic. Let's break down the diagram. Lіvoruch MK ATmega8 behind it on port D to hang the microcircuit 74ALS373. What is needed now? On the right in that, the indicator is just 8 lights in the matrix. So the indicator can be paid at the line of 8 lights. And as a result of the visit to the MK of the go. It is obviously not possible to connect without the middle, or rather put it in the MK and with an indicator of some kind of repeater. Axis for cich targets I and virishiv vikoristovuvati 8-bit buffer from suction. Why yogo? Because of the fact that the indicator is a vicious one from the back anode, so that for the figure the active level is 0, then you can quickly pick up the ULN2003A microcircuit (7 transistor blocks for the Darlington circuit ...) The ULN2003A can only be used with an NPN transistor on board, and I can only use an indicator with a back-to-back anode, but what if I need to use a back-end cathode? The axis is here and a buffer is also available, so I'll write here, then I'll be on the go. You want 0, you want 1. The controllers are connected to the translator mode. That is, the buffer is transferred to the input of those who are at the input. Ala pseudo-galvanic connection. The buffer is followed by the interleaving resistor. Remember to burn light without resistors. The nominal resistors are required to be selected less than, not permissible. On the right, there is a dynamic indication of the symbolism with the same frequency and with the same PWM, that is, what is the frequency, what is the contrast. І with the most comfortable contrast of the numbers, three are dark. Tom resistor needs a brother of three smaller nominal. I am a vicarist of 360 Ohm only because I have such a boule in manifestation. Distant from resistors є our indicator. From the side, de anode, I plugged in the first choice of discharges to port C. So, with the circuit, we were able to use it. Now the algorithm of the programs is discussed. In order to turn on the indicator by turning on the indicator, it will be written in the context of the function and indefinitely in the main program. Specifically, the function can be adjusted from 0 to 9999, you can select it on the discharge and then change the skin discharge to your own miscellaneous. If the number is less than 4, then the empty blanks will be filled with zeros. Rivnyaєmosya from the right edge. Bigati by ranks to the right. If you can see that it’s like it’s, then it’s a bit of a change from a chick, once for a second the number is changed by one. So zavdannya put before the battle. #define F_CPU 7372800UL // Frequency to quartz #include #include #include volatile unsigned int test = 9980; // Change for displaying on the indicator ISR (TIMER1_COMPA_vect) // A sample of the interchange of timer 1 (test ++; // Get the number to be returned if (test> 9999) test = 0; // Yaksho viyshov for between chotir rozryadiv, reset TCNT1H = 0x00; // Skidannya register TCNT1L = 0x00; // Rakhunki ) void dig_out (int num); // Deafening function displayed on the indicator int main (void) (DDRC = 0x0F; // Nalashtuvannya port_v DDRD = 0xFF; // for a robot with an indicator Port C for sockets, Port D for numbers TCCR1A = 0x00; // Setting up the timer TCCR1B = 0x04; TCNT1H = 0x00; TCNT1L = 0x00; OCR1AH ​​= 0x70; OCR1AL = 0x80; TIMSK = 0x10; sei (); // Calling override while (1) (dig_out (test); // Permanently wikiterate the function of the stream number )) void dig_out (int num) // Functionality for the indicator of 4 rows (unsigned char i = 0; // Change of the doctor unsigned char raz = 1; // Number of the series unsigned char dig_num = (0x40, 0x79, 0x24, 0x30, 0x19, 0x12, 0x02, 0x78, 0x00, 0x10); // Code of digits for the indicator from the back anode unsigned char dig = (0, 0, 0, 0); // Array for the value of the row if (num (dig = 0; dig = 0; dig = 0;) if (num // For filling with zeros of all rows (dig = 0; dig = 0;) if (num // For filling with zeros of all rows (dig = 0;) while (num> 999) // Otrimannya number of thousand (dig ++; num - = 1000;) while (num> 99) // Take away a few hundred (dig ++; num - = 100;) while (num> 9) // Reject the number of tens (dig ++; num - = 10;) dig = num; // Removing the number of one while (raz // The spinning pokey is not remembered for all 4 discharges (PORTC = raz; // Vibiraєmo rozryad PORTD = dig_num]; // Vivodimo digit raz = raz // Zsuvaєmos on the onset i ++; // Zbilshuєmo index of the advance digit _delay_ms (1); // Cover up 1 ms } } Axis and all code. I won’t decipher it, there are some comments to the skin row. Below you can add archives to the AtmelStudio6.2 project. If you still know the food, we kindly ask you to go to the forum. Well, for the most popular ones, the lower video of all the balalaikas))).

In the current statistics, we will talk about 7-segment indicators and about those who make friends with Arduino. Є kіlka options. Simplest, crazy, tse go to і buy a ready-made indicator with an integrated shield (this is the name of the unit), but it’s not shy of light nobles, because of that we’ll fold. Newbies - do not kick around, tsya statty, like in front of my statty (і ) for you. Don't let the guru write for the same newbie gurus, and I'm a beginner - I write for the newbies.

Why is a 7-segment indicator itself? There are also simple styles of be-like screens, with a great number of symbols, rows, versatile diagonals and permissions, black-and-white and color-rich, found available from which cost a couple of dollars. segment indicator, albeit still an overwhelming є і from the tsy "old". On the right in that, by pointing sketches here, you can revive not only the indicator with 14 mm digits, but only project, and the meters of the digits in this vipad are far from between. The inhabitants of the capital may not be so tsy, but the axis of the population of Novokatsapetivka, or the Lower Kedryvka, will be gladdened, as a year may appear on the club of chi silyradi, as soon as the date can be displayed, say the temperature, but about the year of the creator of the future. Ale, podbniy godinnik topic okremoi statti: bude bazhannya u vidviduvachiv - I'll write. All vische can be written in the entry. Yak and passed my statty tsya folds up in parts, once in two. In the first part, it is simply “keruєmo” as an indicator, and in the other part, it will try to preserve it for chogos, I want the trocha corianne. From the same, it is possible to continue:

Part of the Persha. Experimental - educational

As a basis for the given project, we have already taken the good knowledge behind the previous articles ARDUINO UNO. I guess, you can do it the best way here: but here: Besides, there is a 4-digit, 7-segment indicator. Me, zokrem, GNQ-5641BG-11. Why do you mean it? It’s just that, after having bought it on the 5th day, it’s easy to get rid of it, the axis of wine and it’s been lying around the whole hour, checking at the right time. I think it’s possible to go through a transient anode (because it’s possible to use a transom cathode, but it’s possible to get a tribute to the massif and the meaning of ports invertuvati - so that we don’t need to try to get out of it), but we don’t need to strain In addition - 4 strumming resistors, approximately 100 Ohm skin and shmatok a loop (less than 10 cm) for 12 pins (veins) can be removed from the wider, which is the most powerful. And you can pay with some wiring, there will be no problems. I would like to use the wiring on the board (11 pcs), as it is neatly possible without them. Eskiz indicator can be hit on a small 1, and the circuit on a small 2. Also, I mean, on the skin segment of the indicator it is more beautiful to feed not more than 2.1V (it is surrounded by 100 Ohm resistors), and in general, it will not be 20 mA. As soon as the number "8" will light up, it is not possible to change 7x20 = 140 mA, but it is completely permissible for Arduino trips. The supple reading reader is powered: "Ale, 4 discharges of 140 mA each, as much as 4x140 = 560 mA, but it's not too big!" Vidpovim - to be overwhelmed 140. Yakim rank? Read the details! The growth of the pins on the indicators can be seen in little 3. And the plug-in is automatically similar to the table 1.


Rice. 1 - Eskiz indicator


Rice. 2 - Indicator circuit


Rice. 3 - Roztashuvannya piniv

Table 1

Pin Arduino Uno

Pin of the indicator

Note

Segment G

Segment F

Segment E

Segment D

Segment C

Segment B

Segment A

The rear anode of segment No. 1 is connected through a 100 Ohm resistor.

The rear anode of segment No. 2 is connected through a 100 Ohm resistor.

The rear anode of segment No. 3 is connected through a 100 Ohm resistor.

The rear anode of segment No. 6 is connected through a 100 Ohm resistor.



A simple sketch is poured in, like a simple "lichilkoy" from 0 to 9:


And now I'll explain it to you. DDRD central register to port D (DDRB - according to port B) for the "terrible" word "register" the function is deprived of "hooking", as if the port is read by its own means (accept information), otherwise you can write there see information). DDRD bit = B11111111; I will show you how to pin it to the D port, tobto. Information from them is displayed. The letter "B" means that two (binarne) numbers are written in the register. The impatient reader is immediately fed: "A dozen is possible!?!". I sleep in peace - it is possible, but only about the whole year. Yakby we wanted half of the input port for input, and half for output can be used like this: DDRD = B11110000; One will show the information, as there will be information, and zero - that, as the information will be received. Basically, the register is polarized, so you need to prescribe 8 times in all pins, tobto. we are happy with the program of 7 rows. And now we pick the next row:

PORTB = B001000; // I will set a high rivin 11 on the port

PORTB ce register danih port, tobto. having written in ny as the number mi, it will be one on any port, and zero on any one. In addition to the commentary, I will say that if you take Arduino Uno in such a rank, you will be able to write down to register, tobto. what "zero" (chi "odinitsya") appears like a pin, tobto. The extreme right zero to the port was issued for the 8th pin, and the extreme right - for the 13th (for which one has been prompted). For port D, it is clear right for pin 0, livy for pin 7.
I am encouraged to write such rogue explanations of everything visibly, and once it is proponent, I will turn to see us and dozens of systems of numbers. First, the sketch at the 25th row is small, but for a newbie it's still pretty bulky. Zmenshuvatimo.

Filled with a more simple sketch, the very "little chick":


Video 1.
Ushogo 11 rows! Otse in our opinion, "in a new way"! I ask you to brutally respect the replacement of two numbers from the register of dozens. Obviously, for dozens of numbers, there is no need for the same letters in advance. I do not think we will take all the numbers of tables.

Table 2. Variety of the displayed sign by the given port

Outer anode

Zagalny cathode

Dvijkova system

Desyatkov system

Dvijkova system

Desyatkov system

Table 3. Representation of the range of data given to the port to be displayed.

Outer anode

Zagalny cathode

Dvijkova system

Desyatkov system

Dvijkova system

Desyatkov system



Uwaga! These tables 2 and 3 are only valid for the distribution according to table 1.
And now I will send a sketch from "lichilkoyu" from 0 to 9999:




Rice. 4 - Lichilka

A robot sketch can be amazed atVideo 2.

Many sketches have more comments than the code itself. Powering the Winiknuti is innocent. Okrіm one, but for the "cycle of merekhtinnya" such, how, vasno, there is mechtin 'and for whom? And yet, it’s great for a guy ...
And everything on the right is in that one segment of all the choices we have tied in one point. А1, А2, А3 and А4 can be used for the external cathode; A1, B1, ..... G1 is the back anode. So, having applied one hour to the 4-digit indicator "1234", we will be able to read "8888" and continue to work with the drive. It didn’t start, it’s necessary to burn “1” at your own discharge, then turn it on, burn “2” at your own, etc. As the robustness of the process is duzhe shvidko, then the number of digits is illumined, like a frame on a film, this eye is practically not remembered. And the maximum value of the change is in the case of the control over the change of numbers on the indicators. Before the speech, the very best "mechtennya" and the maximum life of the strum is 140 mA, the replacement is 560. And now I will go to the point of the brown.

A piece of a friend. I want Trohi Korisna

At the tsіy parts of the video the symbols from the PC on the 7-segment indicator behind the additional ARDUINO MEGA. Why raptom winikla idea of ​​"changing horses on the ferry"? There are two reasons: Persha - I have never looked at ARDUINO MEGA before in my articles; and friend - in ARDUINO UNO I didn’t get it, because I dynamically change COM port and port D. If I’m a newcomer, I can try. Pribaty tsei controller, you can nd it here: ... For the realization of what was conceived, I took a soldering iron and re-solder the Arduino loop, and also write a new sketch. How to rewire the loop can be wondered at Figure 5. Everything on the right is in that ARDUINO MEGA and ARDUINO UNO may have a larger number of ports, the same for Mesi more ports. The prevalence of short-term signals can be seen from Table 4.



Rice. 5 - Nova raspayuvannya train

Table 4

Port Mega


Uwaga! The table is valid only for the given project!

Likewise, it’s a bit of a beast to respect that Port C at Arduino Mega “repairs” from 37 pina and dal after the decline, and port A - from 22 pina and dal for growth.



Rice. 6 - The outward viglyad



Small features of the implementation: vivoditimo 4 symbols. Symbolize buty with numbers. Yaksho entered "1234" and by the way "1234", which entered "123456" all one by the way "1234", which entered "ytsuk", "theba1234", "otter485909oapom" - not more than anything. Yaksho entered "rr2345mm" pachimo "23", tobto. small, vbududovaniya "zahist is a fool."

Vlasne sketch:



And yak pratsyuє tsya program you can marvel atVideo 3.



Inspection pidgotuvav Pavlo Sergov