Summary of Common Problems in Program Migration

Publisher:等放假的LwjLatest update time:2015-05-07 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Phenomenon:

        The chip driver is normal, and there is no problem in implementing the functional application separately. However, when it was transplanted to the main program, the clock display stopped, the touch screen failed, and the parameter display had problems.

Reason:
        In the development of the chip driver, a problem was ignored. That is, the IO resources occupied by the chip pins should not change the normal function of other pins during initialization. The functions of the remaining functional pins were artificially changed when the chip was initialized. The function of its multiplexing function was changed to an output pin. Only the IO pins when the chip was working normally were paid attention to, and the multiplexing status of the remaining IO ports was ignored. After that, the initialization operation of IO in the original main program was analyzed one by one, and the problem was found by comparing one by one.

Solution:
        Reinitialize the interface and retain the function multiplexing of the remaining pins.        

Summary:
        Work carefully and don't take it for granted. Stay calm after a problem occurs. It is wrong to bite people, haha. . .

 1.

      The timing requirements of the delay chip are very strict. The most basic time unit must be very accurate, accurate to the microsecond level. This is the basis for subsequent work. Because C language is used for programming, it is not very good to control the length of the delay. Therefore, the test method is used. In order to minimize the error as much as possible, the test time is extended. The basic idea is to print the time on the screen after a certain delay, and analyze the relationship between the interval between the two times and the specific delay parameters. For example: when the delay parameter is 60000000, is the time interval between the two times less than 1 minute? [Note: 60000000us=1min]

2. Verification of chip read and write operations

    Perform chip self-verification, write data to the fixed bytes of the chip register, and then read it out byte by byte to compare whether the written and read data are the same. 

3. The necessity of non-volatile operation

    RAM data register is used for internal calculation and data access, and the data is lost after power failure. In order to save the data information that needs to be saved for a long time, the relevant data information needs to be copied from the register to the EEPROM.
    After power-on reset, the chip automatically copies the relevant bytes in the EEPROM to the RAM.

4. Necessity of non-essential operations

    When the chip reads, first read the lower 8 bits of the data, then read the upper 8 bits of the data. Whether it is the lower 8 bits or the upper 8 bits, they are read one by one from the lowest bit. Even if the lower bits are unnecessary bytes, they must be read out. This is called a rule.

Reference address:Summary of Common Problems in Program Migration

Previous article:A high-precision and low-cost temperature measurement solution
Next article:error:undeclared name solution

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号