CN113923819A - STM8 series chip-based time-sharing memory storage and LED driving method and system - Google Patents
STM8 series chip-based time-sharing memory storage and LED driving method and system Download PDFInfo
- Publication number
- CN113923819A CN113923819A CN202111115370.6A CN202111115370A CN113923819A CN 113923819 A CN113923819 A CN 113923819A CN 202111115370 A CN202111115370 A CN 202111115370A CN 113923819 A CN113923819 A CN 113923819A
- Authority
- CN
- China
- Prior art keywords
- cnt
- led
- time
- memory storage
- scanning
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000005055 memory storage Effects 0.000 title claims abstract description 20
- 238000009825 accumulation Methods 0.000 claims abstract description 3
- 238000012360 testing method Methods 0.000 claims description 4
- 101000746134 Homo sapiens DNA endonuclease RBBP8 Proteins 0.000 claims description 3
- 101000969031 Homo sapiens Nuclear protein 1 Proteins 0.000 claims description 3
- 102100021133 Nuclear protein 1 Human genes 0.000 claims description 3
- 230000001186 cumulative effect Effects 0.000 claims description 2
- 230000006870 function Effects 0.000 abstract description 9
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 230000006386 memory function Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B45/00—Circuit arrangements for operating light-emitting diodes [LED]
- H05B45/10—Controlling the intensity of the light
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/24—Handling requests for interconnection or transfer for access to input/output bus using interrupt
-
- H—ELECTRICITY
- H05—ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
- H05B—ELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
- H05B45/00—Circuit arrangements for operating light-emitting diodes [LED]
- H05B45/30—Driver circuits
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02B—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
- Y02B20/00—Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
- Y02B20/40—Control techniques providing energy savings, e.g. smart controller or presence detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Control Of El Displays (AREA)
- Control Of Indicators Other Than Cathode Ray Tubes (AREA)
Abstract
The invention provides a time-sharing memory storage and LED driving method based on STM8 series chips, which controls an LED scanning period T by controlling the sizes of T1 and cnt, controls the data writing running time of an internal EEPROM by detecting the size of T3 and combining the accumulation of cnt numerical values to keep the LED scanning period T unchanged, controls and controls the internal EEPROM to write data, wherein T1 is the LED scanning COM port control minimum time unit, COM is an LED scanning public end number, cnt is the LED scanning clock period count, and T3 is the normal erasing and data writing time of the EEPROM in a singlechip. The invention also provides a time-sharing memory storage and LED driving system based on the STM8 series chips. The invention has the beneficial effects that: on the premise of not increasing cost, the LED scanning circuit has the functions of power-down memory and LED scanning on the basis of STM8S series chips.
Description
Technical Field
The invention relates to a chip control method, in particular to a time-sharing memory storage and LED driving method and system based on STM8 series chips.
Background
If under STM8S series chip, there are power-down memory and LED function scanning simultaneously, then there are the following defects:
due to the STM8S serial chip, the CPU is occupied when writing the internal EEPROM data, but since the LED lamp scanning function needs to control the scanning frequency to be above 50HZ, the collision between the two is likely to cause the LED lamp to flicker (flicker visible to the naked eye) when writing the internal EEPROM data, thereby affecting the user experience.
The related solutions in the prior art for the above drawbacks are:
(1) with other brands of chips, note: the chip does not occupy a CPU when an internal EEPROM stores data;
the disadvantages are as follows: certain requirements are made on chips, and the STM8S series chips are not convenient for customers to specify;
(2) picking out the LED scanning function, and independently using an LED driving chip for driving control;
the disadvantages are as follows: a new LED driving chip needs to be added, increasing the product cost.
(3) And (4) selecting the power-down memory function, and controlling the power-down memory function by adopting EEPROM chips such as 24C02 and the like.
The disadvantages are as follows: a new EEPROM chip needs to be added, increasing the product cost.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a time-sharing memory storage and LED driving method and system based on STM8 series chips, which can simultaneously comprise power failure memory and LED scanning functions.
The invention provides a time-sharing memory storage and LED driving method based on STM8 series chips, which controls an LED scanning period T by controlling the sizes of T1 and cnt, controls the data writing running time of an internal EEPROM by detecting the size of T3 and combining the accumulation of cnt numerical values to keep the LED scanning period T unchanged, controls and controls the internal EEPROM to write data, wherein T1 is the LED scanning COM port control minimum time unit, COM is an LED scanning public end number, cnt is the LED scanning clock period count, and T3 is the normal erasing and data writing time of the EEPROM in a singlechip.
As a further improvement of the invention, the following process is carried out based on STM8S series chips:
(1) initializing a clock interrupt T1, allowing interrupts;
(2) initializing a variable period clock interrupt T2, and forbidding the interrupt, wherein T2 is an LED scanning duty ratio control time unit;
(3) setting a counting variable cnt;
(4) testing the internal EEPROM erase and memory programming time T3;
(5) t1 interrupts cnt + +, every time;
(6) executing in an interrupt; when cnt = = 1; opening COM1, displaying 4 SEGs, starting T2 to control display brightness, wherein the SEG is an LED scanning segment number;
(7) executing in an interrupt; when cnt = = 2; opening COM2, displaying 4 SEGs, and starting T2 to control the display brightness;
(8) executing in an interrupt; when cnt = = 3; opening COM3, displaying 4 SEGs, and starting T2 to control the display brightness;
(9) executing in an interrupt; when cnt = = 4; checking whether the EEPROM is erased and stored;
(10) when storage is required: cnt = cnt + T3, and stores data; cnt + +, when storage is not required;
(11) cnt = 0 upon detecting cnt > = set cnt maximum cumulative number; and sets the flag for system time T4,
(12) when T2 is interrupted, all COM and all SEG are turned off.
As a further improvement of the invention, T1 is 1ms, T2 is between 0 and 1000us, and T3 is 5 ms.
As a further improvement of the present invention, in step (11), cnt = 0 when cnt > =10 is detected; and a flag bit of 10ms is set for the system time T4.
As a further development of the invention, the LED scan period T does not exceed 16 ms.
The invention also provides an STM8 series chip-based time-sharing memory storage and LED driving system, which comprises a readable storage medium, wherein execution instructions are stored in the readable storage medium, and the execution instructions are used for realizing the method according to any one of the above items when being executed by a processor.
The invention has the beneficial effects that: through the scheme, on the premise of not increasing cost, the power-down memory and LED scanning function is realized on the basis of STM8S series chips.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other solutions can be obtained according to the drawings without inventive efforts.
FIG. 1 is a T1 interrupt flow chart based on an STM8 series chip time-sharing memory storage and LED driving method.
FIG. 2 is a T2 interrupt flow chart based on an STM8 series chip time-sharing memory storage and LED driving method.
FIG. 3 is a block diagram of a time-sharing memory storage and LED driving method based on STM8 series chips.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore, should not be taken as limiting the scope of the present invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art through specific situations.
The invention is further described with reference to the following description and embodiments in conjunction with the accompanying drawings.
As shown in fig. 1 to 3, a time-sharing memory storage and LED driving method based on an STM8 series chip is based on an STM8S series chip and includes a power-down memory and an LED scanning function at the same time, and the specific implementation process is as follows:
(1) initializing a clock interrupt T1 (1 ms), allowing interrupts;
(2) initializing a variable period clock interrupt T2 (< 1 ms), disabling interrupts;
(3) setting a counting variable cnt;
(4) testing the internal EEPROM erase and memory programming time T3;
(5) t1 interrupts cnt + +, every time;
(6) when cnt = = 1; opening COM1, displaying 4 SEGs, and starting T2 to control the display brightness;
(7) when cnt = = 2; opening COM2, displaying 4 SEGs, and starting T2 to control the display brightness;
(8) when cnt = = 3; opening COM3, displaying 4 SEGs, and starting T2 to control the display brightness;
(9) when cnt = = 4; checking whether the EEPROM is erased and stored;
(10) when storage is required: cnt = cnt + T3, and stores data; cnt + +, when storage is not required;
(11) cnt = 0 at detection cnt > = 10; and sets a flag bit of 10ms for the system time T4,
(12) when T2 is interrupted, all COM and all SEG are turned off.
The meaning of each symbol is illustrated below:
t1, controlling the minimum time unit- -the scheme is 1ms by an LED scanning COM port;
t2, controlling time unit of LED scanning duty ratio, which is 0-1000 us in the scheme;
t3 EEPROM is normally erased and written in the single chip microcomputer, and the actual test in the case is 5ms (T3= 5).
cnt: counting the period of the LED scanning clock, wherein the maximum 10 times T = T1 × 10=10ms in the scheme
Frequency F = 1/T = 1/10ms = 100Hz;
COM is an LED scanning public terminal number;
SEG LED scanning segment number.
The hardware used in this embodiment is as follows:
(1) a single chip microcomputer: STM8S005K6, related function internal eeprom (flash data storage).
(2) LED lamp: 3 x 4 LED lamp scan (3 COM, 4 SEG).
According to the STM8 series chip time-sharing memory storage and LED driving method, the LED scanning period T = T1 × 10=10ms, the frequency F = 1/T = 1/10ms = 100Hz, the period T does not exceed 16ms, and the frequency is greater than 62Hz by controlling the sizes of T1 and cnt; by detecting the size of T3, the total of cnt values is combined; cnt = cnt + T3, making T =10ms constant (LED scan cycle is constant, LED lamp does not flash), i.e. the internal EEPROM write data operation time is strictly controlled.
The method strictly controls the data writing operation time of the internal EEPROM and the LED scanning time, so that the period T of the sum of the scanning time of the LED lamp and the data writing time of the internal EEPROM does not exceed 16ms (namely the frequency F is higher than 1s/16ms = 62 Hz), and the problem of LED lamp flickering (visible to naked eyes) can not occur when a user uses a product.
Also because the method is entirely under current hardware conditions and no additional LED driver chips and EEPROM memory chips are added or customer specific STM8S family chips are modified. Therefore, the cost of the product is not increased under the condition of meeting the requirements of customers.
The STM8 series chip-based time-sharing memory storage and LED driving method is based on an STM8S series chip, simultaneously comprises a power failure memory function and an LED scanning function, and can be applied to display parts of various household appliance control panels and various consumer electronic display parts.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (6)
1. A time-sharing memory storage and LED driving method based on STM8 series chips is characterized in that: the method comprises the steps of controlling the sizes of T1 and cnt, controlling an LED scanning period T, detecting the size of T3, and combining the accumulation of the cnt value to keep the LED scanning period T unchanged so as to control the internal EEPROM data writing operation time, wherein T1 is an LED scanning COM port control minimum time unit, COM is an LED scanning public end number, cnt is an LED scanning clock period count, and T3 is the normal erasing and data writing time of the EEPROM in a single chip microcomputer.
2. The STM8 series chip time-sharing memory storage and LED driving method according to claim 1, wherein: the following process is carried out based on STM8S series chips:
(1) initializing a clock interrupt T1, allowing interrupts;
(2) initializing a variable period clock interrupt T2, and forbidding the interrupt, wherein T2 is an LED scanning duty ratio control time unit;
(3) setting a counting variable cnt;
(4) testing the internal EEPROM erase and memory programming time T3;
(5) t1 interrupts cnt + +, every time;
(6) executing in an interrupt; when cnt = = 1; opening COM1, displaying 4 SEGs, starting T2 to control display brightness, wherein the SEG is an LED scanning segment number;
(7) executing in an interrupt; when cnt = = 2; opening COM2, displaying 4 SEGs, and starting T2 to control the display brightness;
(8) executing in an interrupt; when cnt = = 3; opening COM3, displaying 4 SEGs, and starting T2 to control the display brightness;
(9) executing in an interrupt; when cnt = = 4; checking whether the EEPROM is erased and stored;
(10) when storage is required: cnt = cnt + T3, and stores data; cnt + +, when storage is not required;
(11) cnt = 0 upon detecting cnt > = set cnt maximum cumulative number; and sets the flag for system time T4,
(12) when T2 is interrupted, all COM and all SEG are turned off.
3. The STM8 series chip time-sharing memory storage and LED driving method according to claim 2, wherein: t1 is 1ms, T2 is between 0 and 1000us, and T3 is 5 ms.
4. The STM8 series chip time-sharing memory storage and LED driving method according to claim 2, wherein: in step (11), cnt = 0 when cnt > =10 is detected; and a flag bit of 10ms is set for the system time T4.
5. The STM8 series chip time-sharing memory storage and LED driving method according to claim 1, wherein: the LED scan period T does not exceed 16 ms.
6. The utility model provides a time-sharing memory storage and LED actuating system based on STM8 series chip which characterized in that: comprising a readable storage medium having stored therein execution instructions for, when executed by a processor, implementing the method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111115370.6A CN113923819B (en) | 2021-09-23 | 2021-09-23 | STM8 series chip-based time-sharing memory storage and LED driving method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111115370.6A CN113923819B (en) | 2021-09-23 | 2021-09-23 | STM8 series chip-based time-sharing memory storage and LED driving method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113923819A true CN113923819A (en) | 2022-01-11 |
CN113923819B CN113923819B (en) | 2024-06-21 |
Family
ID=79235910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111115370.6A Active CN113923819B (en) | 2021-09-23 | 2021-09-23 | STM8 series chip-based time-sharing memory storage and LED driving method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113923819B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060145978A1 (en) * | 2004-12-15 | 2006-07-06 | Nec Corporation | Liquid crystal display apparatus, driving method for same, and driving circuit for same |
US20140267464A1 (en) * | 2011-11-07 | 2014-09-18 | Sharp Kabushiki Kaisha | Display device and method for driving same |
CN105161044A (en) * | 2015-10-19 | 2015-12-16 | 宁波卓奥电子科技有限公司 | Display unit scanning driving method in electric appliance terminal control panel |
US20170006683A1 (en) * | 2015-05-03 | 2017-01-05 | Fulham Company Limited, an exempted Co. Inc'd w/ limited liability under the laws of the Cayman Isl | Programmable led driver, monitor and setting devices |
CN112309294A (en) * | 2020-11-06 | 2021-02-02 | 珠海格力电器股份有限公司 | Driving method and device for realizing LED display circuit, storage medium and electronic equipment |
-
2021
- 2021-09-23 CN CN202111115370.6A patent/CN113923819B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060145978A1 (en) * | 2004-12-15 | 2006-07-06 | Nec Corporation | Liquid crystal display apparatus, driving method for same, and driving circuit for same |
US20140267464A1 (en) * | 2011-11-07 | 2014-09-18 | Sharp Kabushiki Kaisha | Display device and method for driving same |
US20170006683A1 (en) * | 2015-05-03 | 2017-01-05 | Fulham Company Limited, an exempted Co. Inc'd w/ limited liability under the laws of the Cayman Isl | Programmable led driver, monitor and setting devices |
CN105161044A (en) * | 2015-10-19 | 2015-12-16 | 宁波卓奥电子科技有限公司 | Display unit scanning driving method in electric appliance terminal control panel |
CN112309294A (en) * | 2020-11-06 | 2021-02-02 | 珠海格力电器股份有限公司 | Driving method and device for realizing LED display circuit, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113923819B (en) | 2024-06-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8519938B2 (en) | Intelligent automatic backlight control scheme | |
US20080059702A1 (en) | Portable storage device with operating status display | |
CN109377952B (en) | Driving method of display device, display device and display | |
CN106057169B (en) | A kind of eye care method and mobile terminal of mobile terminal | |
CN109461415B (en) | Display panel's drive circuit and display panel | |
CN105224425B (en) | The data protection circuit and its method of a kind of storage chip | |
CN106343750A (en) | Shoe cabinet | |
CN103080869A (en) | Determination of display device power consumption | |
CN105824390A (en) | Terminal electricity-saving display method and mobile terminal | |
CN113923819A (en) | STM8 series chip-based time-sharing memory storage and LED driving method and system | |
CN108859759B (en) | Electric automobile instrument system and dispatching method thereof | |
US11250814B2 (en) | Display device | |
CN112654119B (en) | LED drive test method, driver, system and electronic equipment | |
CN109658853B (en) | Display test method, drive circuit and compensation detection device of display device | |
CN111818695B (en) | Control system, method and display module | |
CN105161044A (en) | Display unit scanning driving method in electric appliance terminal control panel | |
CN205384552U (en) | Mainboard of DRAM and applied this DRAM | |
CN110462725A (en) | Use the brightness of pixel brightness modification display | |
CN107484301B (en) | Memory luminous control circuit | |
CN203688685U (en) | RFID reader aging test auxiliary device | |
CN206543044U (en) | Shoe chest | |
US20230316992A1 (en) | Display and dehumidification method thereof | |
JPH08138389A (en) | Flash memory card | |
CN108398996B (en) | Power management method and electronic system | |
CN216772569U (en) | Combustible gas detection alarm and combustible gas detection alarm system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |