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

📄 cc1100.lis

📁 极低功率UHF无线收发器 315/433/868和915MHz ISM/SRD波段系统 AMR-自动仪表读数 电子消费产品 RKE-两路远程无键登录
💻 LIS
📖 第 1 页 / 共 4 页
字号:
                        .module cc1100.c
                        .area lit(rom, con, rel)
 0000           _rfSettings::
 0000 00                .byte 0
 0001 0B                .byte 11
 0002 00                .byte 0
 0003 10                .byte 16
 0004 A7                .byte 167
 0005 62                .byte 98
 0006 2D                .byte 45
 0007 3B                .byte 59
 0008 73                .byte 115
 0009 A2                .byte 162
 000A F8                .byte 248
 000B 00                .byte 0
 000C 00                .byte 0
 000D B6                .byte 182
 000E 10                .byte 16
 000F 18                .byte 24
 0010 1D                .byte 29
 0011 1C                .byte 28
 0012 C7                .byte 199
 0013 00                .byte 0
 0014 B2                .byte 178
 0015 EA                .byte 234
 0016 0A                .byte 10
 0017 00                .byte 0
 0018 11                .byte 17
 0019 59                .byte 89
 001A 88                .byte 136
 001B 31                .byte 49
 001C 0B                .byte 11
 001D 06                .byte 6
 001E 06                .byte 6
 001F 05                .byte 5
 0020 45                .byte 69
 0021 F0                .byte 240
 0022 F0                .byte 240
 0023                   .dbfile E:\学习基地\IMPORT~1\CC1100-RF-Design\cc1100-design\Firmware\M8_cc1100_receive\cc1100.c
 0023                   .dbsym e rfSettings _rfSettings kX
                        .area text(rom, con, rel)
 0000                   .dbfile E:\学习基地\IMPORT~1\CC1100-RF-Design\cc1100-design\Firmware\M8_cc1100_receive\cc1100.c
 0000                   .dbfunc e delay _delay fV
 0000           ;              i -> R20,R21
 0000           ;              s -> R16,R17
                        .even
 0000           _delay::
 0000 00D0              rcall push_gset1
 0002                   .dbline -1
 0002                   .dbline 105
 0002           ; /*C**************************************************************************
 0002           ; * NAME:         cc1100.c
 0002           ; *----------------------------------------------------------------------------
 0002           ; * Copyright (c) 2007 endylu
 0002           ; *----------------------------------------------------------------------------
 0002           ; * RELEASE:      M8-cc1100
 0002           ; * REVISION:     1.0     
 0002           ; *----------------------------------------------------------------------------
 0002           ; * PURPOSE:
 0002           ; * This file include cc1100 receive and send function
 0002           ; *****************************************************************************/
 0002           ; 
 0002           ; /*_____ I N C L U D E S ____________________________________________________*/
 0002           ; 
 0002           ; #include <iom8v.h>
 0002           ; #include <macros.h>
 0002           ; #include "main.h"
 0002           ; /*_____ M A C R O S ________________________________________________________*/
 0002           ; 
 0002           ; 
 0002           ; /*_____ D E F I N I T I O N ________________________________________________*/
 0002           ; 
 0002           ; 
 0002           ; //------------------------------------------------------------------------------------------------------
 0002           ; // Chipcon
 0002           ; // Product = CC1100
 0002           ; // Chip version = E
 0002           ; // Crystal accuracy = 40 ppm
 0002           ; // X-tal frequency = 26 MHz
 0002           ; // RF output power = 0 dBm
 0002           ; // RX filterbandwidth = 540.000000 kHz
 0002           ; // Deviation = 0.000000 
 0002           ; // Datarate = 250.000000 kbps
 0002           ; // Modulation = (7) MSK
 0002           ; // Manchester enable = (0) Manchester disabled
 0002           ; // RF Frequency = 433.000000 MHz
 0002           ; // Channel spacing = 199.951172 kHz
 0002           ; // Channel number = 0
 0002           ; // Optimization = Sensitivity
 0002           ; // Sync mode = (3) 30/32 sync word bits detected
 0002           ; // Format of RX/TX data = (0) Normal mode, use FIFOs for RX and TX
 0002           ; // CRC operation = (1) CRC calculation in TX and CRC check in RX enabled
 0002           ; // Forward Error Correction = (0) FEC disabled
 0002           ; // Length configuration = (1) Variable length packets, packet length configured by the first received byte after sync word.
 0002           ; // Packetlength = 255
 0002           ; // Preamble count = (2)  4 bytes
 0002           ; // Append status = 1
 0002           ; // Address check = (0) No address check
 0002           ; // FIFO autoflush = 0
 0002           ; // Device address = 0
 0002           ; // GDO0 signal selection = ( 6) Asserts when sync word has been sent / received, and de-asserts at the end of the packet
 0002           ; // GDO2 signal selection = (11) Serial Clock
 0002           ; const RF_SETTINGS rfSettings = {
 0002           ;     0x00,
 0002           ;     0x0B,   // FSCTRL1   Frequency synthesizer control.
 0002           ;     0x00,   // FSCTRL0   Frequency synthesizer control.
 0002           ;     0x10,   // FREQ2     Frequency control word, high byte.
 0002           ;     0xA7,   // FREQ1     Frequency control word, middle byte.
 0002           ;     0x62,   // FREQ0     Frequency control word, low byte.
 0002           ;     0x2D,   // MDMCFG4   Modem configuration.
 0002           ;     0x3B,   // MDMCFG3   Modem configuration.
 0002           ;     0x73,   // MDMCFG2   Modem configuration.
 0002           ;     0xa2,   // MDMCFG1   Modem configuration.
 0002           ;     0xF8,   // MDMCFG0   Modem configuration.
 0002           ; 
 0002           ;     0x00,   // CHANNR    Channel number.
 0002           ;     0x00,   // DEVIATN   Modem deviation setting (when FSK modulation is enabled).
 0002           ;     0xB6,   // FREND1    Front end RX configuration.
 0002           ;     0x10,   // FREND0    Front end RX configuration.
 0002           ;     0x18,   // MCSM0     Main Radio Control State Machine configuration.
 0002           ;     0x1D,   // FOCCFG    Frequency Offset Compensation Configuration.
 0002           ;     0x1C,   // BSCFG     Bit synchronization Configuration.
 0002           ;     0xC7,   // AGCCTRL2  AGC control.
 0002           ;     0x00,   // AGCCTRL1  AGC control.
 0002           ;     0xB2,   // AGCCTRL0  AGC control.
 0002           ; 
 0002           ;     0xEA,   // FSCAL3    Frequency synthesizer calibration.
 0002           ;     0x0A,   // FSCAL2    Frequency synthesizer calibration.
 0002           ;     0x00,   // FSCAL1    Frequency synthesizer calibration.
 0002           ;     0x11,   // FSCAL0    Frequency synthesizer calibration.
 0002           ;     0x59,   // FSTEST    Frequency synthesizer calibration.
 0002           ;     0x88,   // TEST2     Various test settings.
 0002           ;     0x31,   // TEST1     Various test settings.
 0002           ;     0x0B,   // TEST0     Various test settings.
 0002           ;     0x06,    //IOCFG2    GDO2 output pin configuration.
 0002           ;     0x06,   // IOCFG0    GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed pseudo register explanation.
 0002           ; 
 0002           ;     0x05,   // PKTCTRL1  Packet automation control.
 0002           ;     0x45,   // PKTCTRL0  Packet automation control.
 0002           ;     ID_Oneself,   // ADDR      Device address.
 0002           ;     0xf0,    // PKTLEN    Packet length.
 0002           ; };
 0002           ; 
 0002           ; /*_____ D E C L A R A T I O N ______________________________________________*/
 0002           ; 
 0002           ; 
 0002           ; 
 0002           ; //*****************************************************************************************
 0002           ; //函数名:delay(unsigned int s)
 0002           ; //输入:时间
 0002           ; //输出:无
 0002           ; //功能描述:普通廷时
 0002           ; //*****************************************************************************************           
 0002           ; void delay(unsigned int s)
 0002           ; {
 0002                   .dbline 107
 0002 4427              clr R20
 0004 5527              clr R21
 0006 02C0              rjmp L5
 0008           L2:
 0008                   .dbline 107
 0008           L3:
 0008                   .dbline 107
 0008 4F5F              subi R20,255  ; offset = 1
 000A 5F4F              sbci R21,255
 000C           L5:
 000C                   .dbline 107
 000C           ;       unsigned int i;
 000C           ;       for(i=0; i<s; i++);
 000C 4017              cp R20,R16
 000E 5107              cpc R21,R17
 0010 D8F3              brlo L2
 0012                   .dbline 108
 0012 4427              clr R20
 0014 5527              clr R21
 0016 02C0              rjmp L9
 0018           L6:
 0018                   .dbline 108
 0018           L7:
 0018                   .dbline 108
 0018 4F5F              subi R20,255  ; offset = 1
 001A 5F4F              sbci R21,255
 001C           L9:
 001C                   .dbline 108
 001C           ;       for(i=0; i<s; i++);
 001C 4017              cp R20,R16
 001E 5107              cpc R21,R17
 0020 D8F3              brlo L6
 0022                   .dbline -2
 0022           L1:
 0022 00D0              rcall pop_gset1
 0024                   .dbline 0 ; func end
 0024 0895              ret
 0026                   .dbsym r i 20 i
 0026                   .dbsym r s 16 i
 0026                   .dbend
 0026                   .dbfunc e halWait _halWait fV
 0026           ;        timeout -> R16,R17
                        .even
 0026           _halWait::
 0026                   .dbline -1
 0026                   .dbline 112
 0026           ; }
 0026           ; 
 0026           ; 
 0026           ; void halWait(INT16U timeout) {
 0026           L11:
 0026                   .dbline 113
 0026           ;     do {
 0026                   .dbline 114
 0026           ;         _nop_();
 0026 0000              nop
 0028                   .dbline 115
 0028           ;               _nop_();
 0028 0000              nop
 002A                   .dbline 116
 002A           ;               _nop_();
 002A 0000              nop
 002C                   .dbline 117
 002C           ;               _nop_();
 002C 0000              nop
 002E                   .dbline 118
 002E           ;               _nop_();
 002E 0000              nop
 0030                   .dbline 119
 0030           ;               _nop_();
 0030 0000              nop
 0032                   .dbline 120
 0032           ;               _nop_();
 0032 0000              nop
 0034                   .dbline 121
 0034           ;               _nop_();
 0034 0000              nop
 0036                   .dbline 122
 0036           ;               _nop_();
 0036 0000              nop
 0038                   .dbline 123
 0038           ;               _nop_();
 0038 0000              nop
 003A                   .dbline 124
 003A           ;               _nop_();
 003A 0000              nop
 003C                   .dbline 125
 003C           ;               _nop_();
 003C 0000              nop
 003E                   .dbline 126
 003E           ;               _nop_();
 003E 0000              nop
 0040                   .dbline 127
 0040           ;               _nop_();
 0040 0000              nop
 0042                   .dbline 128
 0042           ;               _nop_(); 
 0042 0000              nop
 0044                   .dbline 129
 0044           L12:
 0044                   .dbline 129
 0044           ;     } while (--timeout);
 0044 C801              movw R24,R16
 0046 0197              sbiw R24,1
 0048 8C01              movw R16,R24
 004A 0030              cpi R16,0
 004C 0107              cpc R16,R17
 004E 59F7              brne L11
 0050           X0:
 0050                   .dbline -2
 0050           L10:
 0050                   .dbline 0 ; func end
 0050 0895              ret
 0052                   .dbsym r timeout 16 i
 0052                   .dbend
 0052                   .dbfunc e UartInit _UartInit fV
                        .even
 0052           _UartInit::
 0052                   .dbline -1
 0052                   .dbline 139
 0052           ; }
 0052           ; 
 0052           ; /*****************************************************************************************
 0052           ; //函数名:UartInit()
 0052           ; //输入:无
 0052           ; //输出:无
 0052           ; //功能描述:串口初始化程序
 0052           ; /*****************************************************************************************/
 0052           ; void UartInit(void)           //用232串口发数据到PC,收集数据
 0052           ;   {
 0052                   .dbline 140
 0052           ;     UCSRB=(1<<RXEN)|(1<<TXEN);//允许发送和接收
 0052 88E1              ldi R24,24
 0054 8AB9              out 0xa,R24
 0056                   .dbline 141
 0056           ;     UBRRL= (F_osc/9600/16-1)%256;
 0056 8FE2              ldi R24,47
 0058 89B9              out 0x9,R24
 005A                   .dbline 142
 005A           ;     UBRRH= (F_osc/9600/16-1)/256;
 005A 2224              clr R2
 005C 20BC              out 0x20,R2
 005E                   .dbline 143
 005E           ;     UCSRC=(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0);//8位数据+1位STOP位
 005E 86E8              ldi R24,134
 0060 80BD              out 0x20,R24
 0062                   .dbline -2
 0062           L14:
 0062                   .dbline 0 ; func end
 0062 0895              ret
 0064                   .dbend
 0064                   .dbfunc e SpiInit _SpiInit fV
                        .even
 0064           _SpiInit::
 0064                   .dbline -1
 0064                   .dbline 148
 0064           ;   }
 0064           ; 
 0064           ; 
 0064           ; void SpiInit(void)
 0064           ; {
 0064                   .dbline 149
 0064           ;  DDRB|=(1<<SPI_DO);
 0064 BB9A              sbi 0x17,3
 0066                   .dbline 150
 0066           ;  DDRB|=(1<<SPI_Clock);
 0066 BD9A              sbi 0x17,5
 0068                   .dbline 151
 0068           ;  DDRB|=(1<<Chip_Select);
 0068 BA9A              sbi 0x17,2
 006A                   .dbline 153
 006A           ;  
 006A           ;  PORTB|=(1<<SPI_DI);
 006A C49A              sbi 0x18,4
 006C                   .dbline 156
 006C           ;  
 006C           ;  
 006C           ;       CSN_0;
 006C C298              cbi 0x18,2

⌨️ 快捷键说明

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