Continue with the bug of the IIC driver

Source: Internet
Author: User

If the last byte in the read process does not send ACK to the device, the device will not send data. Otherwise, the device will automatically send the byte data of the next address! The previous modification (http://blog.csdn.net/knock/archive/2009/11/02/4758818.aspx) is incorrect. Case master_receive :..... If (g_uiic_pt = g_uiic_datalen) {g_piicreg-> iiccon & = ~ (1 <7); // If you comment it out, the device continues to send data and enters the interrupted status multiple times }..... In general, there are two problems with the modification based on the original version: 1. modify it to the buffer of the driver to receive data on the IIC bus, and copy it to the application's buffer2. modify the iic_ist () in the interrupt service to determine a read or write completion condition if (bdone) {retailmsg (zone_info, (text ("setevent done/R/N"); bdone = false; // Add this setevent (g_htransferdone);} after the modification, my debugging assistant has no errors in reading and writing ~~ Open the camera application. After writing the register of the camera module, the exception 'data abort '(4): thread-id = 01840006 (PTH = 85aa48d4) will no longer appear ), proc-id = 00400002 (PPRC = 82699308) 'nk. EXE ', Vm-active = 04ec0006 (PPRC = 849cda50) 'cmder.exe' Pc = c0b721cc (cost + 0x000021cc) Ra = c0b721b8 (cost + 0x000021b8) sp = d283fe64, BVA = 0004f2cd. However, after the camera application is opened, the first three bytes of the read register are normal and there is ack. The fourth byte read is 0x00, after the camera application is closed, the oscilloscope captures data. Let the problem be solved first, and wait for free before looking for the cause.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.