嗨,MCC的I2C驱动程序代码中有很多bug,我已经搜索了一段时间,并发布了一些修改。你在为哪个代码创建设备?MCC有3个单独的脚本文件,用于8位PIC设备、16位PIC设备和PIC32 MX设备。没有MCC V3.55 BTW。版本号3.55是MPLAB X集成开发环境的版本号。MCC V3.262是当前可安装的MCC插件的版本号。然而,在MPLAB X.MCC中,使用不同的设备族的模板和方法库。您使用的是什么库和版本?一般来说,I2C信号线SDA和SCL必须由外部上拉电阻拉高到数字逻辑电平。在I2C驱动程序初始化之前,I/C通信用的I/O引脚应该配置为数字输入。如果I/C引脚用于I2C,可以用作模拟输入,那么ANA。对于这些引脚,必须禁用日志模式,这是通过清除ANSELx寄存器中的比特来实现的,对于大多数现代PIC器件而言,如果PIC器件具有外围引脚选择(PPS),那么I2C输入和输出必须设置为相同的引脚。在启动I2C通信之前必须启用中断处理。阳离子,通过调用I2C2MyMraveScript(…)或I2C2MigrtBiSnSert(…),这些功能将通过为I2C模块设置主中断标志来启动中断处理。如果不能自行获得正确的中断标志,则可以打包完整的问题项目,并附加消息。Er是一个工具,用于打包在一个zip文件中恢复程序项目所需的所有文件。在“Project”面板中,通常在MPLAB窗口的左上部分,指向项目树的根,点击右键并选择“包”。如果你问得很好,一些william hill官网
成员可以尝试帮助。问候,Mysil。
以上来自于百度翻译
以下为原文
Hi,
There are various bugs in I2C driver code generated by MCC,
I have hunted around for some time, and published modifications on some occations.
What device are you creating code for?
MCC have 3 separate collections of script files for 8-bit PIC devices, 16-bit PIC devices, and PIC32MX devices.
There is no MCC v3.55 BTW.
Version number 3.55 is version number of MPLAB X Integrated Development Environment.
MCC v3.26.2 is version number of the current MCC plugin that may be installed in MPLAB X.
MCC however, use a library of templates and methods that is different for different families of devices.
What library and
version are you using?
In general, I2C signal lines SDA and SCL must be pulled up to High digital logic level, by external pull-up resistors.
I/O pins to be used for I2C communcation should be configured as Digital Inputs before I2C driver is initialized.
If I/O pins to be used for I2C may be used as Analog input, then analog mode must be disabled for these pins,
this is done by clearing bits in ANSELx register, for most modern PIC devices.
If the PIC device have Peripheral Pin Select, (PPS), then I2C Inputs and Outputs must be set to the same pins.
Interrupt processing must be enabled before trying to start I2C communcation,
by calling I2C2_MasterWrite(...), or I2C2_MasterTRBInsert(...).
These functions will initiate interrupt processing by setting master interrupt flag for the I2C module.
If you cannot get it correct by yourself, you may package a complete problem project, and attach with a message.
In MPLAB X, there is a tool to package all files needed to restore a program project, in a zipfile.
In 'Projects' panel, usually in the upper left part of MPLAB window, point to root of the project tree,
click righthand button and select 'Package'.
If you ask nicely, some forum member may try to help.
Regards,
Mysil
嗨,MCC的I2C驱动程序代码中有很多bug,我已经搜索了一段时间,并发布了一些修改。你在为哪个代码创建设备?MCC有3个单独的脚本文件,用于8位PIC设备、16位PIC设备和PIC32 MX设备。没有MCC V3.55 BTW。版本号3.55是MPLAB X集成开发环境的版本号。MCC V3.262是当前可安装的MCC插件的版本号。然而,在MPLAB X.MCC中,使用不同的设备族的模板和方法库。您使用的是什么库和版本?一般来说,I2C信号线SDA和SCL必须由外部上拉电阻拉高到数字逻辑电平。在I2C驱动程序初始化之前,I/C通信用的I/O引脚应该配置为数字输入。如果I/C引脚用于I2C,可以用作模拟输入,那么ANA。对于这些引脚,必须禁用日志模式,这是通过清除ANSELx寄存器中的比特来实现的,对于大多数现代PIC器件而言,如果PIC器件具有外围引脚选择(PPS),那么I2C输入和输出必须设置为相同的引脚。在启动I2C通信之前必须启用中断处理。阳离子,通过调用I2C2MyMraveScript(…)或I2C2MigrtBiSnSert(…),这些功能将通过为I2C模块设置主中断标志来启动中断处理。如果不能自行获得正确的中断标志,则可以打包完整的问题项目,并附加消息。Er是一个工具,用于打包在一个zip文件中恢复程序项目所需的所有文件。在“Project”面板中,通常在MPLAB窗口的左上部分,指向项目树的根,点击右键并选择“包”。如果你问得很好,一些william hill官网
成员可以尝试帮助。问候,Mysil。
以上来自于百度翻译
以下为原文
Hi,
There are various bugs in I2C driver code generated by MCC,
I have hunted around for some time, and published modifications on some occations.
What device are you creating code for?
MCC have 3 separate collections of script files for 8-bit PIC devices, 16-bit PIC devices, and PIC32MX devices.
There is no MCC v3.55 BTW.
Version number 3.55 is version number of MPLAB X Integrated Development Environment.
MCC v3.26.2 is version number of the current MCC plugin that may be installed in MPLAB X.
MCC however, use a library of templates and methods that is different for different families of devices.
What library and
version are you using?
In general, I2C signal lines SDA and SCL must be pulled up to High digital logic level, by external pull-up resistors.
I/O pins to be used for I2C communcation should be configured as Digital Inputs before I2C driver is initialized.
If I/O pins to be used for I2C may be used as Analog input, then analog mode must be disabled for these pins,
this is done by clearing bits in ANSELx register, for most modern PIC devices.
If the PIC device have Peripheral Pin Select, (PPS), then I2C Inputs and Outputs must be set to the same pins.
Interrupt processing must be enabled before trying to start I2C communcation,
by calling I2C2_MasterWrite(...), or I2C2_MasterTRBInsert(...).
These functions will initiate interrupt processing by setting master interrupt flag for the I2C module.
If you cannot get it correct by yourself, you may package a complete problem project, and attach with a message.
In MPLAB X, there is a tool to package all files needed to restore a program project, in a zipfile.
In 'Projects' panel, usually in the upper left part of MPLAB window, point to root of the project tree,
click righthand button and select 'Package'.
If you ask nicely, some forum member may try to help.
Regards,
Mysil
举报