1、综述:
总体来看,这款芯片功能齐全:
ADC
cps
DAC
DSM
USART
SR latch
timer(3)
2、存储
2048的RAM
3、寄存器详解
寄存器种类
3.1、核心寄存器
WREG|
PCLATH|
INTCON|
INDF0
INTCON寄存器
状态寄存器
3.2、特殊功能寄存器
The Special Function Registers are registers used bythe application to control the desired operation of peripheral functions in the device. The registers associated with the operation of the peripherals are described in the appropriate peripheral chapter of this
data sheet.
这种类型的寄存器主要用于控制外设
3.3、通用寄存单元
The general purpose registers are a group of RAM locations in the file register that are used for data storage and scratch pad. Each location is 8 bits wide and can be used to store any data we want as long as it is 8 bit. Again, the number of RAM locations in the file register that are set aside for general purpose registers can vary from chip to chip, even among members of the same family. In the PIC micro-controllers, the space that is not allocated to the special function registers is used for general purpose registers. That means in a PIC chip with a thousand-byte file register, no more than 100 bytes are used for special function registers are the rest are used for general purpose registers. A larger GPR size means more difficulties in managing these registers if you use assembly language programming. In today’s high performance micro-controllers, with a over of thousand bytes of GPR, the job of managing them is handled by the C compilers. Indeed, the C compilers are the very reason we need a large GPR since it makes it easier for C compilers to store parameters and perform their jobs much faster.
4、点灯
#include __CONFIG(0xFF32); //配置字 void main() { TRISA = 0; //设置a为输出模式 PORTA =0x00000001; //输出 while(1); //循环 } 5、汇编程序分析 下图 program memory 查看汇编代码 Address Disassembly 000 GOTO 0x1 跳转到INDF 001 CLRF 0x8 清零BSR 002 GOTO 0x7f6 跳转到0x7f6 736 MOVWI [-1]FSR1 737 MOVWI [-1]FSR1 7F5 MOVWI [-1]FSR1 7F6 MOVLB 0 BSR =0 7F7 GOTO 0x7f8 跳转到0x7f8 7F8 MOVLB 0x1 BSR = 1 7F9 CLRF 0xc 清零 PORTA 7FA MOVLW 0x1 w= 1 7FB MOVLB 0 BSR = 0 7FC MOVWF 0xc w=0xc 7FD GOTO 0x7fe 跳转到0x7fe 7FE GOTO 0x7fe 跳转到0x7fe 7FF GOTO 0x1 跳转到0x1 总结,这里我们要十分主义的是,我们每次改变BSR数值的时候,其实就是改变bank数据块,那么当BSR =1 的时候,我们再执行 movwf 0xc实际的起始地址是,bank1 的起始地址,所以这里的0xc实际上是指 0x8c TRISA
上一篇:PIC反汇编(二)汇编程序和c对照
下一篇:PIC16F1823开发笔记(一)准备和开发环境,资料推荐
推荐阅读最新更新时间:2024-11-08 18:02
设计资源 培训 开发板 精华推荐
- C8051F560DK,C8051F566 8051 MCU 工业应用开发系统
- 【训练营】多多彩灯+765924A
- BB-BBLK-000-ITEMP,基于 AM3358BZCZA100 Sitara AM3358 处理器的嵌入式 Planet BeagleBone Black Industrial Temp
- LTC4414 的典型应用 - 用于大型 PFET 的 36V、低损耗 PowerPath 控制器
- 使用 Diodes Incorporated 的 ZR78L08 的参考设计
- LT8570IMS8E 12V 电池稳定器可承受 40V 瞬变的典型应用
- 基于QXRS012的红外热释控制模块
- AM2S-4818SH30Z 18V 2瓦直流转直流转换器的典型应用
- SiC电动汽车功率逆变器控制参考平台
- 47amp-sim