ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Electronic notebook. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Microcontrollers The new element base makes it possible to create compact and economical devices capable of writing text into their memory using a personal computer and then reading it offline. The article describes a kind of "notebook" in which you can store up to 64 KB of text information. The schematic diagram of the device is shown in fig. 1. Its basis is the PIC16F84 (DD1) PIC controller. The text is stored in the DS1 chip of a non-volatile Flash memory with a l2C serial interface (see the article by A. Dolgoy "Memory chips with an l2C interface. Features and application" in "Radio", 2001, No. 2, pp. 24-26; No. 3, pp. 25, 26). Through this interface, implemented in software, the microcontroller DD1 reads information from DS1 and transmits it to the liquid crystal (LCD) indicator HG1. Before reading or writing each byte, the address of this cell is transferred to the memory cell of the DS1 chip. This slows things down somewhat, but it prevents the problems associated with different page sizes that can occur when using chips from different manufacturers. In addition to the actual LCD indicator, ITM-1602ATR / R (HG1) incorporates an HD44780 controller that organizes data exchange with the DD1 microcontroller, has a character generator for character output and is responsible for displaying information on the screen. To reduce the number of ports used by the DD1 microcontroller, the exchange with HG1 is carried out via a four-bit interface, in which eight-bit data is transmitted in tetrads in two stages. In this mode of operation, the outputs DB0-DB3 of the indicator are not used. The "notebook" is controlled using the SB1-SB3 buttons: the first two are used to scroll the text and move the menu cursor, and the third one is to open the menu and confirm the selection of its items. Since all input lines of port B are connected to the power supply through resistors, there is no need for external resistors to "pull up" the RB5-RB7 ports to the power line. Since the device does not require high accuracy in timing, an RC circuit (R1C3) is used as the frequency-setting elements of the clock generator of the DD1 microcontroller. The generator works only when the microcontroller accesses the memory or the LCD indicator, while waiting for a button to be pressed, it is turned off and the microcontroller is in low power mode. When the power is turned on, the splash screen appears for a short time on the indicator screen, after which the device enters the menu mode. Now, by moving the cursor with the SB1 ("←"), SB2 ("→") buttons and confirming the command with the SB3 ("*") button, you can switch to the reading mode (item "R"), to the "sleep" mode (item "S "), place the cursor at the beginning of the text (point "H") or at its end (point "E"). In this mode, the screen also displays the current position of the text in hexadecimal form. When reading, the text is "leafed" with the SB1 and SB2 buttons, the return to the menu is carried out with the SB3 button. Trimmer resistor R5 is used to adjust the contrast of the image on the indicator HG1. From the "sleep" mode, the device is displayed by pressing any button. To exchange information between the "notebook" and the computer, a special program is used, with which you can transfer text both from the computer to the device, and vice versa. The program is a simplified text editor with the ability to load text into a "notebook" and unload from it. To download text to the device, you need to open a text file in ASCII format using the "File-Open" menu, and then, possibly, having made some changes to this text in the editor window, use the "E-Book → Upload" menu to start the download process. You can prepare the text for downloading in any other text editor, and then copy it through the Windows clipboard into the program editor window. Unloading text from the "notebook" is done through the menu "E-Book → Download". After that, the text can be saved to an ASCII file or transferred to another program via the clipboard. Program operation parameters (LPT port number and "notebook" memory capacity) are changed through the "Settings → Parameters" menu. The exchange is carried out through an adapter cable, the diagram of which is shown in fig. 2. Plug XP1 is connected to the parallel (LPT) port of the computer. On transistors VT1, VT2, the function of an open collector element is implemented, which is required to work with the l2C bus. The SCL and SDA lines are connected to the input lines of the LPT port (pins 13 and 12, respectively) to monitor the status of the first and receive data via the second from the computer. When working with a computer, the l2C bus operates in the "Multi Master" mode. To resolve conflicts, it uses the following algorithm: before any of the master devices is about to exchange with memory, it monitors the signal level on the SCL line for some time. If during this time there was no logic zero level on it, the master device starts an exchange with the memory. Otherwise, it continues to monitor the state of the SCL line. Since such an algorithm is not always able to eliminate conflicts, it is not recommended to press the "notebook" buttons while exchanging information with the computer. Power is supplied to the DS1 chip and the HG1 indicator through the RB4 port of the DD1 microcontroller. This allows you to put the device into "sleep" mode programmatically. In this case, power is supplied only to the microcontroller, which also goes into "sleep" mode (the clock generator is turned off), and the current consumed by the device is reduced to a value not exceeding ten microamperes. Returning to the reading mode, as noted, is done by pressing any button on the device. In this case, the controller exits the "sleep" mode, supplies power to the memory chip and the indicator, and performs the initialization procedure for the latter. After that, you can continue to read the "book" from the position that was current at the time the device was put into "sleep" mode. Most parts of the device are mounted on a printed circuit board, made in accordance with Fig. 3. The device can use the PIC16F84 or PIC16F84A microcontroller in any version. DS1 - any chip with an l2C interface from the AT24C01-AT24C512 series (memory capacity from 128 bytes to 64 KB) from ATMEL or other manufacturers. At the same time, for each microcircuit, they use their own version of the controller firmware. In principle, it is possible to use from one to eight memory chips, setting a unique address for each, depending on their type, using the address inputs AO-A3, but this will require adjustment of the controller program. The program codes for the AT24C512 chip are shown in the table. LCD indicator HG1 - two-line (16 characters per line) by Intech with Russian character generator. You can use other one- and two-line indicators of this company or similar ones from other companies whose controller is compatible with the HD44780. In this case, in the microcontroller program, you need to adjust the values of the width and height variables. If indicators with a large number of lines are used, a more serious modification of the program will be required. Indicators with the HT44780 controller are available with various character generators. If it is not possible to purchase an indicator with a Russian character generator, when entering text, it is permissible to replace Russian letters with similar ones in Latin or use transliteration (write Russian words in Latin letters). This feature is included in the program. When text is transferred to the "notebook", the characters are automatically replaced with the ones specified by the user. The character replacement table can be changed through the menu "Settings → Options" of the program. When programming the DD1 microcontroller, you need to set the following bit values in the configuration word: generator type (OSC) - RC, watchdog timer (WDT) - disabled, delay after power-up (PWRTE) - enabled. To power the device, a voltage of 4 ... 5 V is required (three galvanic cells of size AAA or four disk batteries D-0,1). Operation is maintained when the battery voltage drops to 3 V, however, reading information from the LCD indicator in this case is difficult. As an XS1 socket (see Fig. 1), the device uses a connector from stereo headphones used in imported equipment. Plug XP1 (see fig. 2) - computer DB-25M. Transistors VT1, VT2 (any silicon low-power npn structures) and resistors R1, R2 are hinged mounted inside the XP1 plug. The length of the connecting cable is no more than 2 m. Project files: source texts and codes for the "firmware" of the PIC-controller ROM for the 2x16 indicator and various memory chips from the indicated series, as well as a program for working with the "notebook". Author: S.Kuleshov See other articles Section Microcontrollers. Read and write useful comments on this article. Latest news of science and technology, new electronics: Air trap for insects
01.05.2024 The threat of space debris to the Earth's magnetic field
01.05.2024 Solidification of bulk substances
30.04.2024
Other interesting news: ▪ Pedals in front make the bike more comfortable ▪ Our mirror neurons are dependent on money. News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site Electrical safety, fire safety. Article selection ▪ Metropolitan article. History of invention and production ▪ article What is osmosis? Detailed answer
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |