⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jps_tb.lst

📁 PIC12F629定时器1工作于异步方式,只要32.768KHz晶振误差5ppm,时间误差小于1秒/月.
💻 LST
字号:
CCS PCM C Compiler, Version 3.187, 16465

               Filename: C:\Documents and Settings\kk13\My Documents\My eBooks\Software\JPS_TB_070605\jps_tb.LST

               ROM used: 81 (8%)
                         Largest free fragment is 943
               RAM used: 10 (16%) at main() level
                         11 (17%) worst case
               Stack:    1 worst case (0 in main + 1 for interrupts)

*
0000:  MOVLW  00
0001:  MOVWF  0A
0002:  GOTO   043
0003:  NOP
0004:  BTFSC  03.5
0005:  GOTO   00A
0006:  MOVWF  22
0007:  SWAPF  03,W
0008:  MOVWF  23
0009:  GOTO   00F
000A:  BCF    03.5
000B:  MOVWF  22
000C:  SWAPF  03,W
000D:  MOVWF  23
000E:  BSF    23.1
000F:  MOVF   0A,W
0010:  MOVWF  27
0011:  CLRF   0A
0012:  BCF    03.7
0013:  SWAPF  22,F
0014:  MOVF   04,W
0015:  MOVWF  24
0016:  MOVF   20,W
0017:  MOVWF  25
0018:  MOVF   21,W
0019:  MOVWF  26
001A:  BCF    03.5
001B:  MOVLW  8C
001C:  MOVWF  04
001D:  BTFSS  00.0
001E:  GOTO   021
001F:  BTFSC  0C.0
0020:  GOTO   030
0021:  MOVF   24,W
0022:  MOVWF  04
0023:  MOVF   25,W
0024:  MOVWF  20
0025:  MOVF   26,W
0026:  MOVWF  21
0027:  MOVF   27,W
0028:  MOVWF  0A
0029:  SWAPF  23,W
002A:  MOVWF  03
002B:  BCF    03.5
002C:  SWAPF  22,W
002D:  BTFSC  23.1
002E:  BSF    03.5
002F:  RETFIE
....................  /////////////////////////////////////////////////////////////////////////  
.................... ////                         EX_PATG.C                               ////  
.................... ////                                                                 ////  
.................... ////  This program will output multiple square waves from the pins   ////  
.................... ////  of port b.  The waves can be differnt frequencies, and can be  ////  
.................... ////  seen by hooking up a scope to any of the pins.                 ////  
.................... ////                                                                 ////  
.................... ////  Configure the CCS prototype card as follows:                   ////  
.................... ////     Connect any of pins 47 through 53 to a scope.               ////  
.................... ////     See additional connections below.                           ////  
.................... ////                                                                 ////  
.................... ////  This example will work with the PCM and PCH compilers.  The    ////  
.................... ////  following conditional compilation lines are used to include a  ////  
.................... ////  valid device for each compiler.  Change the device and clock   ////  
.................... ////  for your hardware if needed.                                   ////  
.................... /////////////////////////////////////////////////////////////////////////  
.................... ////        (C) Copyright 1996,2003 Custom Computer Services         ////  
.................... //// This source code may only be used by licensed users of the CCS  ////  
.................... //// C compiler.  This source code may only be distributed to other  ////  
.................... //// licensed users of the CCS C compiler.  No other use,            ////  
.................... //// reproduction or distribution is permitted without written       ////  
.................... //// permission.  Derivative programs created using this software    ////  
.................... //// in object code form are not restricted in any way.              ////  
.................... /////////////////////////////////////////////////////////////////////////  
....................   
.................... #include <12f629.h>                   //包含头文件 
....................  //////// Standard Header file for the PIC12F629 device ////////////////  
.................... #device PIC12F629  
.................... #list  
....................  
.................... #use delay(clock=32768)               //使用晶振32.768kHz  
.................... #fuses NOWDT,XT, PUT, PROTECT         //不使用看门狗,使用外部晶振,代码保护  
....................   
.................... #define TIME_LOAD 4000    //65536-(6*32768/4) 6S  定时器装载时间为6S  
.................... byte    sys01mincnt, last01mincnt;  
.................... //byte  sys10mscnt,sys1scnt,sys1mincnt,last01mincnt,sys01mincnt;  
.................... #define LED             PIN_A0  
.................... #define MOTOR_Control   PIN_A1  
.................... #define SPRING_SWITCH   PIN_A2  
....................   
.................... /*  
.................... #if defined(__PCM__)  
.................... #include <12F629.h>  
.................... #fuses HS,NOWDT,NOPROTECT,NOLVP  
.................... #use delay(clock=20000000)  
....................   
.................... #elif defined(__PCH__)  
.................... #include <18F452.h>  
.................... #fuses HS,NOWDT,NOPROTECT,NOLVP  
.................... #use delay(clock=20000000)  
.................... #endif*/  
.................... /*  
.................... #define NUM_OUTPUTS  7  
....................   
.................... //NOTE:  periods MUST be multiples of 400  
.................... //Periods are in microseconds  
.................... #define  PERIOD_0 400  
.................... #define  PERIOD_1 800  
.................... #define  PERIOD_2 1600  
.................... #define  PERIOD_3 2000  
.................... #define  PERIOD_4 20000  
.................... #define  PERIOD_5 64000  
.................... #define  PERIOD_6 2000000  
....................   
....................   
.................... const long wave_period[NUM_OUTPUTS] = {  
....................             PERIOD_0/400, PERIOD_1/400, PERIOD_2/400, PERIOD_3/400,  
....................             PERIOD_4/400, PERIOD_5/400, PERIOD_6/400};  
....................   
.................... long counter[NUM_OUTPUTS] = {0,0,0,0,0,0,0};  
....................   
.................... int port_b_image;  */  
....................   
....................   
.................... // This interrupt is used to output the waveforms.  The interrupt  
.................... // is automatically called ever 200us.  
.................... #INT_TIMER1  
.................... void wave_timer() {  
....................    int i;  
....................   
....................   set_timer0(TIME_LOAD);  //6秒到,重装载Timer0 的值  
0030:  MOVLW  A0
0031:  MOVWF  01
....................   if(--sys01mincnt==0){   //sys01mincnt自减后为0吗??

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -