打印
[其他产品]

microchip mplabx 使用总结(一)

[复制链接]
3272|20
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
最近在使用dsPIC33FJ256GP506A这个芯片,我的IDE是MPLAB X IDE V5.30(xc16-v1.34-full-install-windows-installer)遇到些小问题,总结如下;

    1、关于单片机的开发资料链接如下:

    https://www.microchip.com/wwwproducts/en/dsPIC33FJ256GP506A

    2、可以在以上链接下载code example.

        遇到的问题是,下载的代码无法直接打开,查看readme发现用的是MPLAB C30,这个软件比较 老,在网上不好找。

       在工程中选择inport,选项也不能正常导入;

      换个思路解决问题,直接新建工程吧,问题解决了;

使用特权

评论回复
沙发
王派oo|  楼主 | 2021-7-30 18:21 | 只看该作者
方法如下:选择file-->new project -->Existing MPLAB IDE V9 Project,然后一路next问题搞定;

使用特权

评论回复
板凳
王派oo|  楼主 | 2021-7-30 18:25 | 只看该作者
2、编译完成后提示:‘../src/main.c:337:1: warning: '_FOSCSEL' definition has been deprecated: consider migrating to #pragma config’

解决办法请参考:

Microchip Developer Help

https://microchip.wikidot.com/mplabx:view-and-set-configuration-bits

使用特权

评论回复
地板
王派oo|  楼主 | 2021-7-30 18:28 | 只看该作者
View and Set Configuration Bits

使用特权

评论回复
5
王派oo|  楼主 | 2021-7-30 18:30 | 只看该作者
Configuration Bits
Configuration bits are a collection of specialized bits that can only be modified at program time. Configuration bits are "read" during reset and enable or disable hardware features in the microcontroller. The features controlled by the configuration bits include, but are not limited to, the clock source, Watchdog Timer, Brown-Out detect, and Memory Read protection. Configuration bits are not executable code. Essentially, they are fuses located in the program memory space.

使用特权

评论回复
6
王派oo|  楼主 | 2021-7-30 18:30 | 只看该作者
How Configuration Bits are Set
Each Microchip device has its own set of configuration bits. Individual device datasheets contain the definition for each of the bits. For example, find configuration bit information in the "Special Features" section of most PIC® MCU datasheets.

The setting for each configuration bit can be determined by directives written in the application software. The syntax for the configuration bit settings is available from the compiler or associated library manual. For example, the MPLAB® XC8 compiler manual contains information on setting configuration bits using #pragma, whereas to the AVR® Libc manual contains information on setting fuses (avr/fuse.h) and lockbits (avr/lock.h) using macros.

This tutorial will show how to generate the proper configuration code without consulting the compiler manual for the proper syntax.

使用特权

评论回复
7
王派oo|  楼主 | 2021-7-30 18:33 | 只看该作者
How to Display the Configuration Bits Window
From the main menu, select Window > Target Memory Views > Configuration Bits. The Configuration Bits window will open in a tab in the Output area under the editor.

使用特权

评论回复
8
王派oo|  楼主 | 2021-7-30 18:33 | 只看该作者

使用特权

评论回复
9
王派oo|  楼主 | 2021-7-30 18:34 | 只看该作者
Note: Read Device Memory is required for AVR and SAM devices to ensure correct configuration bit values before editing. When device memory is read, the window text changes from red to black.

使用特权

评论回复
10
王派oo|  楼主 | 2021-7-30 18:38 | 只看该作者

使用特权

评论回复
11
王派oo|  楼主 | 2021-7-30 18:40 | 只看该作者
How to Set Configuration Bits
In the Configuration Bits window, click on any value in the Options column and it will turn into a combo box that will allow you to select the value you desire. The example below shows the Watchdog Timer changed from enabled to disabled.

使用特权

评论回复
12
王派oo|  楼主 | 2021-7-30 18:46 | 只看该作者

使用特权

评论回复
13
王派oo|  楼主 | 2021-7-30 18:47 | 只看该作者
How to Generate Initialization Code
Although you can read, change, and write device configuration bits using the Configuration Bits window, these settings will only apply to the current device. To ensure any device programmed with the application will have the correct setup of configuration bits, controls on the window can generate code to be placed in your application.

Note: The code generation feature is currently not available for SAM devices using the Arm GCC compiler.

使用特权

评论回复
14
王派oo|  楼主 | 2021-7-30 18:49 | 只看该作者

使用特权

评论回复
15
王派oo|  楼主 | 2021-7-30 18:50 | 只看该作者

使用特权

评论回复
16
王派oo|  楼主 | 2021-7-30 18:51 | 只看该作者

使用特权

评论回复
17
kxsi| | 2021-8-13 13:12 | 只看该作者
怎么都是英文提示的啊

使用特权

评论回复
18
coshi| | 2021-8-13 13:15 | 只看该作者
请问这个是什么工具啊

使用特权

评论回复
19
drer| | 2021-8-13 13:16 | 只看该作者
非常宝贵的经验总结

使用特权

评论回复
20
gwsan| | 2021-8-13 13:17 | 只看该作者
下边的这个配置框能看出什么问题来呢

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

17

主题

306

帖子

0

粉丝