• Guest
HabraHabr
  • Main
  • Users

  • Development
    • Programming
    • Information Security
    • Website development
    • JavaScript
    • Game development
    • Open source
    • Developed for Android
    • Machine learning
    • Abnormal programming
    • Java
    • Python
    • Development of mobile applications
    • Analysis and design of systems
    • .NET
    • Mathematics
    • Algorithms
    • C#
    • System Programming
    • C++
    • C
    • Go
    • PHP
    • Reverse engineering
    • Assembler
    • Development under Linux
    • Big Data
    • Rust
    • Cryptography
    • Entertaining problems
    • Testing of IT systems
    • Testing Web Services
    • HTML
    • Programming microcontrollers
    • API
    • High performance
    • Developed for iOS
    • CSS
    • Industrial Programming
    • Development under Windows
    • Image processing
    • Compilers
    • FPGA
    • Professional literature
    • OpenStreetMap
    • Google Chrome
    • Data Mining
    • PostgreSQL
    • Development of robotics
    • Visualization of data
    • Angular
    • ReactJS
    • Search technologies
    • Debugging
    • Test mobile applications
    • Browsers
    • Designing and refactoring
    • IT Standards
    • Solidity
    • Node.JS
    • Git
    • LaTeX
    • SQL
    • Haskell
    • Unreal Engine
    • Unity3D
    • Development for the Internet of things
    • Functional Programming
    • Amazon Web Services
    • Google Cloud Platform
    • Development under AR and VR
    • Assembly systems
    • Version control systems
    • Kotlin
    • R
    • CAD/CAM
    • Customer Optimization
    • Development of communication systems
    • Microsoft Azure
    • Perfect code
    • Atlassian
    • Visual Studio
    • NoSQL
    • Yii
    • Mono и Moonlight
    • Parallel Programming
    • Asterisk
    • Yandex API
    • WordPress
    • Sports programming
    • Lua
    • Microsoft SQL Server
    • Payment systems
    • TypeScript
    • Scala
    • Google API
    • Development of data transmission systems
    • XML
    • Regular expressions
    • Development under Tizen
    • Swift
    • MySQL
    • Geoinformation services
    • Global Positioning Systems
    • Qt
    • Dart
    • Django
    • Development for Office 365
    • Erlang/OTP
    • GPGPU
    • Eclipse
    • Maps API
    • Testing games
    • Browser Extensions
    • 1C-Bitrix
    • Development under e-commerce
    • Xamarin
    • Xcode
    • Development under Windows Phone
    • Semantics
    • CMS
    • VueJS
    • GitHub
    • Open data
    • Sphinx
    • Ruby on Rails
    • Ruby
    • Symfony
    • Drupal
    • Messaging Systems
    • CTF
    • SaaS / S+S
    • SharePoint
    • jQuery
    • Puppet
    • Firefox
    • Elm
    • MODX
    • Billing systems
    • Graphical shells
    • Kodobred
    • MongoDB
    • SCADA
    • Hadoop
    • Gradle
    • Clojure
    • F#
    • CoffeeScript
    • Matlab
    • Phalcon
    • Development under Sailfish OS
    • Magento
    • Elixir/Phoenix
    • Microsoft Edge
    • Layout of letters
    • Development for OS X
    • Forth
    • Smalltalk
    • Julia
    • Laravel
    • WebGL
    • Meteor.JS
    • Firebird/Interbase
    • SQLite
    • D
    • Mesh-networks
    • I2P
    • Derby.js
    • Emacs
    • Development under Bada
    • Mercurial
    • UML Design
    • Objective C
    • Fortran
    • Cocoa
    • Cobol
    • Apache Flex
    • Action Script
    • Joomla
    • IIS
    • Twitter API
    • Vkontakte API
    • Facebook API
    • Microsoft Access
    • PDF
    • Prolog
    • GTK+
    • LabVIEW
    • Brainfuck
    • Cubrid
    • Canvas
    • Doctrine ORM
    • Google App Engine
    • Twisted
    • XSLT
    • TDD
    • Small Basic
    • Kohana
    • Development for Java ME
    • LiveStreet
    • MooTools
    • Adobe Flash
    • GreaseMonkey
    • INFOLUST
    • Groovy & Grails
    • Lisp
    • Delphi
    • Zend Framework
    • ExtJS / Sencha Library
    • Internet Explorer
    • CodeIgniter
    • Silverlight
    • Google Web Toolkit
    • CakePHP
    • Safari
    • Opera
    • Microformats
    • Ajax
    • VIM
  • Administration
    • System administration
    • IT Infrastructure
    • *nix
    • Network technologies
    • DevOps
    • Server Administration
    • Cloud computing
    • Configuring Linux
    • Wireless technologies
    • Virtualization
    • Hosting
    • Data storage
    • Decentralized networks
    • Database Administration
    • Data Warehousing
    • Communication standards
    • PowerShell
    • Backup
    • Cisco
    • Nginx
    • Antivirus protection
    • DNS
    • Server Optimization
    • Data recovery
    • Apache
    • Spam and antispam
    • Data Compression
    • SAN
    • IPv6
    • Fidonet
    • IPTV
    • Shells
    • Administering domain names
  • Design
    • Interfaces
    • Web design
    • Working with sound
    • Usability
    • Graphic design
    • Design Games
    • Mobile App Design
    • Working with 3D-graphics
    • Typography
    • Working with video
    • Work with vector graphics
    • Accessibility
    • Prototyping
    • CGI (graphics)
    • Computer Animation
    • Working with icons
  • Control
    • Careers in the IT industry
    • Project management
    • Development Management
    • Personnel Management
    • Product Management
    • Start-up development
    • Managing the community
    • Service Desk
    • GTD
    • IT Terminology
    • Agile
    • Business Models
    • Legislation and IT-business
    • Sales management
    • CRM-systems
    • Product localization
    • ECM / EDS
    • Freelance
    • Venture investments
    • ERP-systems
    • Help Desk Software
    • Media management
    • Patenting
    • E-commerce management
    • Creative Commons
  • Marketing
    • Conferences
    • Promotion of games
    • Internet Marketing
    • Search Engine Optimization
    • Web Analytics
    • Monetize Web services
    • Content marketing
    • Monetization of IT systems
    • Monetize mobile apps
    • Mobile App Analytics
    • Growth Hacking
    • Branding
    • Monetize Games
    • Display ads
    • Contextual advertising
    • Increase Conversion Rate
  • Sundry
    • Reading room
    • Educational process in IT
    • Research and forecasts in IT
    • Finance in IT
    • Hakatonas
    • IT emigration
    • Education abroad
    • Lumber room
    • I'm on my way

Experience of using LCD displays based on MELT products

 3r33553. 3r3-31. This article is devoted to an exciting adventure quest that I had to go through in the process of creating an updated external sensor for the weather station, described Here in this article year and a half ago. According to the operating experience of the previous version, I really wanted to create a sensor with a control display, so that it was possible to periodically check (and verify) the most capricious component of the station without problems - the wind speed sensor. Adventures began when I began to select a display for this purpose and for a number of reasons, which I further dwelt on the products of my own MELT. But before I go to the description unconventional sex techniques ways to cope with my chosen works of this company, it is worthwhile to briefly highlight the main reason for all this grand modernization, which I started. 3r? 3539.  3r33553. impeller with zero buoyancy, to tell the truth, was 2-3 cm /sec, and the direction of the gauge indicated, turning the whole body. So it is in the water, which is 700 times denser than air! During the averaging period, which made up the clock there, such a turntable at least once, but will turn, because there were almost no empty measurements. And for a weather station, as already stated , a mathematically correct averaging method is not suitable, since it should show something real even in the absence of wind. Therefore, here we can not do without artificially limited timeout for waiting for pulses from the sensor. 3r? 3539.  3r33553. 3r3-3549. 3r3-3549. 3r? 3539.  3r33553. It is possible to wake up a complex controller wake-up control from two sources: normally from an external interruption from the speed sensor (that is, while waiting for pulses from the sensor, the controller also goes into power saving mode), and in the absence of wind - forced from Watchdog. This would make sense only if the principle of reading the speed sensor from optical to less energy-intensive circuits (which still need to be searched — the Hall sensor, for example, consumes 5-10 mA, which is fundamentally less than the optical structure) changes. But everything was simplified due to the fact that my sensor is now powered by a solar battery, which made it possible to simply abandon the energy saving mode. 3r? 3539.  3r33553. 3r? 3539.  3r33553. To clock the readings, I didn’t bother with the timers or count down Arduyn’s millis (), but simply put a primitive external frequency generator with a period of about 1.5 seconds on the timer 555:
 3r33553. 3r? 3539.  3r33553. Experience of using LCD displays based on MELT products 3r? 3539.  3r33553. As we remember, the sensor circuit uses a “bare” Atmega328 controller in a DIP package, programmed via Uno and mounted on the panel, the Arduino itself is used only for prototyping. The output of the generator was brought to the output of the interrupt INT? output 4 of the chip (output D2 of the Uno board). Interruption by a positive differential (RISING) sets a certain flag, according to which the next readings are taken in the main cycle. The frequency from the sensor is also measured by the interrupt method (the sensor output is input to the INT1 interrupt input, pin 4 (D3), see the last method 3r361. In that same article 3r3443.), Because the maximum total waiting time is twice the period of the measured frequency. With a timeout of 1 s, thus, the minimum measured frequency is 2 Hz (one turn of the anemometer in 8 seconds). In every fourth cycle, averaging occurs and the finished data is sent to the main module, that is, the readings are updated approximately every 6 seconds. 3r? 3539.  3r33553. 3r? 3539.  3r33553. The whole story with the updated sensor will have to be calibrated and periodically checked to see if the friction has increased, comparing readings with a manual anemometer. It is therefore very inconvenient when the readings are displayed in one place (in the house), and the external sensor is installed in a completely different position - on the garden gazebo. There was a question about installing a control LCD display in the sensor housing. Since the beauty here is not required, the information requirements for it are minimal: a single-line 10-character display is enough. But the geometric requirements are quite stringent: the display must fit into the existing case in width, which is 70 mm. I must say that due to my organic dislike for LCD displays (dull, low-contrast, with small letters, disgusting quality of backlighting, and also consume a lot, what’s next), I almost don’t know about the range available in retail. And so it immediately became clear that I needed to look for the displays I needed very much: a standard 16x2 LCD display, which dominate in stores, has a 80 mm board and does not fit into my sensor, and all other types are even larger, and from the firm. In nature, of course, there are varieties of smaller sizes, but then in nature, and not in domestic retail. 3r? 3539.  3r33553. 3r? 3539.  3r33553.

Solution: oh, MELT!

3r? 3539.  3r33553. In the end, I immediately found two MELT’s, which wonderfully fit my task. The first of these is a single-line 10-character MT-10S1 with a controller, which, as the manufacturers assert, “3r3314. similar to HD44780 by HITACHI and KS0066 by SAMSUNG [/i] ". It has rather large signs: more than 8 mm in height, which is generally characteristic of Chinese displays, which are much larger. The width of the board is 66 mm, the dimensions of the protruding screen (external) are 62x19.5. The consumption in this case worries me not very much (for the external sensor is powered by a solar battery with obviously more power than necessary), but out of habit, looking at the line in the datasheet, I found out that it is also less than usual - 0.7 mA (all normal LCDs -displays on analogs HD44780 consume from 1.2 mA and above). There is still a highlight to the heap, as is usual for all such types - rather miserable and at the same time consuming a lot of energy. 3r? 3539.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. The second display MT-10T7 is even more delightful: 10 seven-segment digits with a height of as much as 13 mm fit exactly in the same dimensions. Some suspicions were caused by non-standard, and, apparently, self-made interface (for which the datasheet even gives an example of programming in a verbal pseudocode). The display does not contain a real controller: there is a set of static triggers-latches, controlled by combinational logic. But thanks to such simplicity, this whole design consumes only 30 μA, that is, it really suits devices that work on battery power around the clock (1.4 mA consumption in conventional displays and even 0.7 mA in MT-10S1 are much higher than acceptable for such use of the value - calculate for yourself how long such a display will work, even without taking into account the other components of the device, for example, from AAA batteries with a capacity of about 1500 mAh). 3r? 3539.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. In short, give two! 3r? 3539.  3r33553. 3r? 3539.  3r33553.

MT-10T7 3r3508. 3r? 3539.  3r33553. An attempt to independently reproduce the algorithm for MT-10T? described in the datasheet (on both the Arduino and pure assembler), did not lead to success. What was done wrong, I did not understand, because I came across 3r3103. here is this publication
where the author (eshkinkot) gave a very well-written and thoroughly executed example of handling MT-10T? after which it all worked right away. If anyone is interested, then here lies a modified eshkinkot’s example, supplemented by all meaningful symbols on the seven-segment indicators, including letters that do not coincide with the numbers: 3-33539.  3r33553. 3r? 3539.  3r33553. 3r3111. 3r? 3539.  3r33553. 3r3114. 3r? 3539.  3r33553. 3r3117. 3r? 3539.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. In these pictures, the contrast of the screen is slightly trimmed by setting the divider to output Vo - 18 kΩ (to power): 10 kΩ (to ground), although without it the contrast “by default” is quite acceptable. 3r? 3539.  3r33553. 3r? 3539.  3r33553. I then added a function to the given example that reproduces an arbitrary number within three to four decimal places - positive or negative, integer or floating point, that is, the total number of characters can reach five: "-12.7", for example. Since the dot in the seven-segment code does not occupy a separate familiarity, the maximum number of digits displayed is 4. Input parameters for this function are: a) an array (char buf[5]) Containing the ACSII representation of the number, b) the actual number of characters in it ( ii from 1 to 5) and c) the position (pos from 0 to 9) where to put the first (left) sign of the number (the functions and designations used along the way refer to the eshkinkot publication or in the example by reference): 3r339353 .  3r33553. 3r? 3539.  3r33553.
3r33232. Function code [/b] 3r33333. 3r33434. 3r33464. void writeASCIIdig_serial (char buf[5], byte ii, byte pos)
//displays the number from the buffer 3r33553. {3r33553. boolean dot; //sign of the presence of a point in the array 3r35353. //align the number to the right, starting from pos:
pos = pos + (4-ii); 3r33553. //if there is a point, then a symbol is less: 3r33553. for (byte i = 0; i <= ii; i ++) if (buf== '.') pos ++; 3r33553. //print bitwise: 3r33553. for (byte i = 0; i <= ii; i++){
//if the next character is a point, then output with a dot:
if (buf[i+1]== '.') dot = true; else dot = false; 3r33553. switch (buf .[i]) {//decoder ASCII -> the 7-segment code
case '0':
writeSymbol (pos, DIGIT_ZERO, dot);
break;
case '1':.
writeSymbol (pos, DIGIT_ONE , dot); 3r35353. break; 3r35353. case '2': 3r-35353. writeSymbol (pos, DIGIT_TWO, dot);
break; 3r35353. case '3': 3r35353. writeSymbol (pos, DIGITTHREE, for the same, 3) break; 3r35353. case '4': 3r35353. writeSymbol (pos, DIGIT_FOUR, dot); 3r3-35353. break; 3r33553. case '5': 3r35353. writeSymbol (pos, DIGIT_FIVE, dot); 3r3535353 break; 3rr 6 ': 3r35353. WriteSymbol (pos, DIGIT_SIX, dot); 3r33553. Break; 3r35353. Case' 7 ': 3r35353. WriteSym bol (pos, DIGIT_SEVEN, dot); 3r3-35353 break; 3r33553. case '8': 3r33553. writeSymbol (pos, DIGIT_EIGHT, dot); 3r33553. break; 3r33553. case '9': 3r33553. writeSymbol (pos, DIGIT_NINE, dot); 3r33553. break; 3r33553. case '-': 3r33553. writeSymbol (pos, SYMBOL_MINUS, dot); 3r33553. break; 3r33553.} //end decoder
if (buf[i]! = '.') pos ++; //if not a point, then +1 position 3r3353553.} //end for i
} 3r33553. 3r3504. 3r? 3539.  3r33553. 3r3-3549. 3r3-3549. 3r? 3539.  3r33553. The MT-10T7 module for control output of numeric values ​​is more convenient than ordinary line-matrix displays: it has large numbers and the decimal point does not occupy a separate place and, therefore, it is possible to fit one more character in the same positions. But for my purposes it is more convenient if there is a possibility of outputting letters (otherwise, the direction will have to be output in compass degrees, which is somewhat unusual). Therefore, for this case, I turned my attention to the single-size matrix MT-10S? which is identical in size, which, despite a number of shortcomings, moved into the finished design. At the same time, he already has a backlight, which MT-10T7 is deprived of (for this it was necessary to immediately buy MT-10T8), and I decided that in this case its presence would not hurt. 3r? 3539.  3r33553. 3r? 3539.  3r33553.
MT-10S1

3r? 3539.  3r33553. The display MT-10S1 letters-tsifirki and a half times smaller, but also quite decent size. In addition, his screen is economically packaged in general dimensions: there are no 10-digit imported counterparts, but in Winstar WH1601L (where the characters are even slightly smaller in height) there is one millimeter more of the total length of the board and the screen. Well, almost twice the consumption of the controller (compared with the same WH1601L). Actually, this is where the advantages end, then “features” begin. 3r? 3539.  3r33553. 3r? 3539.  3r33553. The module boasts that, as already mentioned, it has a controller that is compatible with HITACHI HD44780. That is, it should work without favorite strains with your favorite Liquid Crystal. Moreover, the “default” page of the coding coincides with the English-Cyrillic page of the HD44780 and its numerous analogues, that is, the MT-10S1 should work without problems with Liquid Crystal Rus, no code pages are required for this to switch. And he really does it all, but with nuances. 3r? 3539.  3r33553. 3r? 3539.  3r33553. The first caveat - in the single-line version, the developers, apparently, save on registers, and only 8 characters of a string (addresses 00h - 07h) fall into one register, and the remaining two characters belong to another register (40h-41h). That is, the display is a de facto two-line, just the two lines are physically located in one line. Upon closer inspection, it turned out that the same is true for the WH1601 (only there the second register occupies the full eight bits). Why is it so inconveniently done - it is completely unclear in ordinary displays 16x2 sixteen-bit registers, and hardly such a truncation makes the product cheaper, rather the opposite because of the need to produce different versions of the controller (if they are different, which I am not at all sure about). I thought it was connected with this less than usual, the consumption of MT-10S? but the same WH1601 consumes 1.2-1.4 mA, that is, is no different from its advanced counterparts. 3r? 3539.  3r33553. 3r? 3539.  3r33553. Well, it would seem, and all right - in Liquid Crystal Rus the function setDRAMModel () and the corresponding constant LCD_DRAM_WH1601 were revealed. For this mode, the library has an obvious address translation: 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. if (ac> 7 && ac <0x14) command(LCD_SETDDRAMADDR | (0x40+ac-8));
3r3-33539.  3r33553. But I don’t know how it works on other single-line displays, and MT-10S1 in this mode refuses to work at all - the screen remains just empty. Since this is about addressing, you can’t fix it by a simple self-written function on top of the library, but I didn’t pick the library and find out what was wrong - I already have half a dozen Liquid Crystal versions that I’ve already modified; Further. 3r? 3539.  3r33553. 3r? 3539.  3r33553. Display MT-10S1 must be declared as two-line: lcd.begin (1? 2); (instead of 16 you can substitute 10 or 1? nothing will change, since the actual number of characters in one line is still 8). Attempting to initialize it as a single-line one (tsifirka 1 in the second position) will lead to a failure — the background will turn dark. And it is possible to output multi-digit numbers only within 8 characters, for longer lines, extreme characters over 8 will simply disappear. Therefore, 9 and 10 characters either actually are suitable only for displaying auxiliary quantities (units of measurement, for example), or you need to split the string-number into separate digits, and when switching to the 8th character, change the cursor position to the first character of the second row. 3r? 3539.  3r33553. 3r? 3539.  3r33553. For the suffering here is You can download a test sketch for this display (connecting leads - in the text of the sketch or in the diagram below). By the way, the contrast (which is not a word in the factory datasheet, and the output Vo is designated as NC) is adjusted in the usual way, but you really shouldn’t do that: in the absence of backlight, the background seems a bit darkish, but when you try to lighten it by connecting the divider to Vo output the contrast is noticeably lost when the backlight is turned on. 3r? 3539.  3r33553. 3r? 3539.  3r33553.

Interface with controller 3r3508. 3r? 3539.  3r33553. After checking that everything works as it should, the question of how to dock it all with the controller of the sensor rose to its full height. To provide control from it directly, the sensor controller didn’t have enough free outputs, and there was no wish to fence the township with large controllers - it’s more convenient when building the system is modular, and the display doesn’t interfere with the basic algorithm already debugged before. It remained to use any of the serial interfaces. 3r? 3539.  3r33553. 3r? 3539.  3r33553. This suggests I 2 The C-solution is based on PCF8574 (or its numerous analogs), especially since this chip itself is simply a fancy shift register, and therefore consumes several tens of μA during operation and less than 10 μA alone. In conjunction with the MT-10T? they form an excellent pair for creating low-power devices with indication, and MELT even has a ready-made version for this case: 3r-3251. MT-10T11
with a total consumption of 30 μA. 3r? 3539.  3r33553. 3r? 3539.  3r33553. But for the MT-10S1 there is no such convenient solution - for some reason, additions in the form of PCF8574 analog among MELT line displays are provided only with versions 20x4 (3r3257. UPD: 3r33300) in the comments suggested that there is still MT-16S2H configuration 16x2 with this the same interface, however, its dimensions go beyond the dimensions I need). Ready module of the type described in this article 3r3443. In this case, it is inconvenient to use, since the second unpleasant feature of the MT-10S1 display is non-standard pinout. The conclusions are all the same (HD44780 after all, more precisely, its domestic analogue KB1013VG6), but are arranged completely in an irregular way. I checked the 16x1 import and the two-line /four-line MELT for the sake of interest - they all have a standard order of conclusions, and for some reason stands out from the MT-10S1. So it is necessary to fence the homemade solution. 3r? 3539.  3r33553. 3r? 3539.  3r33553. As a result, I simply put the same ATmega328 controller on the display, which was programmed in the same way — via UNO, and then inserted into the socket on a separate board, equipped with only the necessary accessories for starting: quartz with conder, power capacity and RC circuit the Reset pin (see sensor layout 3r33232. in the original article 3r3443., where the controller is connected in a similar pattern). 3r? 3539.  3r33553. 3r? 3539.  3r33553.
3r33232. By the way, about the chain of Reset [/b] 3r33333. By the way, about the chain of Reset: I have a capacitor as large as 1 µF there on a resistor of a few kΩ, that is, the delay time when the power is turned on is several milliseconds. Is not it too much? The manual teaches us that, like for the whole Mega family, the external chain is not required here at all, the correct start is in theory implemented by the internal scheme, and much faster. But the habit of putting an external RC-chain on pin 1 of the controller to delay start up when I turned on has remained with me since the time of the already forgotten AVR Classic family, where the controller could not start correctly if the supply voltage was not sufficiently fast. And in the Mega Brown-out Detector family, it may not work very well. In critical cases, it is still worthwhile to install an external power monitor, well, and here the RC-chain will not interfere with anything, but it can help in cases with poor power sources. The developers of the Arduino boards are, by the way, well aware, because on the Uno board, for example, there is the same 10 kOhm /100 nF chain. 3r? 3539.  3r33553. 3r3-3549. 3r3-3549. 3r? 3539.  3r33553. And two identical AVR-controllers God himself ordered to dock using the usual Serial-interface, which all the same, except the programming process, is not used anywhere else in this project, and for the use of which everything is already at hand. By the way, such a solution does not differ from the price of components based on PCF8574 and can easily compete with it in terms of energy saving in the version with MT-10T7 - in case the MT-10T11 mentioned above is not at hand. 3r? 3539.  3r33553. 3r? 3539.  3r33553. The total circuit of the MT-10S1 module with a controller is as follows (in the diagram, the designation of the ATmega328 pins is given in brackets after the pins of the Arduino board): 3r33939.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. 3r? 3539.  3r33553. In the controller, I applied the power saving mode (well, yes, it is not very necessary here, but why keep the chip on all the way without need?). Moreover, the awakening occurs on a signal from the same generator of the meander on a 555 chip, as the clocking of the main controller, only this time along the falling front (FALLING), in order to slightly separate the functions of measuring and sending data. 3r? 3539.  3r33553. 3r? 3539.  3r33553.
3r33232. The riddle of nature [/b] 3r33333. One mystery of nature is connected with this, which I could not solve. It is known that Mega can only be brought out of the state of deep sleep by an external asynchronous interrupt, since the clock generator is turned off and the synchronous interrupt simply cannot occur. And the whole family of 28-pin AVR controllers, leading its ATmega8 pedigree (48/88/168/328), has as such only the INT0 and INT1 interrupts for a low level. All official recommendations are related to this in both Atmel and Arduino sites. In the example on the site arduino.cc it is directly written: “ [i] In all but the IDLE sleep modes only LOW can be used
". And as if it is not questioned, for example, Monk repeats Monc 3r3304 in more detail. in his book : “ Note that the interrupt type is LOW. This is the only interrupt type that can be used in this example. Types RISING, FALLING and CHANGE will not work ". 3r? 3539.  3r33553. 3r? 3539.  3r33553. Interruption by a low level is very inconvenient to use, since once having occurred, with this lowest level at the output it will happen again and again, and special measures must be taken to get rid of unnecessary alarms. So, picking on the forums in search of various solutions to this problem, I suddenly stumbled upon a couple of times on code examples in which INT0 such as RISING or FALLING is used to get out of sleep. Of course, I attributed this to the account of the illiteracy of the authors. But when here is stumbled over the phrase: “ Although you can use any other type of interrupt (RISING, FALLING, CHANGE) - they all take the processor out of the sleep state. "Then decided, in spite of the enemies, to conduct a live experiment - the blessing for this was all at hand. 3r? 3539.  3r33553. 3r? 3539.  3r33553. And, to my amazement, everything worked fine. Power saving mode - SLEEP_MODE_PWR_DOWN; because of the uselessness here, I did not take measures to further reduce consumption by turning off all other functions, but still the clock generator is deliberately off. Nevertheless, the controller regularly wakes up on the falling edge, requests data, displays it on the display and falls asleep again. For the purity of the experiment, I removed the MK from the UNO board and inserted it into my socket with the quartz connected, and still everything continued to work. This is evident from the consumption: almost 17 mA in normal mode and 0.9-1 mA with power saving turned on (of which 0.7 mA should be attributed to the display). 3r? 3539.  3r33553. 3r? 3539.  3r33553. Without leaving my amazed state, I re-read the datasheets from Atmel, looked into Evstifeev’s book (with their translation), even looked at the old Atmel’s allowance for the Classic family, then spent half a day searching for at least some explanation of what was happening (and in Russian and in English) in two well-known to all search engines, but nowhere did not find even a hint. Unless Atmel’s Application Notes wasn’t useful, because it’s doubtful that something contradicting datasheets was posted there. I would be happy if someone who knows will explain to me what I misunderstand here. 3r? 3539.  3r33553. 3r3-3549. 3r3-3549. 3r? 3539.  3r33553. The transfer of data from the sensor controller to the display controller via UART is organized in the form of a dialogue. When waking up, every 4th interrupt the display controller requests data in turn: 3r-3539.  3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. . . . . . 3r33553. if (flag == 1) {//the flag is set every 4th interrupt ~ 6 with 3r35353. Serial.print ('T'); //send a request for data 3r35353. while (! Serial.available ()); //waiting for degrees T
iit = Serial.readBytes (buft, 5); //count 5 bytes maximum, 3r35353. //in ii, the actual read amount is 3r33553. Serial.print ('H'); //send a request for data 3r35353. while (! Serial.available ()); //waiting for the humidity of 3r35353. iihh = Serial.readBytes (bufhh, 5); //count 5 bytes maximum, 3r35353. //in ii, the actual read amount is 3r33553. Serial.print ('S'); //send a request for data 3r35353. while (! Serial.available ()); //waiting for 3r35353 speed. iiss = Serial.readBytes (bufss, 5); //count 5 bytes maximum, 3r35353. //in ii, the actual read amount is 3r33553. Serial.print ('D'); //send a request for data 3r35353. while (! Serial.available ()); //waiting for the direction of 3r35353. iid = Serial.readBytes (bufd, 5); //count 5 bytes maximum, 3r35353. //in ii, the actual read amount is 3r33553. flag = 0; //reset request flag 3r35353.} 3r33553. . . . . . 3r33553. 3r3504. 3r? 3539.  3r33553. Here, buft, bufhh, bufss, and bufd are arrays (not strings!) Of five bytes, which contain data on temperature, humidity, speed, and direction in the form of an ASCII decomposition of the corresponding numbers. In order not to take too much, an abbreviated timeout for reception is specified in setup'e: 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. . . . . . 3r33553. Serial.begin (9600); 3r33553. Serial.setTimeout (10); //time limit 10 milliseconds 3r33553. . . . . . 3r33553. 3r3504. 3r? 3539.  3r33553. It is more convenient to display: firstly, you immediately have the length of the received number, secondly, the Serial.print () function from the sensor controller side still sends an ASCII string, with the pauses set at exactly the same 10 ms between the packages :
 3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. . . . . . 3r33553. //send data to display on request: 3r33553. if (Serial.available ()> 0) //wait for 3r33553 request. {char ch = Serial.read (); 3r33553. if (ch == 'T') {3r33553. Serial.print (temperature, 1); 3r33553. delay (10);} 3r35353. if (ch == 'H') {3r33553. Serial.print (humidity, 0); 3r33553. delay (10);} 3r35353. if (ch == 'S') {3r33553. float wFrq = (3 + 0.8 * f) /10; //from hertz in meters per second
if (wFrq> 0.3) Serial.print (wFrq, 1); 3r33553. else Serial.print (0.?1); 3r33553. delay (10);} 3r35353. if (ch == 'D') {3r33553. //Serial.println (wind_G); 3r33553. Serial.println (wind_Avr); 3r33553. delay (10); 3r33553.} //end ch 3r35353.} //end serial 3r35353. . . . . . 3r33553. 3r3504. 3r? 3539.  3r33553. The calculation of speed in m /s here is identical to that which is performed in the main module of the station (the start-off threshold is set at random to 0.3 m /s) and will also have to be changed according to the calibration results. 3r? 3539.  3r33553. 3r? 3539.  3r33553. If you try to accept data with the usual Serial.read () and then display the result of the reception with a function like lcd.print (t, 1), where t is the temperature in degrees, for example, 12.? then MT-10S1 responds to such the command will output "49.5". Guess or prompt? These are the first three characters in the sequence "??? 55", that is, in the ASCII decomposition of the number "12.7". Therefore, it is easier to immediately receive an array of characters and directly display as many characters as were sent (count is the counter that is incremented by 1 each interrupt): 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. . . . . 3r33553. if (count% 8 == 0) {//every 8 interrupts output 3r33553. lcd.clear (); 3r33553. if (buft[0]! = '-') lcd.print ("+"); 3r33553. for (byte i = 0; i < iit; i++)
lcd.print (buft[i]); //derived the temperature 3r35353. lcd.setCursor (? 0);
for (byte i = 0; i 3rr3424. lcd.print ( bufhh[i]); //derived the humidity of 3r3-35353. lcd.setCursor (? 1); 3r3-35353. lcd.print ("%");
} 3r33553. if ((count + 4)% 8 == = 0) {//after another 4r3r3553. lcd.clear (); 3r3553. lcd.setCursor (? 0); 3r35353. for (byte i = 0; i 3rr322. lcd.print (bufss[i]); //speed out 3r33553. Lcd.setCursor (? 0); 3r33553. Dir_dd (bufd); //we deduce the direction 3r35353.} 3r35353 .3r3553. 3r3503.
 3r33553. The last line needs decoding. The point is that the direction data is sent in code 0-15 (to which they are still transferred from the Gray code when implementing 3r3442. Of vector averaging 3r3443.). In the case of the seven-segment MT-10T7 display, they were converted to compass degrees: 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. . . . . . 3r33553. dd = atoi (bufd); //convert to the number 3r35353. dd = dd * 22.5; //recalculated to degrees 3r33553. itoa (dd, bufd, 10); //convert back to string 3r33553. . . . . . 3r33553. 3r3504. 3r? 3539.  3r33553. And here we can write directly in Russian letters, as well as in the main module of the weather station (which is why this display, in fact, was chosen): 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33434. 3r33464. . . . . . 3r33553. void dir_dd (char dd[]) 3r3-33553. {switch (atoi (dd)) {3r35353. case 0: 3r35353. {lcd.print ("C"); break;} 3r35353. case 1: 3r?553. {lcd.print ("CCA"); break;} 3r35353. case 2: 3r?553. {lcd.print ("CZ"); break;} 3r35353. case 3: 3r35353. {lcd.print ("ZSZ"); break;} 3r35353. case 4: 3r35353. {lcd.print ("W"); break;} 3r35353. case 5: 3r35353. {lcd.print ("ZYUZ"); break;} 3r35353. case 6: 3r35353. {lcd.print ("SW"); break;} 3r35353. case 7: 3r35353. {lcd.print ("LUS"); break;} 3r35353. case 8: 3r35353. {lcd.print ("u"); break;} 3r35353. case 9: 3r35353. {lcd.print ("YUV"); break;} 3r35353. case 10: 3r35353. {lcd.print ("SE"); break;} 3r35353. case 11: 3r35353. {lcd.print ("VYuV"); break;} 3r35353. case 12: 3r35353. {lcd.print ("B"); break;} 3r35353. case 13: 3r35353. {lcd.print ("HFC"); break;} 3r35353. case 14: 3r35353. {lcd.print ("CВ"); break;} 3r35353. case 15: 3r35353. {lcd.print ("CCB"); break;} 3r35353.} //end switch
} //end dir
. . . . . 3r33553. 3r3504. 3r? 3539.  3r33553.
Appearance

3r? 3539.  3r33553. The photo shows the appearance of the display with a connected controller in working condition: 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33515. 3r? 3539.  3r33553. 3r? 3539.  3r33553. Here is the module of the modified sensor assembly: 3r33939.  3r33553. 3r? 3539.  3r33553. 3r33524. 3r? 3539.  3r33553. 3r? 3539.  3r33553. The backlight options are those shown in the diagram above. Since the voltage drop across the backlight in the MELT modules is 4.5 V, then at 12 V power supply, the backlight current is 50 mA (at the maximum for this module 60 mA). 3r? 3539.  3r33553. 3r? 3539.  3r33553. The case is maximally sealed to avoid ingress of moist air inside (the black frame of the display screen is made of rubber sheath of a thin cable). The white plate on the right is the enclosure of the SHT-75 humidity-temperature sensor, which is outside the enclosure (the sensor itself is located behind it). The yellow wire above is a 433 MHz transmitter antenna. On the left are the connectors where the speed and direction sensors are connected. 3r? 3539.  3r33553. 3r? 3539.  3r33553. And this is what the readings on the display of the main module of the weather station look like (the black module with the white antenna on the right is a 433 MHz receiver): 3r3539.  3r33553. 3r? 3539.  3r33553. 3r33541. 3r3-3549. 3r33553. 3r33553. 3r33553. 3r33546. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r33547. 3r33553. 3r3-3549. 3r33553. 3r33553. 3r33553. 3r33553.

It may be interesting

  • Comments
  • About article
  • Similar news
smith 27 January 2019 20:56
There's a dedicated website that will tell you whether or not a particular game is going to run smoothly on your computer. After a download, this cool page will determine if you meet the requirements for a particular game. After you have obtained the game data, you can always delete the download.
PTC Creo 3.0 Crack
Windows Movie Maker 2018 Crack

weber

Author

25-11-2018, 05:34

Publication Date

Development / Programming microcontrollers

Category
  • Comments: 1
  • Views: 398
Modernization of obsolete UK wind farms
Self-made jet aircraft: “Two morons are
The new material will help make thermal
48 megapixels for smartphone
Budget temperature monitoring in the
Modify the player Vanilla Music for
Write a comment
Name:*
E-Mail:


Comments
LIMITED EDITION Experience Virtual Reality Now! Version 2.0 Discount40% OFF See More15% OFFFASHION & ACCESSORIESApparel Fashion Price starting from $ 5.99 See More20% OFFLIVEBYCARE Combo 5x Pillows Color Discount20% OFF Shop Now Bluetooth Latest Speakers Price starting from $ 22.99 XBOX CONTROLLER WHITE COLOR Discount 10% SMART APPLE PRODUCTS 15% OFF12% LISTEN TO REAL MUSIC WITH BEATS [url = https: //topofferscart.online/] Health & Fitness [/ url]

Today, 15:57

nushra45

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article...Adsense Safe Traffic
Today, 14:50

jacksonseo

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. 123 movies
Today, 12:11

Legend SEO

Cảm ơn vì đã chia sẻ bài viết này. Tôi rất vui khi thấy bài viết tuyệt vời này.https://skribblio.co/
Today, 04:38

gm massi melissa012021


Can I find someone to write my paper for me free? At our cheap for-pay academic help service with writers across all subjects. Discover more about us here.
write a paper online free
Yesterday, 19:45

nushra45

Adv
Website for web developers. New scripts, best ideas, programming tips. How to write a script for you here, we have a lot of information about various programming languages. You are a webmaster or a beginner programmer, it does not matter, useful articles will help to make your favorite business faster.

Login

Registration Forgot password