1. 配置时钟

The bootloader generator is now fully integrated with MCC Libraries. To the maximum
extent possible, the bootloader leverages MCC for configuration and peripheral usage.
Thus, in addition to selecting the bootloader library, it is also required to select the
memory and supported communications “Peripherals”.
Here are the steps to generate a bootloader using MCC:

  1. First create a bootloader project and select your device.
  2. Select XC8 as the build tool (MCC generates XC8 C code).
  3. Start MCC.
  4. In the System Module, configure the oscillator. In general, faster is better for
    more reliable communications. For this example, the PIC16F18855 is selected,
    and configured to use the 32 MHz internal oscillator.
    引导加载程序生成器现在与MCC库完全集成。最大限度地在可能的情况下,引导加载程序利用MCC进行配置和外围设备的使用。因此,除了选择引导加载程序库之外,还需要选择内存和支持的通信“外设”。以下是使用MCC生成引导加载程序的步骤:
    1首先创建一个引导加载程序项目并选择您的设备。
    2选择XC8作为构建工具(MCC生成XC8 C代码)。
    3启动MCC。
    4在系统模块中,配置振荡器。一般来说,越快越好
    更可靠的通信。在本例中,选择了PIC16F18855,配置为使用32MHz内部振荡器。
2. 配置串口

不开启中断
Select EUSART. Check “Enable EUSART”, “Enable Transmit” and “Enable
Continuous Receive”. The baud rate does not matter because the bootloader
code auto-bauds to detect the incoming baud rate
选择EUSART。选中“启用EUSART”、“启用传输”和“启用连续接收”。波特率并不重要,因为引导加载程序代码自动波特率检测传入波特率

3. memory库

Select the Memory Peripheral. Nothing further needs to be configured. This will
include a memory.h file which has #defines that specify how big the Flash
memory is, write latches and erase row size.
选择内存外围设备。无需进一步配置。这个包括一个memory.h文件,该文件定义了闪存的大小内存是,写入锁存并擦除行大小。

The Reset vector must be aligned to the beginning of an erase row. The
Erase command erases the entire row. The bootloader needs to make sure
it does not erase any part of the bootloader, so any Erase command not
starting on a row boundary will be disallowed.
重置向量必须与擦除行的开始对齐。这个Erase命令删除整行。引导加载程序需要确保它不会擦除引导加载程序的任何部分,因此任何erase命令都不会不允许从行边界开始。

4. bootloader库

Select the Bootloader Generator library. Configure the bootloader for the desired
operation.
选择引导加载程序生成器库。为所需的配置引导加载程序操作。

5. GPIO配置

Open the Pin Manager Grid View. Configure pin selections for the bootloader
operation behavior. As shown below, the lab RA0 is used for the Bootloader
Indication pin (output), RA5 is the Bootloader entry pin (input), Tx and Rx are on
RC0 and RC1
打开管脚管理器网格视图。配置引导加载程序的引脚选择操作行为。如下所示,lab RA0用于引导加载程序指示引脚(输出),RA5为引导加载程序输入引脚(输入),Tx和Rx为onRC0和RC1

Select Pin Module from the Project Resources, “System” option. Configure
applicable pins to be digital by deselecting the analog check box option on all
pins used
从项目资源“系统”选项中选择“管脚模块”。配置通过取消选中“所有”上的“模拟”复选框选项,将适用的管脚设置为数字使用的引脚

6. 生成代码

点击 Generate 按钮生成.

7. 代码编译空间设置

For the final step, configure to only build within a specified memory space. Open
the Project Properties window; this can be done by right clicking on a project and
selecting properties. Select XC8 Linker, under the XC8 global options. Select
“Memory Model” under the Option Categories combo box. For example, entering
the value of 0-2FF would restrict the generated code to the first 0x300 words of
ROM when compiling project code. Refer to code size for appropriate ROM
reservation size. To best understand the required ROM range, after a successful
build of the Bootloader project, refer to the “PIC Memory Views” --> “Program
Memory”; or at the Window --> “Dashboard”, Memory Section.
对于最后一步,请配置为仅在指定的内存空间内生成。正常开放项目属性窗口;这可以通过右键单击项目和选择属性。在XC8全局选项下选择XC8链接器。选择选项类别组合框下的“内存模型”。例如,输入值0-2FF会将生成的代码限制为
编译项目代码时的ROM。参考代码大小以获得合适的ROM保留大小。为了更好地理解所需的ROM范围,成功后构建Bootloader项目,请参阅“PIC内存视图”->“程序内存”;或在窗口–>“仪表板”,内存部分。

Specify ROM ranges The compiler initially knows about on-chip ROM only. If external ROM is available then this can be specified via this option. Areas of on-chip ROM that must be reserved can also be listed. Examples: 0-7FF,1000-1FFF ignore on-chip ROM, use only specified ranges; default,3000-3FFF use default on-chip ROM, plus an additional range; default,-7F0-7FF use default ROM, but reserve 16 bytes at 7F0.
指定编译器最初只知道片上ROM的ROM范围。如果外部ROM可用,则可通过此选项指定。必须保留的片上ROM区域也可以列出。示例:0-7FF,1000-1FF忽略片上ROM,只使用指定的范围;默认值,3000-3FFF使用默认片上ROM,外加一个额外的范围;默认值,-7F0-7FF使用默认ROM,但在7F0保留16个字节。

MPLAB X IDE 生成PIC18xxx Bootloader代码相关推荐

  1. python代码运行不了怎么办_selenium ide 生成的 Python 代码无法执行是怎么回事?

    用的是 firefox 的 selenium ide 我随便测试一个代码就是点开了一个连接然后生成下面的代码但是无法运行, 提示ImportError: cannot import name 'sel ...

  2. MPLAB X IDE开发环境

    项目需要,安装了MPLAB X IDE,下面记录. 安装MPLAB除了本身的IDE外,还需要安装JAVA6.1开发环境,以及C编译器. 刚使用时发现按钮比较多,下面是常用的几个,若需要在线调试,直接按 ...

  3. GitHub开源:一键生成前后端代码神器

    目录 1.技术架构 2.微服务架构图 3.业务应用 本篇博客将为朋友们分享一款神器:JeecgBoot. JeecgBoot 是一款基于代码生成器的低代码开发平台,零代码开发.采用前后端分离架构:Sp ...

  4. 无需写代码!可一键生成前后端代码的开源工具

    作者 | HelloGitHub-小鱼干 来源 | HelloGitHub(ID:GitHub520) JeecgBoot 是一款基于代码生成器的低代码开发平台,零代码开发.JeecgBoot 采用开 ...

  5. quicktype游戏java程序_使用QuickType工具从json自动生成类型声明代码

    一.QuickType 工具功能简介 QuickType 是一款可以根据 json 文本生成指定语言(如 Type Script,C++,,Java,C#,Go 等)类型声明代码的工具. 例如我们在写 ...

  6. mplab x ide 中文使用手册_中文文档:MPLAB ICD 4在线调试器用户指南

    MPLAB® ICD 4在线调试器 用户指南 MPLAB® ICD 4在线调试器(DV164045)是Microchip最快且最经济高效的调试和编程工具,适用于Microchip PIC®.dsPIC ...

  7. Android Studio(2)---如何从不同IDE 工具开发的代码导入 Android Studio

    如何从不同IDE 工具开发的代码导入 Android Studio 将项目迁移至 Android Studio 需要适应新的项目结构.构建系统和 IDE 功能. 如果您要从 Eclipse 迁移至 A ...

  8. 一款无需写任何代码即可一键生成前后端代码的开源工具

    JeecgBoot 是一款基于代码生成器的低代码开发平台,零代码开发.JeecgBoot 采用开发模式:Online Coding 模式-> 代码生成器模式-> 手工 MERGE 智能开发 ...

  9. 使用TensorFlow搭建智能开发系统,自动生成App UI代码

    本文转自微信号EAWorld.扫描下方二维码,关注成功后,回复"普元方法+",将会获得热门课堂免费学习机会! 本文目录: 一.我们的现状与期望 二.我们的初级探索及建议 三.智能开 ...

最新文章

  1. 你竟然还不懂变分自编码机?这个16岁的OpenAI天才实习生讲得可透彻了
  2. 配置EIGRP默认路由
  3. ssh远程登录执行shell脚本,找不到jps
  4. java扫雷教程_java实现简单扫雷游戏
  5. Xamarin效果第十三篇之弹窗PopupPage
  6. 1059. C语言竞赛(20)
  7. 不能用了 重装系统git_怎么用光盘重装系统?
  8. Nginx04---编译安装
  9. jQuery——子元素筛选器
  10. 保姆级windows下mysql数据库安装教程
  11. ansible-playbook 通过mail模块发送邮件
  12. 环境配置 python 3.6+Anaconda+cuda9.0+cudNN7.0+Tensorflow
  13. 网络对抗技术 实验四
  14. SRM采购框架协议阶梯计价方法
  15. 2021/05/07 1031 查验身份证 (15 分)
  16. 云原生|容器和应用安全运营实践思考
  17. Web前端 HTML Day_01
  18. 大数据公司挖掘数据价值的49个典型案例!信息量很大
  19. 【前端圭臬】二:你知道的和不知道的 HTML
  20. 机械工业出版社计算机组成原理答案,计算机组成原理

热门文章

  1. 如何借助 AI ,生成专属图标? #iconify AI
  2. 杨虎之:从Motion追随到Mixin - Mixin Network开发者访谈
  3. 当你在浏览器中输入一个地址(一)——浏览器检查地址
  4. 民工网www.iamworker.com技术专题
  5. php生成eps矢量图,eps是什么文件
  6. 考研英语(高级阅读)补充习题
  7. golang协程报deadlock解决
  8. 前端项目中位图和矢量图的优缺点及iconfont小图标制作流程
  9. 爬楼梯问题总结(持续更新)
  10. (专升本)PowerPnt(幻灯片的主题、背景、母版)