rf_rx.elf: file format elf32-msp430 SYMBOL TABLE: 0000e000 l d .text 00000000 .text 00000200 l d .data 00000000 .data 00000202 l d .bss 00000000 .bss 0000ffe0 l d .vectors 00000000 .vectors 00000000 l d .stab 00000000 .stab 00000000 l d .stabstr 00000000 .stabstr 00000070 l *ABS* 00000000 U0CTL 00000071 l *ABS* 00000000 U0TCTL 00000072 l *ABS* 00000000 U0RCTL 00000073 l *ABS* 00000000 U0MCTL 00000074 l *ABS* 00000000 U0BR0 00000075 l *ABS* 00000000 U0BR1 00000076 l *ABS* 00000000 U0RXBUF 00000077 l *ABS* 00000000 U0TXBUF 00000070 l *ABS* 00000000 UCTL 00000071 l *ABS* 00000000 UTCTL 00000072 l *ABS* 00000000 URCTL 00000073 l *ABS* 00000000 UMCTL 00000074 l *ABS* 00000000 UBR0 00000075 l *ABS* 00000000 UBR1 00000076 l *ABS* 00000000 RXBUF 00000077 l *ABS* 00000000 TXBUF 00000070 l *ABS* 00000000 UCTL0 00000071 l *ABS* 00000000 UTCTL0 00000072 l *ABS* 00000000 URCTL0 00000073 l *ABS* 00000000 UMCTL0 00000074 l *ABS* 00000000 UBR00 00000075 l *ABS* 00000000 UBR10 00000076 l *ABS* 00000000 RXBUF0 00000077 l *ABS* 00000000 TXBUF0 00000070 l *ABS* 00000000 UCTL_0 00000071 l *ABS* 00000000 UTCTL_0 00000072 l *ABS* 00000000 URCTL_0 00000073 l *ABS* 00000000 UMCTL_0 00000074 l *ABS* 00000000 UBR0_0 00000075 l *ABS* 00000000 UBR1_0 00000076 l *ABS* 00000000 RXBUF_0 00000077 l *ABS* 00000000 TXBUF_0 00000020 l *ABS* 00000000 P1IN 00000021 l *ABS* 00000000 P1OUT 00000022 l *ABS* 00000000 P1DIR 00000023 l *ABS* 00000000 P1IFG 00000024 l *ABS* 00000000 P1IES 00000025 l *ABS* 00000000 P1IE 00000026 l *ABS* 00000000 P1SEL 00000028 l *ABS* 00000000 P2IN 00000029 l *ABS* 00000000 P2OUT 0000002a l *ABS* 00000000 P2DIR 0000002b l *ABS* 00000000 P2IFG 0000002c l *ABS* 00000000 P2IES 0000002d l *ABS* 00000000 P2IE 0000002e l *ABS* 00000000 P2SEL 00000018 l *ABS* 00000000 P3IN 00000019 l *ABS* 00000000 P3OUT 0000001a l *ABS* 00000000 P3DIR 0000001b l *ABS* 00000000 P3SEL 0000012e l *ABS* 00000000 TA0IV 00000160 l *ABS* 00000000 TA0CTL 00000170 l *ABS* 00000000 TA0R 00000162 l *ABS* 00000000 TA0CCTL0 00000164 l *ABS* 00000000 TA0CCTL1 00000172 l *ABS* 00000000 TA0CCR0 00000174 l *ABS* 00000000 TA0CCR1 00000166 l *ABS* 00000000 TA0CCTL2 00000176 l *ABS* 00000000 TA0CCR2 00000056 l *ABS* 00000000 DCOCTL 00000057 l *ABS* 00000000 BCSCTL1 00000058 l *ABS* 00000000 BCSCTL2 00000128 l *ABS* 00000000 FCTL1 0000012a l *ABS* 00000000 FCTL2 0000012c l *ABS* 00000000 FCTL3 00000048 l *ABS* 00000000 ADC10DTC0 00000049 l *ABS* 00000000 ADC10DTC1 0000004a l *ABS* 00000000 ADC10AE0 000001b0 l *ABS* 00000000 ADC10CTL0 000001b2 l *ABS* 00000000 ADC10CTL1 000001b4 l *ABS* 00000000 ADC10MEM 000001bc l *ABS* 00000000 ADC10SA 00000120 l *ABS* 00000000 WDTCTL 00000000 l *ABS* 00000000 IE1 00000002 l *ABS* 00000000 IFG1 00000001 l *ABS* 00000000 IE2 00000003 l *ABS* 00000000 IFG2 00000005 l *ABS* 00000000 ME2 00000000 l df *ABS* 00000000 main.c 00000200 l O .data 00000001 make_gdb_happy 0000e744 l .text 00000000 Letext 00000000 l df *ABS* 00000000 cc1100.c 0000ed38 l .text 00000000 Letext 00000000 l df *ABS* 00000000 memcmp.c 0000ed68 l .text 00000000 Letext 00000002 g *ABS* 00000000 __data_size 0000e8da g F .text 00000196 CC1100_WRITE_RF_SETTINGS_1_2K 0000e2aa g F .text 00000030 init_UART_SPI 0000ed6a g .text 00000000 _etext 0000ec60 g F .text 00000048 CC1100_SPI_WRREG 00000005 g *ABS* 00000000 __bss_size 0000ed68 w .text 00000000 __stop_progExec__ 0000e030 g .text 00000000 _unexpected_1_ 0000e030 w .text 00000000 vector_ffe0 0000e064 g F .text 0000004c sys_init 0000e30e g F .text 0000000e tx_232_char 0000e030 w .text 00000000 vector_ffec 0000e030 w .text 00000000 vector_fff0 0000ed6a g *ABS* 00000000 __data_load_start 0000e030 g .text 00000000 __dtors_end 0000e31c g F .text 0000003c tx_232_str 0000e030 w .text 00000000 vector_fffc 0000e030 w .text 00000000 vector_ffe4 00000202 g O .bss 00000001 RSSI_DBM 0000ffe0 g O .vectors 00000020 InterruptVectors 00000203 g O .bss 00000001 RSSI 0000e01c w .text 00000000 __do_clear_bss 0000e2da g F .text 00000034 init_UART_232 0000e030 w .text 00000000 vector_ffe2 0000e030 w .text 00000000 vector_ffe8 0000e034 w .text 00000000 _unexpected_ 0000ea70 g F .text 00000194 CC1100_WRITE_RF_SETTINGS_500K 0000e030 w .text 00000000 vector_fffa 0000ed38 g F .text 00000030 memcmp 0000ecde g F .text 0000005a CC1100_SPI_BURST_WRREG 0000e000 w .text 00000000 _reset_vector__ 0000e030 g .text 00000000 __ctors_start 0000ec04 g F .text 0000005c CC1100_SPI_RDREG 0000e00a w .text 00000000 __do_copy_data 00000202 g .bss 00000000 __bss_start 0000e030 w .text 00000000 vector_ffee 0000e030 w .text 00000000 vector_fff4 0000e3ec g F .text 00000358 main 0000e030 w .text 00000000 vector_fff8 0000e030 w .text 00000000 vector_fff2 00010000 g .vectors 00000000 _vectors_end 0000e030 w .text 00000000 vector_ffe6 0000e036 g F .text 0000002e delay 0000e20a g F .text 000000a0 TX_STRING 00000204 g O .bss 00000001 LQI 0000e0b0 g F .text 0000015a RX_STRING 0000e744 g F .text 00000196 CC1100_WRITE_RF_SETTINGS 0000e000 w .text 00000000 __init_stack 00000205 g O .bss 00000001 PKTSTATUS 0000e030 g .text 00000000 __dtors_start 0000e030 g .text 00000000 __ctors_end 00000300 g *ABS* 00000000 __stack 00000202 g .data 00000000 _edata 00000207 g .bss 00000000 _end 0000e030 w .text 00000000 vector_fff6 0000e004 w .text 00000000 __low_level_init 0000e02c w .text 00000000 __jump_to_main 00000200 g .data 00000000 __data_start 0000e030 w .text 00000000 vector_ffea 00000206 g O .bss 00000001 status 0000eca8 g F .text 00000036 CC1100_SPI_STROBE Disassembly of section .text: 0000e000 <__init_stack>: e000: 31 40 00 03 mov #768, r1 ;#0x0300 0000e004 <__low_level_init>: e004: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80 e008: 20 01 0000e00a <__do_copy_data>: e00a: 3f 40 02 00 mov #2, r15 ;#0x0002 e00e: 0f 93 tst r15 e010: 05 24 jz $+12 ;abs 0xe01c e012: 2f 83 decd r15 e014: 9f 4f 6a ed mov -4758(r15),512(r15);0xed6a(r15), 0x0200(r15) e018: 00 02 e01a: fb 23 jnz $-8 ;abs 0xe012 0000e01c <__do_clear_bss>: e01c: 3f 40 05 00 mov #5, r15 ;#0x0005 e020: 0f 93 tst r15 e022: 04 24 jz $+10 ;abs 0xe02c e024: 1f 83 dec r15 e026: cf 43 02 02 mov.b #0, 514(r15);r3 As==00, 0x0202(r15) e02a: fc 23 jnz $-6 ;abs 0xe024 0000e02c <__jump_to_main>: e02c: 30 40 ec e3 br #0xe3ec 0000e030 <__ctors_end>: e030: 30 40 34 e0 br #0xe034 0000e034 <_unexpected_>: e034: 00 13 reti 0000e036 : Delay function. */ void delay(unsigned int d) { int i; for (i = 0; i: Set up the system */ void sys_init() { WDTCTL = WDTCTL_INIT; //Init watchdog timer e064: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80 e068: 20 01 P1OUT = P1OUT_INIT; //Init output data of port1 e06a: c2 43 21 00 mov.b #0, &0x0021 ;r3 As==00 P2OUT = P2OUT_INIT; //Init output data of port2 e06e: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 P3OUT = P3OUT_INIT; e072: d2 43 19 00 mov.b #1, &0x0019 ;r3 As==01 P1SEL = P1SEL_INIT; //Select port or module -function on port1 e076: c2 43 26 00 mov.b #0, &0x0026 ;r3 As==00 P2SEL = P2SEL_INIT; //Select port or module -function on port2 e07a: c2 43 2e 00 mov.b #0, &0x002e ;r3 As==00 P3SEL = P3SEL_INIT; e07e: c2 43 1b 00 mov.b #0, &0x001b ;r3 As==00 P1DIR = P1DIR_INIT; //Init port direction register of port1 e082: f2 40 0c 00 mov.b #12, &0x0022 ;#0x000c e086: 22 00 P2DIR = P2DIR_INIT; //Init port direction register of port2 e088: f2 43 2a 00 mov.b #-1, &0x002a ;r3 As==11 P3DIR = P3DIR_INIT; e08c: f2 40 3b 00 mov.b #59, &0x001a ;#0x003b e090: 1a 00 P1IES = P1IES_INIT; //init port interrupts e092: c2 43 24 00 mov.b #0, &0x0024 ;r3 As==00 P2IES = P2IES_INIT; e096: c2 43 2c 00 mov.b #0, &0x002c ;r3 As==00 P1IE = P1IE_INIT; e09a: c2 43 25 00 mov.b #0, &0x0025 ;r3 As==00 P2IE = P2IE_INIT; e09e: c2 43 2d 00 mov.b #0, &0x002d ;r3 As==00 BCSCTL1 |= RSEL0 | RSEL1 | RSEL2; e0a2: f2 d0 07 00 bis.b #7, &0x0057 ;#0x0007 e0a6: 57 00 DCOCTL |= DCO0 | DCO1 | DCO2; e0a8: f2 d0 e0 ff bis.b #-32, &0x0056 ;#0xffe0 e0ac: 56 00 //delay(0xffff); } e0ae: 30 41 ret 0000e0b0 : /** Get some bytes */ char RX_STRING(char *rxbuf, char length, unsigned long timeout) { e0b0: 0b 12 push r11 e0b2: 0a 12 push r10 e0b4: 09 12 push r9 e0b6: 08 12 push r8 e0b8: 07 12 push r7 e0ba: 06 12 push r6 e0bc: 05 12 push r5 e0be: 07 4f mov r15, r7 e0c0: 46 4e mov.b r14, r6 e0c2: 08 4c mov r12, r8 e0c4: 09 4d mov r13, r9 unsigned long time=0; e0c6: 0a 43 clr r10 e0c8: 0b 43 clr r11 unsigned char state,i, real_length=23, pkt_length; RSSI = 0; e0ca: c2 43 03 02 mov.b #0, &0x0203 ;r3 As==00 LQI = 0; e0ce: c2 43 04 02 mov.b #0, &0x0204 ;r3 As==00 CC1100_SPI_STROBE(CC1100_SRX);//Recieve e0d2: 7f 40 34 00 mov.b #52, r15 ;#0x0034 e0d6: b0 12 a8 ec call #0xeca8 while ((P3IN&GDO0) == 0) // Wait for GDO0 to be set -> sync transmitted e0da: f2 b0 40 00 bit.b #64, &0x0018 ;#0x0040 e0de: 18 00 e0e0: 0f 20 jnz $+32 ;abs 0xe100 { //i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE if((time >= timeout) && timeout != 0) e0e2: 0e 4a mov r10, r14 e0e4: 0f 4b mov r11, r15 e0e6: 0e 88 sub r8, r14 e0e8: 0f 79 subc r9, r15 e0ea: 04 28 jnc $+10 ;abs 0xe0f4 e0ec: 08 93 tst r8 e0ee: 7c 20 jnz $+250 ;abs 0xe1e8 e0f0: 09 93 tst r9 e0f2: 7a 20 jnz $+246 ;abs 0xe1e8 CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer return false; //timeout! } time++; e0f4: 1a 53 inc r10 e0f6: 0b 63 adc r11 e0f8: f2 b0 40 00 bit.b #64, &0x0018 ;#0x0040 e0fc: 18 00 e0fe: f1 27 jz $-28 ;abs 0xe0e2 } time=0; e100: 0a 43 clr r10 e102: 0b 43 clr r11 while ((P3IN&GDO0) == GDO0) // Wait for GDO0 to be cleared -> end of packet e104: f2 b0 40 00 bit.b #64, &0x0018 ;#0x0040 e108: 18 00 e10a: 0f 24 jz $+32 ;abs 0xe12a { //i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE if((time >= timeout) && timeout != 0) e10c: 0e 4a mov r10, r14 e10e: 0f 4b mov r11, r15 e110: 0e 88 sub r8, r14 e112: 0f 79 subc r9, r15 e114: 04 28 jnc $+10 ;abs 0xe11e e116: 08 93 tst r8 e118: 67 20 jnz $+208 ;abs 0xe1e8 e11a: 09 93 tst r9 e11c: 65 20 jnz $+204 ;abs 0xe1e8 CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer return false; //timeout! } time++; e11e: 1a 53 inc r10 e120: 0b 63 adc r11 e122: f2 b0 40 00 bit.b #64, &0x0018 ;#0x0040 e126: 18 00 e128: f1 23 jnz $-28 ;abs 0xe10c } //pkt_length = CCXX_SPI_RDREG(CC1100_RXFIFO);//length of the buffer pkt_length = CC1100_SPI_RDREG(CC1100_PKTLEN);//We are using fixed length, so use the pktlen register e12a: 7f 40 06 00 mov.b #6, r15 ;#0x0006 e12e: b0 12 04 ec call #0xec04 e132: 49 4f mov.b r15, r9 real_length = CC1100_SPI_RDREG(CC1100_RXBYTES);//length of the packet e134: 7f 40 3b 00 mov.b #59, r15 ;#0x003b e138: b0 12 04 ec call #0xec04 e13c: 45 4f mov.b r15, r5 for(i=0; i < length && i < pkt_length; i++) e13e: 48 43 clr.b r8 e140: 4a 46 mov.b r6, r10 e142: 8a 11 sxt r10 e144: 0b 43 clr r11 e146: 1a 93 cmp #1, r10 ;r3 As==01 e148: 11 38 jl $+36 ;abs 0xe16c e14a: 59 93 cmp.b #1, r9 ;r3 As==01 e14c: 4b 28 jnc $+152 ;abs 0xe1e4 { rxbuf[i] = CC1100_SPI_RDREG(CC1100_RXFIFO);//get the byte e14e: 7f 40 bf ff mov.b #-65, r15 ;#0xffbf e152: b0 12 04 ec call #0xec04 e156: 4e 4f mov.b r15, r14 e158: 0f 47 mov r7, r15 e15a: 0f 5b add r11, r15 e15c: cf 4e 00 00 mov.b r14, 0(r15) ;0x0000(r15) } //pkt_length = CCXX_SPI_RDREG(CC1100_RXFIFO);//length of the buffer pkt_length = CC1100_SPI_RDREG(CC1100_PKTLEN);//We are using fixed length, so use the pktlen register real_length = CC1100_SPI_RDREG(CC1100_RXBYTES);//length of the packet for(i=0; i < length && i < pkt_length; i++) e160: 58 53 inc.b r8 e162: 4b 48 mov.b r8, r11 e164: 0b 9a cmp r10, r11 e166: 02 34 jge $+6 ;abs 0xe16c e168: 48 99 cmp.b r9, r8 e16a: f1 2b jnc $-28 ;abs 0xe14e { rxbuf[i] = CC1100_SPI_RDREG(CC1100_RXFIFO);//get the byte } rxbuf[i] = '\0';//set the NULL terminator e16c: 07 5b add r11, r7 e16e: c7 43 00 00 mov.b #0, 0(r7) ;r3 As==00, 0x0000(r7) RSSI = CC1100_SPI_RDREG(CC1100_RXFIFO);//get the ESSI e172: 7f 40 bf ff mov.b #-65, r15 ;#0xffbf e176: b0 12 04 ec call #0xec04 e17a: c2 4f 03 02 mov.b r15, &0x0203 LQI = CC1100_SPI_RDREG(CC1100_RXFIFO);//get the CRC e17e: 7f 40 bf ff mov.b #-65, r15 ;#0xffbf e182: b0 12 04 ec call #0xec04 e186: c2 4f 04 02 mov.b r15, &0x0204 PKTSTATUS = CC1100_SPI_RDREG(CC1100_PKTSTATUS); e18a: 7f 40 38 00 mov.b #56, r15 ;#0x0038 e18e: b0 12 04 ec call #0xec04 e192: c2 4f 05 02 mov.b r15, &0x0205 if(real_length != (pkt_length + 2)) //packets lengths dont match, LQI mis-reported e196: 4e 45 mov.b r5, r14 e198: 4f 49 mov.b r9, r15 e19a: 2f 53 incd r15 e19c: 0e 9f cmp r15, r14 e19e: 03 24 jz $+8 ;abs 0xe1a6 LQI &= ~bit7; //force it to be INVALID! e1a0: f2 f0 7f 00 and.b #127, &0x0204 ;#0x007f e1a4: 04 02 if (RSSI >= 128) e1a6: 5f 42 03 02 mov.b &0x0203,r15 e1aa: 7f 90 80 00 cmp.b #128, r15 ;#0x0080 e1ae: 17 28 jnc $+48 ;abs 0xe1de RSSI_DBM = (int)((int )(RSSI - 256) / 2) - 74; e1b0: 4e 4f mov.b r15, r14 e1b2: 0f 4e mov r14, r15 e1b4: 3f 50 00 ff add #-256, r15 ;#0xff00 e1b8: 10 30 jn $+34 ;abs 0xe1da e1ba: 0f 11 rra r15 e1bc: 7f 50 b6 ff add.b #-74, r15 ;#0xffb6 e1c0: c2 4f 02 02 mov.b r15, &0x0202 else RSSI_DBM = (RSSI / 2) - 74; CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer e1c4: 7f 40 3a 00 mov.b #58, r15 ;#0x003a e1c8: b0 12 a8 ec call #0xeca8 CC1100_SPI_STROBE(CC1100_SIDLE); //return to IDLE state e1cc: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e1d0: b0 12 a8 ec call #0xeca8 return i; //i = real length e1d4: 4f 48 mov.b r8, r15 e1d6: 8f 11 sxt r15 e1d8: 10 3c jmp $+34 ;abs 0xe1fa e1da: 1f 53 inc r15 e1dc: ee 3f jmp $-34 ;abs 0xe1ba LQI &= ~bit7; //force it to be INVALID! if (RSSI >= 128) RSSI_DBM = (int)((int )(RSSI - 256) / 2) - 74; else RSSI_DBM = (RSSI / 2) - 74; e1de: 12 c3 clrc e1e0: 4f 10 rrc.b r15 e1e2: ec 3f jmp $-38 ;abs 0xe1bc e1e4: 0b 43 clr r11 e1e6: c2 3f jmp $-122 ;abs 0xe16c { //i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE if((time >= timeout) && timeout != 0) { CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer e1e8: 7f 40 3a 00 mov.b #58, r15 ;#0x003a e1ec: b0 12 a8 ec call #0xeca8 CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer e1f0: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e1f4: b0 12 a8 ec call #0xeca8 return false; //timeout! e1f8: 0f 43 clr r15 CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer CC1100_SPI_STROBE(CC1100_SIDLE); //return to IDLE state return i; //i = real length } e1fa: 35 41 pop r5 e1fc: 36 41 pop r6 e1fe: 37 41 pop r7 e200: 38 41 pop r8 e202: 39 41 pop r9 e204: 3a 41 pop r10 e206: 3b 41 pop r11 e208: 30 41 ret 0000e20a : /** Transmit a string of bytes. */ void TX_STRING(unsigned char *txstring, unsigned char length) { e20a: 0b 12 push r11 e20c: 0a 12 push r10 e20e: 09 12 push r9 e210: 09 4f mov r15, r9 e212: 4b 4e mov.b r14, r11 unsigned char i,pktlen = CC1100_SPI_RDREG(CC1100_PKTLEN); e214: 7f 40 06 00 mov.b #6, r15 ;#0x0006 e218: b0 12 04 ec call #0xec04 e21c: 4a 4f mov.b r15, r10 do{ CC1100_SPI_STROBE(CC1100_SIDLE);//Idle e21e: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e222: b0 12 a8 ec call #0xeca8 CC1100_SPI_STROBE(CC1100_SNOP) ; //wait for Idle e226: 7f 40 3d 00 mov.b #61, r15 ;#0x003d e22a: b0 12 a8 ec call #0xeca8 }while((status & CC1100_STAT_ADDR) != CC1100_STAT_IDLE); //wait for idle e22e: f2 b0 70 00 bit.b #112, &0x0206 ;#0x0070 e232: 06 02 e234: f4 23 jnz $-22 ;abs 0xe21e for(i=0; i<=length; i++) { if(i < length) CC1100_SPI_WRREG(CC1100_TXFIFO, txstring[i]);//Write data to FIFO }*/ if(length > pktlen) //text string is too long for fixed packet length mode e236: 4a 9b cmp.b r11, r10 e238: 01 2c jc $+4 ;abs 0xe23c length = pktlen; e23a: 4b 4a mov.b r10, r11 if (length == pktlen) e23c: 4b 9a cmp.b r10, r11 e23e: 2a 24 jz $+86 ;abs 0xe294 CC1100_SPI_BURST_WRREG(CC1100_TXFIFO_BURST, txstring, length); else if (length < pktlen) e240: 4b 9a cmp.b r10, r11 e242: 11 28 jnc $+36 ;abs 0xe266 { CC1100_SPI_WRREG(CC1100_TXFIFO, '\0');//then fill rest will null characters } } CC1100_SPI_STROBE(CC1100_STX); // send tx strobe and TX begins, returns to 15 or 31 when complete (depending on MCSM1) e244: 7f 40 35 00 mov.b #53, r15 ;#0x0035 e248: b0 12 a8 ec call #0xeca8 do { CC1100_SPI_STROBE(CC1100_SNOP) ; //(wait for 15, idle)read status byte.... e24c: 7f 40 3d 00 mov.b #61, r15 ;#0x003d e250: b0 12 a8 ec call #0xeca8 if(status == 31) //fast RX mode yay e254: 5f 42 06 02 mov.b &0x0206,r15 e258: 7f 90 1f 00 cmp.b #31, r15 ;#0x001f e25c: 22 24 jz $+70 ;abs 0xe2a2 break; }while((status & CC1100_STAT_ADDR) != CC1100_STAT_IDLE); //(15)31 for return to TX on complete, see MCSM1 e25e: 7f f0 70 00 and.b #112, r15 ;#0x0070 e262: f4 23 jnz $-22 ;abs 0xe24c e264: 1e 3c jmp $+62 ;abs 0xe2a2 { /*for(i=0; i pktlen) //text string is too long for fixed packet length mode length = pktlen; if (length == pktlen) CC1100_SPI_BURST_WRREG(CC1100_TXFIFO_BURST, txstring, length); e294: 4d 4b mov.b r11, r13 e296: 0e 49 mov r9, r14 e298: 7f 40 7f 00 mov.b #127, r15 ;#0x007f e29c: b0 12 de ec call #0xecde e2a0: d1 3f jmp $-92 ;abs 0xe244 { CC1100_SPI_STROBE(CC1100_SNOP) ; //(wait for 15, idle)read status byte.... if(status == 31) //fast RX mode yay break; }while((status & CC1100_STAT_ADDR) != CC1100_STAT_IDLE); //(15)31 for return to TX on complete, see MCSM1 } e2a2: 39 41 pop r9 e2a4: 3a 41 pop r10 e2a6: 3b 41 pop r11 e2a8: 30 41 ret 0000e2aa : void init_UART_SPI() { P3SEL &= ~UART0_232_MODULES; //this will bring the clock edge high e2aa: f2 f0 ef ff and.b #-17, &0x001b ;#0xffef e2ae: 1b 00 U0CTL |= SWRST; // disable the state machine e2b0: d2 d3 70 00 bis.b #1, &0x0070 ;r3 As==01 ME2 &= ~UTXE0; //disable UART e2b4: e2 c3 05 00 bic.b #2, &0x0005 ;r3 As==10 ME2 |= USPIE0; //enable SPI e2b8: d2 d3 05 00 bis.b #1, &0x0005 ;r3 As==01 U0CTL = CHAR | SYNC | MM | SWRST; e2bc: f2 40 17 00 mov.b #23, &0x0070 ;#0x0017 e2c0: 70 00 U0TCTL = CKPH | STC | SSEL_3; e2c2: f2 40 b2 ff mov.b #-78, &0x0071 ;#0xffb2 e2c6: 71 00 U0BR0 = 2; //divide by 5 = 1Mhz e2c8: e2 43 74 00 mov.b #2, &0x0074 ;r3 As==10 U0BR1 = 0; e2cc: c2 43 75 00 mov.b #0, &0x0075 ;r3 As==00 U0MCTL = 0; e2d0: c2 43 73 00 mov.b #0, &0x0073 ;r3 As==00 U0CTL &= ~SWRST; // Initialize USART state machine e2d4: d2 c3 70 00 bic.b #1, &0x0070 ;r3 As==01 } e2d8: 30 41 ret 0000e2da : void init_UART_232() { P3SEL |= UART0_232_MODULES; //this will bring the clock edge high e2da: f2 d0 10 00 bis.b #16, &0x001b ;#0x0010 e2de: 1b 00 U0CTL |= SWRST; // disable the state machine e2e0: d2 d3 70 00 bis.b #1, &0x0070 ;r3 As==01 ME2 &= ~USPIE0; //disable SPI e2e4: d2 c3 05 00 bic.b #1, &0x0005 ;r3 As==01 ME2 |= UTXE0; //enable UART e2e8: e2 d3 05 00 bis.b #2, &0x0005 ;r3 As==10 U0CTL = CHAR | SWRST; e2ec: f2 40 11 00 mov.b #17, &0x0070 ;#0x0011 e2f0: 70 00 U0TCTL = SSEL_3; e2f2: f2 40 30 00 mov.b #48, &0x0071 ;#0x0030 e2f6: 71 00 U0BR0 = 0x71; //divide by 1905 = 2400 baud //lower byte e2f8: f2 40 71 00 mov.b #113, &0x0074 ;#0x0071 e2fc: 74 00 U0BR1 = 0x07;//00001110; //upper byte e2fe: f2 40 07 00 mov.b #7, &0x0075 ;#0x0007 e302: 75 00 U0MCTL = 0; e304: c2 43 73 00 mov.b #0, &0x0073 ;r3 As==00 U0CTL &= ~SWRST; // Initialize USART state machine e308: d2 c3 70 00 bic.b #1, &0x0070 ;r3 As==01 } e30c: 30 41 ret 0000e30e : void tx_232_char(char c) { e30e: 4e 4f mov.b r15, r14 //U0TXBUF = c; //IFG2 &= ~UTXIFG0; while ((IFG2 & UTXIFG0) == 0); // USART0 TX buffer ready? e310: e2 b3 03 00 bit.b #2, &0x0003 ;r3 As==10 e314: fd 27 jz $-4 ;abs 0xe310 U0TXBUF = c; e316: c2 4e 77 00 mov.b r14, &0x0077 } e31a: 30 41 ret 0000e31c : void tx_232_str(char *str) { e31c: 0b 12 push r11 e31e: 0a 12 push r10 e320: 09 12 push r9 e322: 0a 4f mov r15, r10 char i; int length=strlen(str); e324: 09 4f mov r15, r9 e326: 19 83 dec r9 e328: 19 53 inc r9 e32a: c9 93 00 00 tst.b 0(r9) ;0x0000(r9) e32e: fc 23 jnz $-6 ;abs 0xe328 e330: 09 8f sub r15, r9 for(i=0; i: /** Main function. Takes a photo when you push the buttom! */ int main(void) { e3ec: 31 40 e8 02 mov #744, r1 ;#0x02e8 char rxbuf[23]; //char buffer[20]; //char RSSIBUF[5]; sys_init(); e3f0: b0 12 64 e0 call #0xe064 init_UART_SPI(); e3f4: b0 12 aa e2 call #0xe2aa memset(rxbuf, 0, 23); e3f8: 3e 40 17 00 mov #23, r14 ;#0x0017 e3fc: 0f 41 mov r1, r15 e3fe: cf 43 00 00 mov.b #0, 0(r15) ;r3 As==00, 0x0000(r15) e402: 1f 53 inc r15 e404: 1e 83 dec r14 e406: fb 23 jnz $-8 ;abs 0xe3fe //P3SEL = UART0_SPI_MODULES; while (1) //main loop, never ends... { P3OUT &= ~CSn; //power on reset, strobe CSn e408: d2 c3 19 00 bic.b #1, &0x0019 ;r3 As==01 delay(0x00FF); e40c: 3f 40 ff 00 mov #255, r15 ;#0x00ff e410: b0 12 36 e0 call #0xe036 P3OUT |= CSn; e414: d2 d3 19 00 bis.b #1, &0x0019 ;r3 As==01 delay(0xFFFF); e418: 3f 43 mov #-1, r15 ;r3 As==11 e41a: b0 12 36 e0 call #0xe036 //values straight from RF_STUDIO CC1100_SPI_STROBE(CC1100_SRES); //reset chip e41e: 7f 40 30 00 mov.b #48, r15 ;#0x0030 e422: b0 12 a8 ec call #0xeca8 CC1100_WRITE_RF_SETTINGS(); e426: b0 12 44 e7 call #0xe744 //CC1100_WRITE_RF_SETTINGS_500K(); //CC1100_WRITE_RF_SETTINGS_1_2K(); CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer, all bytes sent e42a: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e42e: b0 12 a8 ec call #0xeca8 { i = CC1100_SPI_RDREG(CC1100_VERSION);//wait for IDLE }*/ do{ i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE e432: 7f 40 35 00 mov.b #53, r15 ;#0x0035 e436: b0 12 04 ec call #0xec04 }while(i != 1); e43a: 5f 93 cmp.b #1, r15 ;r3 As==01 e43c: fa 23 jnz $-10 ;abs 0xe432 delay(0xF); //lil bit O delay e43e: 3f 40 0f 00 mov #15, r15 ;#0x000f e442: b0 12 36 e0 call #0xe036 while(1) { TX_STRING("Can you hear me now?\0",20,&status); //delay(0xFFF); }*/ memset(rxbuf, 0, 23); e446: 3e 40 17 00 mov #23, r14 ;#0x0017 e44a: 0f 41 mov r1, r15 e44c: cf 43 00 00 mov.b #0, 0(r15) ;r3 As==00, 0x0000(r15) e450: 1f 53 inc r15 e452: 1e 83 dec r14 e454: fb 23 jnz $-8 ;abs 0xe44c while(!RX_STRING(rxbuf, 20, 0xFFFFF)); e456: 3c 43 mov #-1, r12 ;r3 As==11 e458: 3d 40 0f 00 mov #15, r13 ;#0x000f e45c: 7e 40 14 00 mov.b #20, r14 ;#0x0014 e460: 0f 41 mov r1, r15 e462: b0 12 b0 e0 call #0xe0b0 e466: 4f 93 tst.b r15 e468: f6 27 jz $-18 ;abs 0xe456 tx_232_str(RSSIBUF); tx_232_str("dBm\r"); init_UART_SPI();*/ //P2OUT = status & 0x0F; if(memcmp("Go!",rxbuf,3)==0) e46a: 3d 40 03 00 mov #3, r13 ;#0x0003 e46e: 0e 41 mov r1, r14 e470: 3f 40 58 e3 mov #-7336, r15 ;#0xe358 e474: b0 12 38 ed call #0xed38 e478: 0f 93 tst r15 e47a: 4c 25 jz $+666 ;abs 0xe714 //delay(0xFFFF); //lil bit O delay //delay(0xFFFF); //lil bit O delay P1OUT &= ~SHUTTER; P2OUT = 0x00; } else if(memcmp("Ping!",rxbuf,5)==0) e47c: 3d 40 05 00 mov #5, r13 ;#0x0005 e480: 0e 41 mov r1, r14 e482: 3f 40 5c e3 mov #-7332, r15 ;#0xe35c e486: b0 12 38 ed call #0xed38 e48a: 0f 93 tst r15 e48c: 36 25 jz $+622 ;abs 0xe6fa delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); delay(0xFFFF); //lil bit O delay P2OUT = 0x00; } else if(memcmp("Engage AF!",rxbuf,10)==0) e48e: 3d 40 0a 00 mov #10, r13 ;#0x000a e492: 0e 41 mov r1, r14 e494: 3f 40 62 e3 mov #-7326, r15 ;#0xe362 e498: b0 12 38 ed call #0xed38 e49c: 0f 93 tst r15 e49e: 28 25 jz $+594 ;abs 0xe6f0 delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); //delay(0xFFFF); //lil bit O delay } else if(memcmp("Disengage AF!",rxbuf,13)==0) e4a0: 3d 40 0d 00 mov #13, r13 ;#0x000d e4a4: 0e 41 mov r1, r14 e4a6: 3f 40 6d e3 mov #-7315, r15 ;#0xe36d e4aa: b0 12 38 ed call #0xed38 e4ae: 0f 93 tst r15 e4b0: 1a 25 jz $+566 ;abs 0xe6e6 P2OUT = 0x00; P1OUT &= ~AF; delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); } else if(memcmp("Open SHUT!",rxbuf,10)==0) e4b2: 3d 40 0a 00 mov #10, r13 ;#0x000a e4b6: 0e 41 mov r1, r14 e4b8: 3f 40 7b e3 mov #-7301, r15 ;#0xe37b e4bc: b0 12 38 ed call #0xed38 e4c0: 0f 93 tst r15 e4c2: 0c 25 jz $+538 ;abs 0xe6dc delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); //delay(0xFFFF); //lil bit O delay } else if(memcmp("Close SHUT!",rxbuf,11)==0) e4c4: 3d 40 0b 00 mov #11, r13 ;#0x000b e4c8: 0e 41 mov r1, r14 e4ca: 3f 40 86 e3 mov #-7290, r15 ;#0xe386 e4ce: b0 12 38 ed call #0xed38 e4d2: 0f 93 tst r15 e4d4: f4 24 jz $+490 ;abs 0xe6be P2OUT = 0x00; P1OUT &= ~SHUTTER; delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); } else if(memcmp("CUT ME DOWN!",rxbuf,13)==0) e4d6: 3d 40 0d 00 mov #13, r13 ;#0x000d e4da: 0e 41 mov r1, r14 e4dc: 3f 40 92 e3 mov #-7278, r15 ;#0xe392 e4e0: b0 12 38 ed call #0xed38 e4e4: 0f 93 tst r15 e4e6: b3 24 jz $+360 ;abs 0xe64e delay(0xFFFF); //lil bit O delay delay(0xFFFF); //lil bit O delay P3OUT &= ~DEBUG_OUTB; P2OUT = 0x00; } else if(memcmp("High Speed",rxbuf,10)==0) e4e8: 3d 40 0a 00 mov #10, r13 ;#0x000a e4ec: 0e 41 mov r1, r14 e4ee: 3f 40 9f e3 mov #-7265, r15 ;#0xe39f e4f2: b0 12 38 ed call #0xed38 e4f6: 0f 93 tst r15 e4f8: 7b 24 jz $+248 ;abs 0xe5f0 do{ i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE }while(i != 1); } else if(memcmp("Normal Speed",rxbuf,12)==0) e4fa: 3d 40 0c 00 mov #12, r13 ;#0x000c e4fe: 0e 41 mov r1, r14 e500: 3f 40 aa e3 mov #-7254, r15 ;#0xe3aa e504: b0 12 38 ed call #0xed38 e508: 0f 93 tst r15 e50a: 43 24 jz $+136 ;abs 0xe592 do{ i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE }while(i != 1); } else if(memcmp("Real Slow",rxbuf,9)==0) e50c: 3d 40 09 00 mov #9, r13 ;#0x0009 e510: 0e 41 mov r1, r14 e512: 3f 40 b7 e3 mov #-7241, r15 ;#0xe3b7 e516: b0 12 38 ed call #0xed38 e51a: 0f 93 tst r15 e51c: 0c 24 jz $+26 ;abs 0xe536 i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE }while(i != 1); } else { P2OUT |= 0x04; e51e: e2 d2 29 00 bis.b #4, &0x0029 ;r2 As==10 delay(0xFF); //lil bit O delay e522: 3f 40 ff 00 mov #255, r15 ;#0x00ff e526: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e52a: 3f 43 mov #-1, r15 ;r3 As==11 e52c: b0 12 36 e0 call #0xe036 P2OUT = 0x00; e530: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 e534: 88 3f jmp $-238 ;abs 0xe446 i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE }while(i != 1); } else if(memcmp("Real Slow",rxbuf,9)==0) { P2OUT |= 0x01; e536: d2 d3 29 00 bis.b #1, &0x0029 ;r3 As==01 //P3OUT |= DEBUG_OUTB; delay(0xFF); //lil bit O delay e53a: 3f 40 ff 00 mov #255, r15 ;#0x00ff e53e: b0 12 36 e0 call #0xe036 TX_STRING("Ok Slower!\0",10); e542: 7e 40 0a 00 mov.b #10, r14 ;#0x000a e546: 3f 40 c1 e3 mov #-7231, r15 ;#0xe3c1 e54a: b0 12 0a e2 call #0xe20a P2OUT |= 0x08; e54e: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFFFF); //lil bit O delay e552: 3f 43 mov #-1, r15 ;r3 As==11 e554: b0 12 36 e0 call #0xe036 P2OUT = 0; e558: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 delay(0xFFFF); //lil bit O delay e55c: 3f 43 mov #-1, r15 ;r3 As==11 e55e: b0 12 36 e0 call #0xe036 P2OUT |= 0x08; e562: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFFFF); //lil bit O delay e566: 3f 43 mov #-1, r15 ;r3 As==11 e568: b0 12 36 e0 call #0xe036 P2OUT = 0; e56c: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 CC1100_SPI_STROBE(CC1100_SRES); //reset chip e570: 7f 40 30 00 mov.b #48, r15 ;#0x0030 e574: b0 12 a8 ec call #0xeca8 //CC1100_WRITE_RF_SETTINGS(); CC1100_WRITE_RF_SETTINGS_1_2K(); e578: b0 12 da e8 call #0xe8da CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer, all bytes sent e57c: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e580: b0 12 a8 ec call #0xeca8 do{ i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE e584: 7f 40 35 00 mov.b #53, r15 ;#0x0035 e588: b0 12 04 ec call #0xec04 }while(i != 1); e58c: 5f 93 cmp.b #1, r15 ;r3 As==01 e58e: fa 23 jnz $-10 ;abs 0xe584 e590: 5a 3f jmp $-330 ;abs 0xe446 i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE }while(i != 1); } else if(memcmp("Normal Speed",rxbuf,12)==0) { P2OUT |= 0x03; e592: f2 d0 03 00 bis.b #3, &0x0029 ;#0x0003 e596: 29 00 //P3OUT |= DEBUG_OUTB; delay(0xFF); //lil bit O delay e598: 3f 40 ff 00 mov #255, r15 ;#0x00ff e59c: b0 12 36 e0 call #0xe036 TX_STRING("Ok Normal!\0",11); e5a0: 7e 40 0b 00 mov.b #11, r14 ;#0x000b e5a4: 3f 40 cd e3 mov #-7219, r15 ;#0xe3cd e5a8: b0 12 0a e2 call #0xe20a P2OUT |= 0x08; e5ac: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFFFF); //lil bit O delay e5b0: 3f 43 mov #-1, r15 ;r3 As==11 e5b2: b0 12 36 e0 call #0xe036 P2OUT = 0; e5b6: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 delay(0xFFFF); //lil bit O delay e5ba: 3f 43 mov #-1, r15 ;r3 As==11 e5bc: b0 12 36 e0 call #0xe036 P2OUT |= 0x08; e5c0: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFFFF); //lil bit O delay e5c4: 3f 43 mov #-1, r15 ;r3 As==11 e5c6: b0 12 36 e0 call #0xe036 P2OUT = 0; e5ca: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 CC1100_SPI_STROBE(CC1100_SRES); //reset chip e5ce: 7f 40 30 00 mov.b #48, r15 ;#0x0030 e5d2: b0 12 a8 ec call #0xeca8 CC1100_WRITE_RF_SETTINGS(); e5d6: b0 12 44 e7 call #0xe744 //CC1100_WRITE_RF_SETTINGS_500K(); CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer, all bytes sent e5da: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e5de: b0 12 a8 ec call #0xeca8 do{ i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE e5e2: 7f 40 35 00 mov.b #53, r15 ;#0x0035 e5e6: b0 12 04 ec call #0xec04 }while(i != 1); e5ea: 5f 93 cmp.b #1, r15 ;r3 As==01 e5ec: fa 23 jnz $-10 ;abs 0xe5e2 e5ee: 2b 3f jmp $-424 ;abs 0xe446 P3OUT &= ~DEBUG_OUTB; P2OUT = 0x00; } else if(memcmp("High Speed",rxbuf,10)==0) { P2OUT |= 0x0F; e5f0: f2 d0 0f 00 bis.b #15, &0x0029 ;#0x000f e5f4: 29 00 //P3OUT |= DEBUG_OUTB; delay(0xFF); //lil bit O delay e5f6: 3f 40 ff 00 mov #255, r15 ;#0x00ff e5fa: b0 12 36 e0 call #0xe036 TX_STRING("Ok Faster!\0",10); e5fe: 7e 40 0a 00 mov.b #10, r14 ;#0x000a e602: 3f 40 d9 e3 mov #-7207, r15 ;#0xe3d9 e606: b0 12 0a e2 call #0xe20a P2OUT |= 0x08; e60a: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFFFF); //lil bit O delay e60e: 3f 43 mov #-1, r15 ;r3 As==11 e610: b0 12 36 e0 call #0xe036 P2OUT = 0; e614: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 delay(0xFFFF); //lil bit O delay e618: 3f 43 mov #-1, r15 ;r3 As==11 e61a: b0 12 36 e0 call #0xe036 P2OUT |= 0x08; e61e: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFFFF); //lil bit O delay e622: 3f 43 mov #-1, r15 ;r3 As==11 e624: b0 12 36 e0 call #0xe036 P2OUT = 0; e628: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 CC1100_SPI_STROBE(CC1100_SRES); //reset chip e62c: 7f 40 30 00 mov.b #48, r15 ;#0x0030 e630: b0 12 a8 ec call #0xeca8 //CC1100_WRITE_RF_SETTINGS(); CC1100_WRITE_RF_SETTINGS_500K(); e634: b0 12 70 ea call #0xea70 CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer, all bytes sent e638: 7f 40 36 00 mov.b #54, r15 ;#0x0036 e63c: b0 12 a8 ec call #0xeca8 do{ i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE e640: 7f 40 35 00 mov.b #53, r15 ;#0x0035 e644: b0 12 04 ec call #0xec04 }while(i != 1); e648: 5f 93 cmp.b #1, r15 ;r3 As==01 e64a: fa 23 jnz $-10 ;abs 0xe640 e64c: fc 3e jmp $-518 ;abs 0xe446 delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); } else if(memcmp("CUT ME DOWN!",rxbuf,13)==0) { P2OUT |= 0x0F; e64e: f2 d0 0f 00 bis.b #15, &0x0029 ;#0x000f e652: 29 00 P3OUT |= DEBUG_OUTB; e654: f2 d0 20 00 bis.b #32, &0x0019 ;#0x0020 e658: 19 00 delay(0xFF); //lil bit O delay e65a: 3f 40 ff 00 mov #255, r15 ;#0x00ff e65e: b0 12 36 e0 call #0xe036 TX_STRING("PONG!\0",5); e662: 7e 40 05 00 mov.b #5, r14 ;#0x0005 e666: 3f 40 e5 e3 mov #-7195, r15 ;#0xe3e5 e66a: b0 12 0a e2 call #0xe20a delay(0xFFFF); //lil bit O delay e66e: 3f 43 mov #-1, r15 ;r3 As==11 e670: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e674: 3f 43 mov #-1, r15 ;r3 As==11 e676: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e67a: 3f 43 mov #-1, r15 ;r3 As==11 e67c: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e680: 3f 43 mov #-1, r15 ;r3 As==11 e682: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e686: 3f 43 mov #-1, r15 ;r3 As==11 e688: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e68c: 3f 43 mov #-1, r15 ;r3 As==11 e68e: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e692: 3f 43 mov #-1, r15 ;r3 As==11 e694: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e698: 3f 43 mov #-1, r15 ;r3 As==11 e69a: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e69e: 3f 43 mov #-1, r15 ;r3 As==11 e6a0: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e6a4: 3f 43 mov #-1, r15 ;r3 As==11 e6a6: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e6aa: 3f 43 mov #-1, r15 ;r3 As==11 e6ac: b0 12 36 e0 call #0xe036 delay(0xFFFF); //lil bit O delay e6b0: 3f 43 mov #-1, r15 ;r3 As==11 e6b2: b0 12 36 e0 call #0xe036 P3OUT &= ~DEBUG_OUTB; e6b6: f2 f0 df ff and.b #-33, &0x0019 ;#0xffdf e6ba: 19 00 P2OUT = 0x00; e6bc: 39 3f jmp $-396 ;abs 0xe530 //delay(0xFFFF); //lil bit O delay } else if(memcmp("Close SHUT!",rxbuf,11)==0) { P2OUT = 0x00; e6be: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 P1OUT &= ~SHUTTER; e6c2: f2 c2 21 00 bic.b #8, &0x0021 ;r2 As==11 delay(0xFF); //lil bit O delay e6c6: 3f 40 ff 00 mov #255, r15 ;#0x00ff e6ca: b0 12 36 e0 call #0xe036 TX_STRING("PONG!\0",5); e6ce: 7e 40 05 00 mov.b #5, r14 ;#0x0005 e6d2: 3f 40 e5 e3 mov #-7195, r15 ;#0xe3e5 e6d6: b0 12 0a e2 call #0xe20a e6da: b5 3e jmp $-660 ;abs 0xe446 delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); } else if(memcmp("Open SHUT!",rxbuf,10)==0) { P2OUT |= 0x01; e6dc: d2 d3 29 00 bis.b #1, &0x0029 ;r3 As==01 P1OUT |= SHUTTER; e6e0: f2 d2 21 00 bis.b #8, &0x0021 ;r2 As==11 delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); e6e4: f0 3f jmp $-30 ;abs 0xe6c6 //delay(0xFFFF); //lil bit O delay } else if(memcmp("Disengage AF!",rxbuf,13)==0) { P2OUT = 0x00; e6e6: c2 43 29 00 mov.b #0, &0x0029 ;r3 As==00 P1OUT &= ~AF; e6ea: e2 c2 21 00 bic.b #4, &0x0021 ;r2 As==10 delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); e6ee: eb 3f jmp $-40 ;abs 0xe6c6 delay(0xFFFF); //lil bit O delay P2OUT = 0x00; } else if(memcmp("Engage AF!",rxbuf,10)==0) { P2OUT |= 0x02; e6f0: e2 d3 29 00 bis.b #2, &0x0029 ;r3 As==10 P1OUT |= AF; e6f4: e2 d2 21 00 bis.b #4, &0x0021 ;r2 As==10 delay(0xFF); //lil bit O delay TX_STRING("PONG!\0",5); e6f8: e6 3f jmp $-50 ;abs 0xe6c6 P1OUT &= ~SHUTTER; P2OUT = 0x00; } else if(memcmp("Ping!",rxbuf,5)==0) { P2OUT |= 0x08; e6fa: f2 d2 29 00 bis.b #8, &0x0029 ;r2 As==11 delay(0xFF); //lil bit O delay e6fe: 3f 40 ff 00 mov #255, r15 ;#0x00ff e702: b0 12 36 e0 call #0xe036 TX_STRING("PONG!\0",5); e706: 7e 40 05 00 mov.b #5, r14 ;#0x0005 e70a: 3f 40 e5 e3 mov #-7195, r15 ;#0xe3e5 e70e: b0 12 0a e2 call #0xe20a delay(0xFFFF); //lil bit O delay P2OUT = 0x00; e712: 0b 3f jmp $-488 ;abs 0xe52a init_UART_SPI();*/ //P2OUT = status & 0x0F; if(memcmp("Go!",rxbuf,3)==0) { P1OUT |= SHUTTER; e714: f2 d2 21 00 bis.b #8, &0x0021 ;r2 As==11 P2OUT |= 0x01; e718: d2 d3 29 00 bis.b #1, &0x0029 ;r3 As==01 delay(0xFF); //lil bit O delay e71c: 3f 40 ff 00 mov #255, r15 ;#0x00ff e720: b0 12 36 e0 call #0xe036 TX_STRING("PONG!\0",5); e724: 7e 40 05 00 mov.b #5, r14 ;#0x0005 e728: 3f 40 e5 e3 mov #-7195, r15 ;#0xe3e5 e72c: b0 12 0a e2 call #0xe20a delay(0xFFFF); //lil bit O delay e730: 3f 43 mov #-1, r15 ;r3 As==11 e732: b0 12 36 e0 call #0xe036 //delay(0xFFFF); //lil bit O delay //delay(0xFFFF); //lil bit O delay //delay(0xFFFF); //lil bit O delay P1OUT &= ~SHUTTER; e736: f2 c2 21 00 bic.b #8, &0x0021 ;r2 As==11 P2OUT = 0x00; e73a: fa 3e jmp $-522 ;abs 0xe530 } //while(1); } //P2OUT = (0x0F & status); } } e73c: 31 50 18 00 add #24, r1 ;#0x0018 e740: 30 40 68 ed br #0xed68 0000e744 : static char make_gdb_happy=1; unsigned char status; unsigned char RSSI; unsigned char LQI; unsigned char PKTSTATUS; e744: 7e 40 06 00 mov.b #6, r14 ;#0x0006 e748: 7f 40 0b 00 mov.b #11, r15 ;#0x000b e74c: b0 12 60 ec call #0xec60 char RSSI_DBM; e750: 4e 43 clr.b r14 e752: 7f 40 0c 00 mov.b #12, r15 ;#0x000c e756: b0 12 60 ec call #0xec60 e75a: 7e 40 23 00 mov.b #35, r14 ;#0x0023 e75e: 7f 40 0d 00 mov.b #13, r15 ;#0x000d e762: b0 12 60 ec call #0xec60 /** e766: 7e 40 31 00 mov.b #49, r14 ;#0x0031 e76a: 7f 40 0e 00 mov.b #14, r15 ;#0x000e e76e: b0 12 60 ec call #0xec60 Delay function. e772: 7e 40 3b 00 mov.b #59, r14 ;#0x003b e776: 7f 40 0f 00 mov.b #15, r15 ;#0x000f e77a: b0 12 60 ec call #0xec60 */ e77e: 7e 40 c8 ff mov.b #-56, r14 ;#0xffc8 e782: 7f 40 10 00 mov.b #16, r15 ;#0x0010 e786: b0 12 60 ec call #0xec60 void delay(unsigned int d) e78a: 7e 40 93 ff mov.b #-109, r14 ;#0xff93 e78e: 7f 40 11 00 mov.b #17, r15 ;#0x0011 e792: b0 12 60 ec call #0xec60 { e796: 7e 40 03 00 mov.b #3, r14 ;#0x0003 e79a: 7f 40 12 00 mov.b #18, r15 ;#0x0012 e79e: b0 12 60 ec call #0xec60 int i; e7a2: 7e 40 a2 ff mov.b #-94, r14 ;#0xffa2 e7a6: 7f 40 13 00 mov.b #19, r15 ;#0x0013 e7aa: b0 12 60 ec call #0xec60 for (i = 0; i: void sys_init() { WDTCTL = WDTCTL_INIT; //Init watchdog timer e8da: 7e 40 06 00 mov.b #6, r14 ;#0x0006 e8de: 7f 40 0b 00 mov.b #11, r15 ;#0x000b e8e2: b0 12 60 ec call #0xec60 P1OUT = P1OUT_INIT; //Init output data of port1 e8e6: 4e 43 clr.b r14 e8e8: 7f 40 0c 00 mov.b #12, r15 ;#0x000c e8ec: b0 12 60 ec call #0xec60 P2OUT = P2OUT_INIT; //Init output data of port2 e8f0: 7e 40 23 00 mov.b #35, r14 ;#0x0023 e8f4: 7f 40 0d 00 mov.b #13, r15 ;#0x000d e8f8: b0 12 60 ec call #0xec60 P3OUT = P3OUT_INIT; e8fc: 7e 40 31 00 mov.b #49, r14 ;#0x0031 e900: 7f 40 0e 00 mov.b #14, r15 ;#0x000e e904: b0 12 60 ec call #0xec60 e908: 7e 40 3b 00 mov.b #59, r14 ;#0x003b e90c: 7f 40 0f 00 mov.b #15, r15 ;#0x000f e910: b0 12 60 ec call #0xec60 P1SEL = P1SEL_INIT; //Select port or module -function on port1 e914: 7e 40 f5 ff mov.b #-11, r14 ;#0xfff5 e918: 7f 40 10 00 mov.b #16, r15 ;#0x0010 e91c: b0 12 60 ec call #0xec60 P2SEL = P2SEL_INIT; //Select port or module -function on port2 e920: 7e 40 83 ff mov.b #-125, r14 ;#0xff83 e924: 7f 40 11 00 mov.b #17, r15 ;#0x0011 e928: b0 12 60 ec call #0xec60 P3SEL = P3SEL_INIT; e92c: 7e 40 03 00 mov.b #3, r14 ;#0x0003 e930: 7f 40 12 00 mov.b #18, r15 ;#0x0012 e934: b0 12 60 ec call #0xec60 e938: 7e 40 22 00 mov.b #34, r14 ;#0x0022 e93c: 7f 40 13 00 mov.b #19, r15 ;#0x0013 e940: b0 12 60 ec call #0xec60 P1DIR = P1DIR_INIT; //Init port direction register of port1 e944: 7e 40 f8 ff mov.b #-8, r14 ;#0xfff8 e948: 7f 40 14 00 mov.b #20, r15 ;#0x0014 e94c: b0 12 60 ec call #0xec60 P2DIR = P2DIR_INIT; //Init port direction register of port2 e950: 7e 40 0a 00 mov.b #10, r14 ;#0x000a e954: 7f 40 0a 00 mov.b #10, r15 ;#0x000a e958: b0 12 60 ec call #0xec60 P3DIR = P3DIR_INIT; e95c: 7e 40 15 00 mov.b #21, r14 ;#0x0015 e960: 7f 40 15 00 mov.b #21, r15 ;#0x0015 e964: b0 12 60 ec call #0xec60 e968: 7e 40 56 00 mov.b #86, r14 ;#0x0056 e96c: 7f 40 21 00 mov.b #33, r15 ;#0x0021 e970: b0 12 60 ec call #0xec60 P1IES = P1IES_INIT; //init port interrupts e974: 7e 40 10 00 mov.b #16, r14 ;#0x0010 e978: 7f 40 22 00 mov.b #34, r15 ;#0x0022 e97c: b0 12 60 ec call #0xec60 P2IES = P2IES_INIT; e980: 7e 40 18 00 mov.b #24, r14 ;#0x0018 e984: 7f 40 18 00 mov.b #24, r15 ;#0x0018 e988: b0 12 60 ec call #0xec60 e98c: 7e 40 16 00 mov.b #22, r14 ;#0x0016 e990: 7f 40 19 00 mov.b #25, r15 ;#0x0019 e994: b0 12 60 ec call #0xec60 P1IE = P1IE_INIT; e998: 7e 40 6c 00 mov.b #108, r14 ;#0x006c e99c: 7f 40 1a 00 mov.b #26, r15 ;#0x001a e9a0: b0 12 60 ec call #0xec60 P2IE = P2IE_INIT; e9a4: 7e 40 03 00 mov.b #3, r14 ;#0x0003 e9a8: 7f 40 1b 00 mov.b #27, r15 ;#0x001b e9ac: b0 12 60 ec call #0xec60 e9b0: 7e 40 40 00 mov.b #64, r14 ;#0x0040 e9b4: 7f 40 1c 00 mov.b #28, r15 ;#0x001c e9b8: b0 12 60 ec call #0xec60 BCSCTL1 |= RSEL0 | RSEL1 | RSEL2; e9bc: 7e 40 91 ff mov.b #-111, r14 ;#0xff91 e9c0: 7f 40 1d 00 mov.b #29, r15 ;#0x001d e9c4: b0 12 60 ec call #0xec60 DCOCTL |= DCO0 | DCO1 | DCO2; e9c8: 7e 40 e9 ff mov.b #-23, r14 ;#0xffe9 e9cc: 7f 40 23 00 mov.b #35, r15 ;#0x0023 e9d0: b0 12 60 ec call #0xec60 e9d4: 7e 40 2a 00 mov.b #42, r14 ;#0x002a e9d8: 7f 40 24 00 mov.b #36, r15 ;#0x0024 e9dc: b0 12 60 ec call #0xec60 e9e0: 4e 43 clr.b r14 e9e2: 7f 40 25 00 mov.b #37, r15 ;#0x0025 e9e6: b0 12 60 ec call #0xec60 e9ea: 7e 40 1f 00 mov.b #31, r14 ;#0x001f e9ee: 7f 40 26 00 mov.b #38, r15 ;#0x0026 e9f2: b0 12 60 ec call #0xec60 e9f6: 7e 40 59 00 mov.b #89, r14 ;#0x0059 e9fa: 7f 40 29 00 mov.b #41, r15 ;#0x0029 e9fe: b0 12 60 ec call #0xec60 //delay(0xffff); ea02: 7e 40 81 ff mov.b #-127, r14 ;#0xff81 ea06: 7f 40 2c 00 mov.b #44, r15 ;#0x002c ea0a: b0 12 60 ec call #0xec60 } ea0e: 7e 40 35 00 mov.b #53, r14 ;#0x0035 ea12: 7f 40 2d 00 mov.b #45, r15 ;#0x002d ea16: b0 12 60 ec call #0xec60 ea1a: 7e 40 09 00 mov.b #9, r14 ;#0x0009 ea1e: 7f 40 2e 00 mov.b #46, r15 ;#0x002e ea22: b0 12 60 ec call #0xec60 ea26: 7e 40 0b 00 mov.b #11, r14 ;#0x000b ea2a: 4f 43 clr.b r15 ea2c: b0 12 60 ec call #0xec60 ea30: 7e 40 06 00 mov.b #6, r14 ;#0x0006 ea34: 6f 43 mov.b #2, r15 ;r3 As==10 ea36: b0 12 60 ec call #0xec60 ea3a: 6e 42 mov.b #4, r14 ;r2 As==10 ea3c: 7f 40 07 00 mov.b #7, r15 ;#0x0007 ea40: b0 12 60 ec call #0xec60 /** ea44: 6e 42 mov.b #4, r14 ;r2 As==10 ea46: 7f 42 mov.b #8, r15 ;r2 As==11 ea48: b0 12 60 ec call #0xec60 Get some bytes ea4c: 4e 43 clr.b r14 ea4e: 7f 40 09 00 mov.b #9, r15 ;#0x0009 ea52: b0 12 60 ec call #0xec60 */ ea56: 7e 40 19 00 mov.b #25, r14 ;#0x0019 ea5a: 7f 40 06 00 mov.b #6, r15 ;#0x0006 ea5e: b0 12 60 ec call #0xec60 char RX_STRING(char *rxbuf, char length, unsigned long timeout) ea62: 7e 40 c0 ff mov.b #-64, r14 ;#0xffc0 ea66: 7f 40 3e 00 mov.b #62, r15 ;#0x003e ea6a: b0 12 60 ec call #0xec60 { ea6e: 30 41 ret 0000ea70 : unsigned long time=0; unsigned char state,i, real_length=23, pkt_length; RSSI = 0; LQI = 0; ea70: 7e 40 0c 00 mov.b #12, r14 ;#0x000c ea74: 7f 40 0b 00 mov.b #11, r15 ;#0x000b ea78: b0 12 60 ec call #0xec60 CC1100_SPI_STROBE(CC1100_SRX);//Recieve ea7c: 4e 43 clr.b r14 ea7e: 7f 40 0c 00 mov.b #12, r15 ;#0x000c ea82: b0 12 60 ec call #0xec60 ea86: 7e 40 21 00 mov.b #33, r14 ;#0x0021 ea8a: 7f 40 0d 00 mov.b #13, r15 ;#0x000d ea8e: b0 12 60 ec call #0xec60 while ((P3IN&GDO0) == 0) // Wait for GDO0 to be set -> sync transmitted ea92: 7e 40 65 00 mov.b #101, r14 ;#0x0065 ea96: 7f 40 0e 00 mov.b #14, r15 ;#0x000e ea9a: b0 12 60 ec call #0xec60 { ea9e: 7e 40 6a 00 mov.b #106, r14 ;#0x006a eaa2: 7f 40 0f 00 mov.b #15, r15 ;#0x000f eaa6: b0 12 60 ec call #0xec60 //i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE eaaa: 7e 40 0e 00 mov.b #14, r14 ;#0x000e eaae: 7f 40 10 00 mov.b #16, r15 ;#0x0010 eab2: b0 12 60 ec call #0xec60 eab6: 7e 40 3b 00 mov.b #59, r14 ;#0x003b eaba: 7f 40 11 00 mov.b #17, r15 ;#0x0011 eabe: b0 12 60 ec call #0xec60 if((time >= timeout) && timeout != 0) eac2: 7e 40 73 00 mov.b #115, r14 ;#0x0073 eac6: 7f 40 12 00 mov.b #18, r15 ;#0x0012 eaca: b0 12 60 ec call #0xec60 { eace: 7e 40 42 00 mov.b #66, r14 ;#0x0042 ead2: 7f 40 13 00 mov.b #19, r15 ;#0x0013 ead6: b0 12 60 ec call #0xec60 eada: 7e 40 f8 ff mov.b #-8, r14 ;#0xfff8 eade: 7f 40 14 00 mov.b #20, r15 ;#0x0014 eae2: b0 12 60 ec call #0xec60 CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer eae6: 7e 40 0a 00 mov.b #10, r14 ;#0x000a eaea: 7f 40 0a 00 mov.b #10, r15 ;#0x000a eaee: b0 12 60 ec call #0xec60 CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer eaf2: 4e 43 clr.b r14 eaf4: 7f 40 15 00 mov.b #21, r15 ;#0x0015 eaf8: b0 12 60 ec call #0xec60 return false; //timeout! eafc: 7e 40 b6 ff mov.b #-74, r14 ;#0xffb6 eb00: 7f 40 21 00 mov.b #33, r15 ;#0x0021 eb04: b0 12 60 ec call #0xec60 } eb08: 7e 40 10 00 mov.b #16, r14 ;#0x0010 eb0c: 7f 40 22 00 mov.b #34, r15 ;#0x0022 eb10: b0 12 60 ec call #0xec60 time++; eb14: 7e 40 18 00 mov.b #24, r14 ;#0x0018 eb18: 7f 40 18 00 mov.b #24, r15 ;#0x0018 eb1c: b0 12 60 ec call #0xec60 } eb20: 7e 40 1d 00 mov.b #29, r14 ;#0x001d eb24: 7f 40 19 00 mov.b #25, r15 ;#0x0019 eb28: b0 12 60 ec call #0xec60 eb2c: 7e 40 1c 00 mov.b #28, r14 ;#0x001c eb30: 7f 40 1a 00 mov.b #26, r15 ;#0x001a eb34: b0 12 60 ec call #0xec60 time=0; eb38: 7e 40 c7 ff mov.b #-57, r14 ;#0xffc7 eb3c: 7f 40 1b 00 mov.b #27, r15 ;#0x001b eb40: b0 12 60 ec call #0xec60 while ((P3IN&GDO0) == GDO0) // Wait for GDO0 to be cleared -> end of packet eb44: 7e 40 40 00 mov.b #64, r14 ;#0x0040 eb48: 7f 40 1c 00 mov.b #28, r15 ;#0x001c eb4c: b0 12 60 ec call #0xec60 { eb50: 7e 40 b2 ff mov.b #-78, r14 ;#0xffb2 eb54: 7f 40 1d 00 mov.b #29, r15 ;#0x001d eb58: b0 12 60 ec call #0xec60 //i = CC1100_SPI_RDREG(CC1100_MARCSTATE);//wait for IDLE eb5c: 7e 40 ea ff mov.b #-22, r14 ;#0xffea eb60: 7f 40 23 00 mov.b #35, r15 ;#0x0023 eb64: b0 12 60 ec call #0xec60 if((time >= timeout) && timeout != 0) eb68: 7e 40 2a 00 mov.b #42, r14 ;#0x002a eb6c: 7f 40 24 00 mov.b #36, r15 ;#0x0024 eb70: b0 12 60 ec call #0xec60 { eb74: 4e 43 clr.b r14 eb76: 7f 40 25 00 mov.b #37, r15 ;#0x0025 eb7a: b0 12 60 ec call #0xec60 eb7e: 7e 40 19 00 mov.b #25, r14 ;#0x0019 eb82: 7f 40 26 00 mov.b #38, r15 ;#0x0026 eb86: b0 12 60 ec call #0xec60 CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer eb8a: 7e 40 59 00 mov.b #89, r14 ;#0x0059 eb8e: 7f 40 29 00 mov.b #41, r15 ;#0x0029 eb92: b0 12 60 ec call #0xec60 CC1100_SPI_STROBE(CC1100_SIDLE); //flush the buffer eb96: 7e 40 88 ff mov.b #-120, r14 ;#0xff88 eb9a: 7f 40 2c 00 mov.b #44, r15 ;#0x002c eb9e: b0 12 60 ec call #0xec60 return false; //timeout! eba2: 7e 40 31 00 mov.b #49, r14 ;#0x0031 eba6: 7f 40 2d 00 mov.b #45, r15 ;#0x002d ebaa: b0 12 60 ec call #0xec60 } ebae: 7e 40 0b 00 mov.b #11, r14 ;#0x000b ebb2: 7f 40 2e 00 mov.b #46, r15 ;#0x002e ebb6: b0 12 60 ec call #0xec60 time++; ebba: 7e 40 0b 00 mov.b #11, r14 ;#0x000b ebbe: 4f 43 clr.b r15 ebc0: b0 12 60 ec call #0xec60 } ebc4: 7e 40 06 00 mov.b #6, r14 ;#0x0006 ebc8: 6f 43 mov.b #2, r15 ;r3 As==10 ebca: b0 12 60 ec call #0xec60 ebce: 6e 42 mov.b #4, r14 ;r2 As==10 ebd0: 7f 40 07 00 mov.b #7, r15 ;#0x0007 ebd4: b0 12 60 ec call #0xec60 //pkt_length = CCXX_SPI_RDREG(CC1100_RXFIFO);//length of the buffer ebd8: 6e 42 mov.b #4, r14 ;r2 As==10 ebda: 7f 42 mov.b #8, r15 ;r2 As==11 ebdc: b0 12 60 ec call #0xec60 pkt_length = CC1100_SPI_RDREG(CC1100_PKTLEN);//We are using fixed length, so use the pktlen register ebe0: 4e 43 clr.b r14 ebe2: 7f 40 09 00 mov.b #9, r15 ;#0x0009 ebe6: b0 12 60 ec call #0xec60 real_length = CC1100_SPI_RDREG(CC1100_RXBYTES);//length of the packet ebea: 7e 40 19 00 mov.b #25, r14 ;#0x0019 ebee: 7f 40 06 00 mov.b #6, r15 ;#0x0006 ebf2: b0 12 60 ec call #0xec60 for(i=0; i < length && i < pkt_length; i++) ebf6: 7e 40 c3 ff mov.b #-61, r14 ;#0xffc3 ebfa: 7f 40 3e 00 mov.b #62, r15 ;#0x003e ebfe: b0 12 60 ec call #0xec60 { ec02: 30 41 ret 0000ec04 : } rxbuf[i] = '\0';//set the NULL terminator RSSI = CC1100_SPI_RDREG(CC1100_RXFIFO);//get the ESSI LQI = CC1100_SPI_RDREG(CC1100_RXFIFO);//get the CRC PKTSTATUS = CC1100_SPI_RDREG(CC1100_PKTSTATUS); ec04: 4e 4f mov.b r15, r14 ec06: 7f 90 30 00 cmp.b #48, r15 ;#0x0030 ec0a: 1e 38 jl $+62 ;abs 0xec48 if(real_length != (pkt_length + 2)) //packets lengths dont match, LQI mis-reported ec0c: 7e d0 c0 ff bis.b #-64, r14 ;#0xffc0 LQI &= ~bit7; //force it to be INVALID! if (RSSI >= 128) RSSI_DBM = (int)((int )(RSSI - 256) / 2) - 74; ec10: c2 43 06 02 mov.b #0, &0x0206 ;r3 As==00 else ec14: d2 c3 19 00 bic.b #1, &0x0019 ;r3 As==01 RSSI_DBM = (RSSI / 2) - 74; ec18: e2 b2 18 00 bit.b #4, &0x0018 ;r2 As==10 ec1c: fd 23 jnz $-4 ;abs 0xec18 CC1100_SPI_STROBE(CC1100_SFRX); //flush the buffer ec1e: f2 d0 0e 00 bis.b #14, &0x001b ;#0x000e ec22: 1b 00 CC1100_SPI_STROBE(CC1100_SIDLE); //return to IDLE state return i; //i = real length ec24: c2 4e 77 00 mov.b r14, &0x0077 } ec28: d2 c3 03 00 bic.b #1, &0x0003 ;r3 As==01 ec2c: d2 b3 03 00 bit.b #1, &0x0003 ;r3 As==01 ec30: fd 27 jz $-4 ;abs 0xec2c /** ec32: d2 42 76 00 mov.b &0x0076,&0x0206 ec36: 06 02 Transmit a string of bytes. */ ec38: c2 4e 77 00 mov.b r14, &0x0077 void TX_STRING(unsigned char *txstring, unsigned char length) ec3c: d2 c3 03 00 bic.b #1, &0x0003 ;r3 As==01 { ec40: d2 b3 03 00 bit.b #1, &0x0003 ;r3 As==01 ec44: fd 27 jz $-4 ;abs 0xec40 ec46: 03 3c jmp $+8 ;abs 0xec4e PKTSTATUS = CC1100_SPI_RDREG(CC1100_PKTSTATUS); if(real_length != (pkt_length + 2)) //packets lengths dont match, LQI mis-reported LQI &= ~bit7; //force it to be INVALID! ec48: 7e d0 80 ff bis.b #-128, r14 ;#0xff80 ec4c: e1 3f jmp $-60 ;abs 0xec10 /** Transmit a string of bytes. */ void TX_STRING(unsigned char *txstring, unsigned char length) { unsigned char i,pktlen = CC1100_SPI_RDREG(CC1100_PKTLEN); ec4e: 5f 42 76 00 mov.b &0x0076,r15 do{ ec52: d2 d3 19 00 bis.b #1, &0x0019 ;r3 As==01 CC1100_SPI_STROBE(CC1100_SIDLE);//Idle ec56: f2 f0 f1 ff and.b #-15, &0x001b ;#0xfff1 ec5a: 1b 00 CC1100_SPI_STROBE(CC1100_SNOP) ; //wait for Idle ec5c: 8f 11 sxt r15 }while((status & CC1100_STAT_ADDR) != CC1100_STAT_IDLE); //wait for idle ec5e: 30 41 ret 0000ec60 : /* for(i=0; i<=length; i++) { if(i < length) CC1100_SPI_WRREG(CC1100_TXFIFO, txstring[i]);//Write data to FIFO }*/ ec60: 4d 4f mov.b r15, r13 if(length > pktlen) //text string is too long for fixed packet length mode length = pktlen; if (length == pktlen) ec62: c2 43 06 02 mov.b #0, &0x0206 ;r3 As==00 CC1100_SPI_BURST_WRREG(CC1100_TXFIFO_BURST, txstring, length); ec66: d2 c3 19 00 bic.b #1, &0x0019 ;r3 As==01 else if (length < pktlen) { ec6a: e2 b2 18 00 bit.b #4, &0x0018 ;r2 As==10 ec6e: fd 23 jnz $-4 ;abs 0xec6a /*for(i=0; i: CC1100_SPI_STROBE(CC1100_SNOP) ; //(wait for 15, idle)read status byte.... if(status == 31) //fast RX mode yay break; }while((status & CC1100_STAT_ADDR) != CC1100_STAT_IDLE); //(15)31 for return to TX on complete, see MCSM1 } eca8: 4e 4f mov.b r15, r14 ecaa: c2 43 06 02 mov.b #0, &0x0206 ;r3 As==00 void init_UART_SPI() ecae: d2 c3 19 00 bic.b #1, &0x0019 ;r3 As==01 { P3SEL &= ~UART0_232_MODULES; //this will bring the clock edge high ecb2: e2 b2 18 00 bit.b #4, &0x0018 ;r2 As==10 ecb6: fd 23 jnz $-4 ;abs 0xecb2 U0CTL |= SWRST; // disable the state machine ME2 &= ~UTXE0; //disable UART ecb8: f2 d0 0e 00 bis.b #14, &0x001b ;#0x000e ecbc: 1b 00 ME2 |= USPIE0; //enable SPI ecbe: c2 4e 77 00 mov.b r14, &0x0077 U0CTL = CHAR | SYNC | MM | SWRST; ecc2: d2 c3 03 00 bic.b #1, &0x0003 ;r3 As==01 U0TCTL = CKPH | STC | SSEL_3; ecc6: d2 b3 03 00 bit.b #1, &0x0003 ;r3 As==01 ecca: fd 27 jz $-4 ;abs 0xecc6 eccc: d2 42 76 00 mov.b &0x0076,&0x0206 ecd0: 06 02 U0BR0 = 2; //divide by 5 = 1Mhz U0BR1 = 0; ecd2: d2 d3 19 00 bis.b #1, &0x0019 ;r3 As==01 U0MCTL = 0; ecd6: f2 f0 f1 ff and.b #-15, &0x001b ;#0xfff1 ecda: 1b 00 U0CTL &= ~SWRST; // Initialize USART state machine } ecdc: 30 41 ret 0000ecde : void init_UART_232() { P3SEL |= UART0_232_MODULES; //this will bring the clock edge high U0CTL |= SWRST; // disable the state machine ME2 &= ~USPIE0; //disable SPI ecde: 4c 4f mov.b r15, r12 ME2 |= UTXE0; //enable UART U0CTL = CHAR | SWRST; U0TCTL = SSEL_3; ece0: c2 43 06 02 mov.b #0, &0x0206 ;r3 As==00 ece4: d2 c3 19 00 bic.b #1, &0x0019 ;r3 As==01 U0BR0 = 0x71; //divide by 1905 = 2400 baud //lower byte U0BR1 = 0x07;//00001110; //upper byte ece8: e2 b2 18 00 bit.b #4, &0x0018 ;r2 As==10 ecec: fd 23 jnz $-4 ;abs 0xece8 U0MCTL = 0; U0CTL &= ~SWRST; // Initialize USART state machine ecee: f2 d0 0e 00 bis.b #14, &0x001b ;#0x000e ecf2: 1b 00 ecf4: d2 c3 03 00 bic.b #1, &0x0003 ;r3 As==01 } ecf8: c2 4c 77 00 mov.b r12, &0x0077 ecfc: d2 b3 03 00 bit.b #1, &0x0003 ;r3 As==01 ed00: fd 27 jz $-4 ;abs 0xecfc void tx_232_char(char c) ed02: d2 42 76 00 mov.b &0x0076,&0x0206 ed06: 06 02 { ed08: 0c 43 clr r12 ed0a: 8d 11 sxt r13 ed0c: 0c 9d cmp r13, r12 ed0e: 0e 2c jc $+30 ;abs 0xed2c //U0TXBUF = c; ed10: d2 c3 03 00 bic.b #1, &0x0003 ;r3 As==01 ed14: 0f 4e mov r14, r15 ed16: 0f 5c add r12, r15 ed18: e2 4f 77 00 mov.b @r15, &0x0077 //IFG2 &= ~UTXIFG0; ed1c: d2 b3 03 00 bit.b #1, &0x0003 ;r3 As==01 ed20: fd 27 jz $-4 ;abs 0xed1c while ((IFG2 & UTXIFG0) == 0); // USART0 TX buffer ready? ed22: 5f 42 76 00 mov.b &0x0076,r15 } void tx_232_char(char c) { ed26: 1c 53 inc r12 ed28: 0c 9d cmp r13, r12 ed2a: f2 2b jnc $-26 ;abs 0xed10 //IFG2 &= ~UTXIFG0; while ((IFG2 & UTXIFG0) == 0); // USART0 TX buffer ready? U0TXBUF = c; } ed2c: d2 d3 19 00 bis.b #1, &0x0019 ;r3 As==01 void tx_232_str(char *str) ed30: f2 f0 f1 ff and.b #-15, &0x001b ;#0xfff1 ed34: 1b 00 { ed36: 30 41 ret 0000ed38 : ed38: 0b 12 push r11 ed3a: 0b 4d mov r13, r11 ed3c: 0d 93 tst r13 ed3e: 0a 24 jz $+22 ;abs 0xed54 ed40: 0c 4f mov r15, r12 ed42: 0d 4e mov r14, r13 ed44: 6e 4d mov.b @r13, r14 ed46: 1d 53 inc r13 ed48: 6f 4c mov.b @r12, r15 ed4a: 1c 53 inc r12 ed4c: 4f 9e cmp.b r14, r15 ed4e: 04 20 jnz $+10 ;abs 0xed58 ed50: 3b 53 add #-1, r11 ;r3 As==11 ed52: f8 23 jnz $-14 ;abs 0xed44 ed54: 0c 43 clr r12 ed56: 05 3c jmp $+12 ;abs 0xed62 ed58: 5c 4c ff ff mov.b -1(r12),r12 ;0xffff(r12) ed5c: 5f 4d ff ff mov.b -1(r13),r15 ;0xffff(r13) ed60: 0c 8f sub r15, r12 ed62: 0f 4c mov r12, r15 ed64: 3b 41 pop r11 ed66: 30 41 ret 0000ed68 <__stop_progExec__>: ed68: ff 3f jmp $+0 ;abs 0xed68 Disassembly of section .vectors: 0000ffe0 : ffe0: 30 e0 30 e0 30 e0 30 e0 30 e0 30 e0 30 e0 30 e0 0.0.0.0.0.0.0.0. fff0: 30 e0 30 e0 30 e0 30 e0 30 e0 30 e0 30 e0 00 e0 0.0.0.0.0.0.0...