CN113923819B - 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
- CN113923819B CN113923819B CN202111115370.6A CN202111115370A CN113923819B CN 113923819 B CN113923819 B CN 113923819B CN 202111115370 A CN202111115370 A CN 202111115370A CN 113923819 B CN113923819 B CN 113923819B
- Authority
- CN
- China
- Prior art keywords
- cnt
- led
- time
- interrupt
- memory storage
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000005055 memory storage Effects 0.000 title claims abstract description 19
- 238000009825 accumulation Methods 0.000 claims abstract description 4
- 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 3
- 230000006386 memory function Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
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 Indicators Other Than Cathode Ray Tubes (AREA)
- Control Of El Displays (AREA)
Abstract
The invention provides a STM8 series chip based time-sharing memory storage and LED driving method, which is characterized in that the size of T1 and cnt are controlled, the LED scanning period T is controlled, the size of T3 is detected, the accumulation of cnt values is combined to keep the LED scanning period T unchanged, so that the running time of internal EEPROM writing data is controlled, T1 is the minimum time unit controlled by an LED scanning COM port, COM is the number of an LED scanning public terminal, cnt is the number of LED scanning clock periods, and T3 is the time of EEPROM erasing and writing data normally in a singlechip. The invention also provides a STM8 series chip-based time-sharing memory storage and LED driving system. The beneficial effects of the invention are as follows: on the premise of not increasing the cost, the LED scanning device has the power-down memory and LED scanning functions based on STM8S series chips.
Description
Technical Field
The invention relates to a chip control method, in particular to a STM8 series chip time-sharing memory storage and LED driving method and system.
Background
If under STM8S series chip, there is power down memory and LED function scanning simultaneously, then there are following defects:
Because STM8S series chip can lead to the CPU to be occupied when writing inside EEPROM data, but because LED lamp scanning function needs to control the scanning frequency to be more than 50HZ, because the conflict between them leads to leading to LED lamp scintillation (visible scintillation) when writing inside EEPROM data easily to influence user experience.
Related solutions to the above drawbacks in the prior art are:
(1) With other brands of chips, note: the chip does not occupy CPU when the internal EEPROM stores data;
disadvantages: the chip has certain requirements and is not beneficial to the specification of STM8S series chips by customers;
(2) Selecting the LED scanning function, and performing drive control by using an LED driving chip alone;
Disadvantages: new LED driving chips need to be added, increasing the product cost.
(3) And picking out the power-down memory function, and adopting 24C02 and other EEPROM chips to control the power-down memory function.
Disadvantages: new EEPROM chips need to be added, increasing product cost.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a STM8 series chip time-sharing memory storage and LED driving method and system which can simultaneously comprise power-down memory and LED scanning functions.
The invention provides a STM8 series chip based time-sharing memory storage and LED driving method, which is characterized in that the size of T1 and cnt are controlled, the LED scanning period T is controlled, the size of T3 is detected, the accumulation of cnt values is combined to keep the LED scanning period T unchanged, so that the running time of internal EEPROM writing data is controlled, T1 is the minimum time unit controlled by an LED scanning COM port, COM is the number of an LED scanning public terminal, cnt is the number of LED scanning clock periods, and T3 is the time of EEPROM erasing and writing data normally in a singlechip.
As a further improvement of the invention, the following procedure is performed based on the STM8S series chip:
(1) Initializing a clock interrupt T1, and allowing the interrupt;
(2) Initializing a variable period clock interrupt T2, prohibiting 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 storage programming time T3;
(5) T1 interrupts cnt++ each time;
(6) Executing in an interrupt; when cnt= 1; starting COM1 and 4 SEGs to display, starting T2 to control display brightness, wherein the SEGs are LED scanning segment numbers;
(7) Executing in an interrupt; when cnt= 2; starting COM2 and 4 SEG displays, and starting T2 to control display brightness;
(8) Executing in an interrupt; when cnt= 3; starting COM3 and 4 SEG displays, and starting T2 to control 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 no storage is needed;
(11) Cnt=0 at the maximum cumulative count of cnt set; and sets a flag bit for the system time T4,
(12) When T2 is interrupted, all COM and all SEG are turned off.
As a further development of the invention, T1 is 1ms, T2 is between 0 and 1000us and T3 is 5ms.
As a further improvement of the present invention, in step (11), cnt=0 when cnt > =10 is detected; and sets a 10ms flag bit for the system time T4.
As a further development of the invention, the LED scanning period T does not exceed 16ms.
The invention also provides a STM8 series chip-based time-sharing memory storage and LED driving system, which comprises a readable storage medium, wherein the readable storage medium stores execution instructions, and the execution instructions are used for realizing the method according to any one of the above when being executed by a processor.
The beneficial effects of the invention are as follows: through the scheme, on the premise of not increasing the cost, the STM8S series chip is based, and meanwhile, the LED scanning device has the power-down memory and LED scanning functions.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other solutions may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a T1 interrupt flow chart of a STM8 series chip time-sharing memory storage and LED driving method.
FIG. 2 is a T2 interrupt flow chart of a STM8 series chip time-sharing memory storage and LED driving method.
FIG. 3 is a block diagram of a method for time-sharing memory storage and LED driving based on STM8 chips according to the present invention.
Detailed Description
It should be noted that, without conflict, the embodiments of the present invention and features of the embodiments may be combined with each other.
In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on the drawings, are merely for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the scope of the present invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", etc. may explicitly or implicitly include one or more such feature. In the description of the present invention, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be either fixedly connected, detachably connected, or integrally connected, for example; can be directly connected or indirectly connected through an intermediate medium, and can be communication 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 in a specific case.
The invention is further described with reference to the following description of the drawings and detailed description.
As shown in fig. 1 to 3, the method for time-sharing memory storage and LED driving based on STM8 series chips includes power-down memory and LED scanning functions based on STM8S series chips, and the specific implementation process is as follows:
(1) Initializing a clock interrupt T1 (1 ms), and allowing the interrupt;
(2) Initializing a variable period clock interrupt T2 (< 1 ms), disabling the interrupt;
(3) Setting a counting variable cnt;
(4) Testing the internal EEPROM erase and storage programming time T3;
(5) T1 interrupts cnt++ each time;
(6) When cnt= 1; starting COM1 and 4 SEG displays, and starting T2 to control display brightness;
(7) When cnt= 2; starting COM2 and 4 SEG displays, and starting T2 to control display brightness;
(8) When cnt= 3; starting COM3 and 4 SEG displays, and starting T2 to control 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 no storage is needed;
(11) Cnt=0 when cnt > =10 is detected; and sets a 10ms flag bit for the system time T4,
(12) When T2 is interrupted, all COM and all SEG are turned off.
The meaning of each symbol is described as follows:
t1, controlling a minimum time unit-1 ms in the scheme by an LED scanning COM port;
T2, an LED scanning duty ratio control time unit, which is 0-1000 us in the scheme;
And T3, the time for normally erasing and writing data in the single chip microcomputer by the EEPROM is 5ms (T3=5) in the actual test.
Cnt: LED scan clock cycle count, in this case, 10 times maximum t=t1×10=10 ms
Frequency f=1/t=1/10 ms=100 Hz;
COM is that the LED scans the public end number;
SEG, LED scanning segment number.
The hardware used in this embodiment is as follows:
(1) And the singlechip is used for: STM8S005K6, relevant function internal deep (flash data storage).
(2) LED lamp: 3 x 4 LED lamp scans (3 COM, 4 SEG).
According to the STM8 series chip time-sharing memory storage and LED driving method, the sizes of T1 and cnt are controlled, the LED scanning period T=T1=10=10 ms is controlled, the frequency F=1/T=1/10 ms=100 Hz, the period T does not exceed 16ms, and the frequency is greater than 62Hz; by detecting the size of T3 and combining the accumulation of cnt values; cnt=cnt+t3, making t=10ms unchanged (LED scan period unchanged, LED lamp will not flash), i.e. strictly controlling the internal EEPROM write data run time.
The method strictly controls the running time of the internal EEPROM for writing data and strictly controls the LED scanning time, so that the period T of the sum of the scanning time of the LED lamp and the writing data time of the internal EEPROM is not more than 16ms (namely, the frequency F is higher than 1s/16 ms=62 Hz), and the problem of flickering of the LED lamp can not occur (visible to naked eyes) when a user uses the product.
In addition, because the method is completely under the current hardware condition, no additional LED driving chip and EEPROM memory chip are added or the STM8S series chip specified by customers is changed. Thus, 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 provided by the invention is based on the STM8S series chip, simultaneously comprises a power-down memory function and an LED scanning function, and can be applied to various household appliance control panel display parts and various consumer electronic display parts.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.
Claims (5)
1. A STM8 series chip-based time-sharing memory storage and LED driving method is characterized in that: controlling the size of T1 and cnt, controlling an LED scanning period T, detecting the size of T3, combining with the accumulation of cnt values to keep the LED scanning period T unchanged, thereby controlling the running time of internal EEPROM data writing, wherein T1 is an LED scanning COM port control minimum time unit, COM is an LED scanning common end number, cnt is an LED scanning clock period count, and T3 is the time of EEPROM normal erasing and data writing in a singlechip;
Based on STM8S series chip, the following process is carried out:
(1) Initializing a clock interrupt T1, and allowing the interrupt;
(2) Initializing a variable period clock interrupt T2, prohibiting 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 storage programming time T3;
(5) T1 interrupts cnt++ each time;
(6) Executing in an interrupt; when cnt= 1; starting COM1 and 4 SEGs to display, starting T2 to control display brightness, wherein the SEGs are LED scanning segment numbers;
(7) Executing in an interrupt; when cnt= 2; starting COM2 and 4 SEG displays, and starting T2 to control display brightness;
(8) Executing in an interrupt; when cnt= 3; starting COM3 and 4 SEG displays, and starting T2 to control 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 no storage is needed;
(11) Cnt=0 at the maximum cumulative count of cnt set; and sets a flag bit for the system time T4,
(12) When T2 is interrupted, all COM and all SEG are turned off.
2. The STM 8-series chip-based time-division memory storage and LED driving method as set forth in claim 1, wherein the method comprises the steps of: t1 is 1ms, T2 is between 0 and 1000us, and T3 is 5ms.
3. The STM 8-series chip-based time-division memory storage and LED driving method as set forth in claim 1, wherein the method comprises the steps of: in step (11), cnt=0 when cnt > =10 is detected; and sets a 10ms flag bit for the system time T4.
4. The STM 8-series chip-based time-division memory storage and LED driving method as set forth in claim 1, wherein the method comprises the steps of: the LED scan period T does not exceed 16ms.
5. STM8 series chip based time-sharing memory storage and LED drive system, its characterized in that: comprising a readable storage medium having stored therein execution instructions which when executed by a processor are adapted to carry out the method of any one of claims 1 to 4.
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 CN113923819A (en) | 2022-01-11 |
CN113923819B true 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 (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8836621B2 (en) * | 2004-12-15 | 2014-09-16 | Nlt Technologies, Ltd. | Liquid crystal display apparatus, driving method for same, and driving circuit for same |
US9520097B2 (en) * | 2011-11-07 | 2016-12-13 | Sharp Kabushiki Kaisha | Display device with compensating backlight drive circuit and method for driving same |
US10225901B2 (en) * | 2015-05-03 | 2019-03-05 | Fulham Company Limited | Programmable LED driver, monitor and setting devices |
-
2021
- 2021-09-23 CN CN202111115370.6A patent/CN113923819B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
---|---|
CN113923819A (en) | 2022-01-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9570041B2 (en) | Selective monitor control | |
US8519938B2 (en) | Intelligent automatic backlight control scheme | |
CN102194423B (en) | Method and apparatus for enabling power management of a flat panel display | |
US20120218239A1 (en) | Backlight control of electronic device | |
CN109859721A (en) | Brightness of display screen adjusting method, device, mobile terminal and storage medium | |
CN106057169B (en) | A kind of eye care method and mobile terminal of mobile terminal | |
US20080059702A1 (en) | Portable storage device with operating status display | |
EP0211308A2 (en) | Data processing machine | |
JP2003536111A (en) | Method and system for providing intensity modulation | |
CN103824545B (en) | Display unit and display packing | |
CN109377952B (en) | Driving method of display device, display device and display | |
CN105556587A (en) | Control device, dynamic backlight control program, and control device controlling method | |
CN105824390B (en) | A kind of saving power for terminal display methods and mobile terminal | |
CN103870222A (en) | Display output control method and electronic device | |
EP3319074A1 (en) | Light-emitting diode display device and method of operating the same | |
CN113923819B (en) | STM8 series chip-based time-sharing memory storage and LED driving method and system | |
CN208241952U (en) | Electronic reader with reading lamp | |
US11250814B2 (en) | Display device | |
CN108803131B (en) | Screen, screen backlight control method and device | |
CN101853640A (en) | The modulating method of display device and picture update rate thereof | |
CN106502610B (en) | A kind of display brightness method of adjustment and mobile terminal | |
CN111818695B (en) | Control system, method and display module | |
CN112820231B (en) | Method for balancing brightness of curved screen, intelligent terminal and computer readable storage medium | |
CN114016249A (en) | Display device control method of clothes treatment device and clothes treatment device | |
CN105137627A (en) | Method and device for partition backlight detection |
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 |