liuhongen 发表于 2013-7-22 10:23:42

NEC单片机选项字节的使用

大家好:
    NEC单片机的选项字节怎么用啊?
    能否给个例子?
   
    谢谢

znw_cn 发表于 2013-7-22 11:38:58

主要设置看门狗、LVI等,数据手册已经有章节说明清楚,可在开发环境设置或编写相关语句。

liuhongen 发表于 2013-7-22 13:55:05

本帖最后由 liuhongen 于 2013-7-22 13:59 编辑

znw_cn 发表于 2013-7-22 11:38 static/image/common/back.gif
主要设置看门狗、LVI等,数据手册已经有章节说明清楚,可在开发环境设置或编写相关语句。 ...

我加了一个option.s的文件到PM+的Other Files目录下,内容如下:
OPT CSEG         OPT_BYTE
        DB                 10H                                          ; Does not use interval interrupt of watchdog timer,
                                                                ; Enables watchdog timer operation,
                                                                ; Window open period of watchdog timer is 25%,
                                                                ; Overflow time of watchdog timer is 210/fIL,
                                                                ; Stops watchdog timer operation during HALT/STOP mode
        DB                 0FFH                                          ; Stops LVI default start function
        DB                 0FFH                                         ; Reserved area
        DB                 85H                                         ; Enables on-chip debug operation, does not erase flash memory
                                                                ; data when security ID authorization fails
                                       
OPT2         CSEG         AT                 010C0H
                DB                                 10H           ; Does not use interval interrupt of watchdog timer,
                                                                ; Enables watchdog timer operation,
                                                                ; Window open period of watchdog timer is 25%,
                                                                ; Overflow time of watchdog timer is 210/fIL,
                                                                ; Stops watchdog timer operation during HALT/STOP mode
                DB                                 0FFH        ; Stops LVI default start function
                DB                                 0FFH                 ; Reserved area
                DB                                 85H           ; Enables on-chip debug operation, does not erase flash memory
                                                                ; data when security ID authorization fails       

之后我要怎么做啊?       

xiaoxei 发表于 2013-7-22 16:59:17

我也同求、

summarize 发表于 2013-7-23 08:06:46

liuhongen 发表于 2013-7-22 13:55 static/image/common/back.gif
我加了一个option.s的文件到PM+的Other Files目录下,内容如下:
OPT CSEG         OPT_BYTE
        DB                 10H                         ...

之后编译下载即可。

liuhongen 发表于 2013-7-23 08:55:20

summarize 发表于 2013-7-23 08:06 static/image/common/back.gif
之后编译下载即可。

编译下载进去之后,MCU还是复位啊,不需要其他设置了吗?

求解

summarize 发表于 2013-7-23 09:12:42

liuhongen 发表于 2013-7-23 08:55 static/image/common/back.gif
编译下载进去之后,MCU还是复位啊,不需要其他设置了吗?

求解

以前我用的和你一样,只是扩展名不是S,而是ASM,直接编译下载即可。可能你要检查配置是否正确,或是其它地方有没有错误。

liuhongen 发表于 2013-7-23 09:44:43

本帖最后由 liuhongen 于 2013-7-23 09:46 编辑

summarize 发表于 2013-7-23 09:12 static/image/common/back.gif
以前我用的和你一样,只是扩展名不是S,而是ASM,直接编译下载即可。可能你要检查配置是否正确,或是其它 ...

我刚才改为asm了,程序也只初始化Uart就进入Stop模式,然后就是Wile(1);还是复位
PM+中要不要设置下什么选项啊?

summarize 发表于 2013-7-23 10:30:43

liuhongen 发表于 2013-7-23 09:44 static/image/common/back.gif
我刚才改为asm了,程序也只初始化Uart就进入Stop模式,然后就是Wile(1);还是复位
PM+中要不要设置下什么选 ...

给你一个项目模板自己看吧

liuhongen 发表于 2013-7-23 12:51:17

summarize 发表于 2013-7-23 10:30 static/image/common/back.gif
给你一个项目模板自己看吧

谢谢summarize

xuanfong1 发表于 2014-4-27 14:23:20

路过路过 帮楼主攒下
页: [1]
查看完整版本: NEC单片机选项字节的使用