सेवा हॉटलाइन
मॉनिटर या प्रिंटर पर चीनी अक्षरों को प्रदर्शित करने के लिए, ग्राफिक प्रतीकों के अनुसार चीनी अक्षरों को डॉट मैट्रिक्स में डिजाइन किया जाता है, और संबंधित डॉट मैट्रिक्स कोड (ग्लाइफ कोड) प्राप्त किया जाता है।
The unified encoding method used to represent Chinese characters in computers is called internal code (such as national standard code), and the internal code is unique (equivalent to the ID number of the character). The Chinese character encoding formed to facilitate the input of Chinese characters is an input code, which is an external code of Chinese characters. The input code is different due to different encoding methods and is diverse. The Chinese character code formed for displaying and printing out Chinese characters is a glyph code. The computer finds the glyph code of the Chinese character in the font model library through the Chinese character internal code and realizes its conversion.
इन-कैमरा कोड
According to the provisions of the national standard code, each Chinese character has a certain binary code, but this code will conflict with the ASCII code when processed internally by the computer. To solve this problem, add 1 to the first byte of each byte of the national standard code. Since the ASCII code only uses 7 bits, the "1" in the first place can be used as a mark to identify Chinese character codes. When the computer processes the code with "1" in the first place, it understands it as Chinese character information, and when it processes the code with "0" in the first place, it understands it as an ASCII code. The national standard code (internal code) processed in this way is the internal code.
यदि हम इस "口" ग्राफ़िक के "." को "0" से बदल दें, तो हमें "口" का ग्लिफ़ कोड बहुत स्पष्ट रूप से मिल जाता है: 0000H 0004H 3FFAH 2004H 2004H 2004H 2004H 2004H 2004H 2004H 2004H 2004H 3FFAH 2004H 0000H 0000H। जब कंप्यूटर "口" को आउटपुट करना चाहता है, तो वह सबसे पहले डिस्प्ले फ़ॉन्ट लाइब्रेरी का पहला पता ढूंढता है, "口" के आंतरिक कोड के आधार पर गणना करता है, और फिर "口" का ग्लिफ़ कोड ढूंढता है, और फिर कैरेक्टर जनरेटर के नियंत्रण के माध्यम से ग्लिफ़ कोड (बाइनरी में) के अनुसार स्क्रीन को क्रमिक रूप से स्कैन करता है। जहां बाइनरी कोड "0" है, वहां "0" वाले स्थान को स्कैन किया जाता है, और "1" वाले स्थान को हाइलाइट करने के लिए स्कैन किया जाता है, जिससे "口" का अक्षर पैटर्न प्राप्त किया जा सकता है।
चीनी अक्षर फ़ॉन्ट राष्ट्रीय मानक कोड के क्रम में व्यवस्थित होते हैं और बाइनरी फ़ाइलों के रूप में मेमोरी में संग्रहीत होते हैं, जिससे एक चीनी अक्षर फ़ॉन्ट लाइब्रेरी बनती है, जिसे चीनी अक्षर ग्लिफ़ लाइब्रेरी या चीनी अक्षर लाइब्रेरी भी कहा जाता है।
दो एन्कोडिंग विधियाँ, हेडर फ़ाइल देखें
GB1616.h//------------------ Data structure definition of Chinese character font ------------------------//struct typFNT_GB16 //Chinese character font data structure { unsignedchar Index[3]; //Chinese character internal code index unsignedchar Msk[32]; //Dot matrix code data }; ///////////////////////////////////////////////////////////////////////////// Chinese character font table //// Chinese character library: Song style 16.dot, horizontal modulo left high bit, data arrangement: left to right, top to bottom ///////////////////////////////////////////////////////////////////////////// conststruct typFNT_GB16 codeGB_16[]= //Data table {/*------------------------------------------------------------------------------------------------ Source file/text: Xu; Width×Height (pixels):16×16---------------------------------------------------------------------------------*/ "Xu",0x10,0x80,0x10,0x80,0x21,0x40,0x42,0x20,0x94,0x10,0x1B,0xEC,0x20,0x80,0x60,0x8 0,0xAF,0xF8,0x20,0x80,0x22,0xA0,0x24,0x90,0x2A,0x88,0x21,0x00,0x00,0x00,0x00,0x00,
This structure is very simple:One is the internal code, a dot matrix sequence. The previous dot matrix library was placed in the order of the internal code, and no internal code index was needed. If only some Chinese characters were placed, the internal code index was needed. (The Chinese character "Xu" in the front is to find the dot matrix sequence of the word when outputting "Xu". This dot matrix sequence is written by myself. When displayed with 1602, because the chip has an English dot matrix sequence in the memory, there is no need to write it.) Generally, two bytes are enough for the internal code. If you use one more byte, you just add a trailing 0. In this way, the Chinese character string can be directly placed in the Chinese character internal code;
13,12864 LCD:
प्रत्येक डिस्प्ले पॉइंट एक बाइनरी संख्या को दर्शाता है, 1 का अर्थ है चालू, 0 का अर्थ है बंद। इन डॉट मैट्रिक्स सूचनाओं को संग्रहित करने वाली रैम को डिस्प्ले डेटा मेमोरी कहा जाता है। किसी विशिष्ट ग्राफ़िक या चीनी अक्षर को प्रदर्शित करने के लिए, संबंधित डॉट मैट्रिक्स सूचना को संबंधित स्टोरेज यूनिट में लिखना होता है।
ग्राफ़िक्स रैम का एड्रेस काउंटर (AC) केवल क्षैतिज एड्रेस (X अक्ष) को एक से स्वचालित रूप से बढ़ाता है। जब क्षैतिज एड्रेस = 0FH होता है, तो इसे 00H पर रीसेट कर दिया जाता है। हालांकि, यह ऊर्ध्वाधर एड्रेस को कैरी के साथ स्वचालित रूप से नहीं बढ़ाता है। इसलिए, जब लगातार कई डेटा लिखे जाते हैं, तो प्रोग्राम को यह निर्धारित करने की आवश्यकता होती है कि ऊर्ध्वाधर एड्रेस को रीसेट करने की आवश्यकता है या नहीं।
14,Graphics RAM (GDRAM)
The drawing display RAM provides 128×8 bytes of memory space. When changing the drawing RAM, first write the horizontal and vertical coordinate values continuously, and then write two bytes of data to the drawing RAM. The address counter (AC) will automatically increase the horizontal address (X address) by one. When the horizontal address is 0XFH, it will be reset to 00H; the vertical address will not be automatically incremented by 1. The drawing display must be turned off during writing to drawing RAM.
[cpp] view plain copy//Display Chinese characters voiddispString (uchar X, Y,uchar *msg) //Which row is X and which column is Y. msg is Chinese characters { if(X==0) X = 0x80; // First line, Chinese characters display coordinates else if(X==1) write_data(*msg++); //Display Chinese characters } } ////////////////////////////////// //////////////// //////////////// // Display image voiddisppicture(uchar code *adder) { uint i,j; //*******Display the upper half screen content setting for(i=0;i<32;i++) // 32 column addresses in the upper half of the screen { write_com(0x80 + i); //SET vertical address VERTICALADD write_com(0x80); //SET horizontal address HORIZONTAL ADD for(j=0;j<16;j++) { write_data(*adder); adder++; } } //************Display the content settings of the lower half of the screen for(i=0;i<32;i++) // { write_com(0x80 + i); //SET vertical address VERTICALADD write_com(0x88); //SET horizontal address HORIZONTAL ADD for(j=0;j<16;j++) { write_data(*adder); adder++; } } } For the C language, space is automatically allocated for a defined variable, and its address is the name of the variable. Through this name, the data can be retrieved in the memory and new data can be obtained through calculation. However, in assembly, the programmer needs to define the storage space and send the data to the accumulator for calculation. Every step requires the programmer's operation. In C language, these processes are completed by the compiler.
15,Some useful FAQs
①. माइक्रोकंट्रोलर C भाषा में वेरिएबल्स का मेमोरी एलोकेशन कैसे होता है? क्या कंपाइलर कंपाइलेशन प्रक्रिया के दौरान एलोकेशन और रीसाइक्लिंग कोड को समझदारी से जोड़ता है? मुख्य बात यह है कि मैंने जो प्रोग्राम बनाया है, उसमें मेमोरी ओवरफ्लो की त्रुटि न हो, यह मैं कैसे सुनिश्चित करूँ? यदि मैं रिकर्सिव ऑपरेशन कर रहा हूँ, तो मेमोरी की आवश्यकता का अनुमान स्वयं लगाना कठिन है।
2. क्या माइक्रोकंट्रोलर में C भाषा का उपयोग चर परिभाषा के मामले में सीमित रहेगा? उदाहरण के लिए, फ्लोटिंग-पॉइंट डेटा के गुणन और भाग के ऑपरेशन असेंबली भाषा में लिखे जाते हैं, और कोड काफी जटिल होता है। यदि इसे सीधे C भाषा में लिखा जाए, तो क्या यह बहुत सरल नहीं हो जाएगा?
③. माइक्रोकंट्रोलर की C भाषा द्वारा जनरेट की गई हेक्स फ़ाइल में, क्या इंस्ट्रक्शन और डेटा ROM का एड्रेस वितरण कंपाइलर द्वारा स्वचालित रूप से निर्धारित किया जाता है? क्या उपयोगकर्ता इसे निर्धारित कर सकते हैं?
Answer 1: The microcontroller program written in C language is first compiled by a program (it seems to be c51.exe). After the compilation is completed, the storage space size of the variables has been arranged, but the specific address has not yet been allocated (the address is floating). Next, another program (it seems to be a51.exe) is connected. After the connection, the specific address is determined.
यदि बहुत अधिक वेरिएबल हों, तो कंपाइलर यह संकेत देगा कि डेटा सेगमेंट बहुत बड़ा है। मेमोरी ओवरफ्लो त्रुटि से बचने के लिए, मुख्य बात यह देखना है कि स्टैक ओवरफ्लो तो नहीं हो रहा है, और यह अनुभव पर निर्भर करता है।
माइक्रोकंट्रोलर की C भाषा में आमतौर पर रिकर्सन की अनुमति नहीं होती है, और रिकर्सिव ऑपरेशन से आमतौर पर बचा जाता है। आखिर माइक्रोकंट्रोलर पीसी नहीं होते, जिससे उनकी गति प्रभावित होती है। यदि आप रिकर्सन करना चाहते हैं, तो डीएसपी चिप का उपयोग करना अधिक उपयुक्त है। संक्षेप में, आपको उपयुक्त चिप का चयन करना आना चाहिए।
उत्तर 2: चर का आकार (अंकों की संख्या) आमतौर पर चिप संचायक में अंकों की संख्या के बराबर होता है। उदाहरण के लिए, 51 आमतौर पर 8 बिट्स का उपयोग करता है क्योंकि यह एक 8-बिट माइक्रोकंट्रोलर है।
माइक्रोकंट्रोलर बिट वैरिएबल को परिभाषित कर सकता है, लेकिन बिट एरे को परिभाषित नहीं कर सकता। C भाषा में लिखना सरल लगता है, लेकिन वास्तव में इससे सबसे अधिक कोड बनता है। नियंत्रण के लिए उपयोग किया जाने वाला माइक्रोकंट्रोलर फ्लोटिंग पॉइंट ऑपरेशन का शायद ही कभी उपयोग करता है, जो न केवल धीमा है बल्कि परेशानी भरा और जगह भी लेता है। यदि यह एक DSP चिप है, तो उपयुक्त हार्डवेयर संरचना होना कहीं बेहतर होगा।
उत्तर 3: सामान्यतः, यह स्वचालित रूप से आवंटित होता है। इसे C भाषा और असेंबली भाषा के मिश्रण में प्रोग्राम किया जा सकता है, या इसे Keil C का उपयोग करके ऑनलाइन असेंबल किया जा सकता है। चिप और बाहरी वातावरण के बीच डेटा का आदान-प्रदान पोर्ट के माध्यम से होता है।
अस्वीकरण: यह लेख "इंटरनेशनल इलेक्ट्रॉनिक बिजनेस इन्फॉर्मेशन" से लिया गया है। यह लेख केवल लेखक के निजी विचारों को दर्शाता है और सैको माइक्रो या उद्योग जगत के विचारों का प्रतिनिधित्व नहीं करता है। यह केवल पुनर्मुद्रण और साझाकरण के लिए है और बौद्धिक संपदा अधिकारों के संरक्षण का समर्थन करता है। पुनर्मुद्रण के लिए कृपया मूल स्रोत और लेखक का उल्लेख करें। यदि कोई उल्लंघन होता है, तो कृपया इसे हटाने के लिए हमसे संपर्क करें।
कंपनी का फ़ोन नंबर: +86-0755-83044319
फैक्स: +86-0755-83975897
ईमेल: 1615456225@qq.com
QQ: 3518641314 मैनेजर ली
QQ: 332496225 प्रबंधक किउ
पता: कमरा नंबर 809, बिल्डिंग सी, झांताओ टेक्नोलॉजी बिल्डिंग, 1079 मिंझी एवेन्यू, लोंगहुआ न्यू डिस्ट्रिक्ट, शेन्ज़ेन




粤公网安备44030002007346号