firmware.list 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. firmware.elf: file format elf32-msp430
  2. Disassembly of section .text:
  3. 0000c000 <__watchdog_support>:
  4. c000: 55 42 20 01 mov.b &0x0120,r5
  5. c004: 35 d0 08 5a bis #23048, r5 ;#0x5a08
  6. c008: 82 45 02 02 mov r5, &0x0202
  7. 0000c00c <__init_stack>:
  8. c00c: 31 40 00 04 mov #1024, r1 ;#0x0400
  9. 0000c010 <__do_copy_data>:
  10. c010: 3f 40 00 00 mov #0, r15 ;#0x0000
  11. c014: 0f 93 tst r15
  12. c016: 08 24 jz $+18 ;abs 0xc028
  13. c018: 92 42 02 02 mov &0x0202,&0x0120
  14. c01c: 20 01
  15. c01e: 2f 83 decd r15
  16. c020: 9f 4f d6 c1 mov -15914(r15),512(r15);0xc1d6(r15), 0x0200(r15)
  17. c024: 00 02
  18. c026: f8 23 jnz $-14 ;abs 0xc018
  19. 0000c028 <__do_clear_bss>:
  20. c028: 3f 40 02 00 mov #2, r15 ;#0x0002
  21. c02c: 0f 93 tst r15
  22. c02e: 07 24 jz $+16 ;abs 0xc03e
  23. c030: 92 42 02 02 mov &0x0202,&0x0120
  24. c034: 20 01
  25. c036: 1f 83 dec r15
  26. c038: cf 43 00 02 mov.b #0, 512(r15);r3 As==00, 0x0200(r15)
  27. c03c: f9 23 jnz $-12 ;abs 0xc030
  28. 0000c03e <main>:
  29. /**
  30. * Main routine
  31. */
  32. int main(void)
  33. {
  34. c03e: 21 82 sub #4, r1 ;r2 As==10
  35. WDTCTL = WDTPW + WDTHOLD; // Stop WDT
  36. c040: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80
  37. c044: 20 01
  38. BCSCTL1 = CALBC1_1MHZ; // Set DCO
  39. c046: d2 42 ff 10 mov.b &0x10ff,&0x0057
  40. c04a: 57 00
  41. DCOCTL = CALDCO_1MHZ;
  42. c04c: d2 42 fe 10 mov.b &0x10fe,&0x0056
  43. c050: 56 00
  44. P1DIR = BIT0 + BIT6; // P1.0 and P1.6 are the red+green LEDs
  45. c052: f2 40 41 00 mov.b #65, &0x0022 ;#0x0041
  46. c056: 22 00
  47. P1OUT = BIT0 + BIT6; // All LEDs off
  48. c058: f2 40 41 00 mov.b #65, &0x0021 ;#0x0041
  49. c05c: 21 00
  50. uart_init();
  51. c05e: b0 12 e2 c0 call #0xc0e2
  52. // register ISR called when data was received
  53. uart_set_rx_isr_ptr(uart_rx_isr);
  54. c062: 3f 40 d8 c0 mov #-16168,r15 ;#0xc0d8
  55. c066: b0 12 12 c1 call #0xc112
  56. __bis_SR_register(GIE);
  57. c06a: 32 d2 eint
  58. uart_puts((char *)"\n\r***************\n\r");
  59. c06c: 3f 40 6c c1 mov #-16020,r15 ;#0xc16c
  60. c070: b0 12 34 c1 call #0xc134
  61. uart_puts((char *)"MSP430 harduart\n\r");
  62. c074: 3f 40 80 c1 mov #-16000,r15 ;#0xc180
  63. c078: b0 12 34 c1 call #0xc134
  64. uart_puts((char *)"***************\n\r\n\r");
  65. c07c: 3f 40 92 c1 mov #-15982,r15 ;#0xc192
  66. c080: b0 12 34 c1 call #0xc134
  67. uart_puts((char *)"PRESS any key to start echo example ... ");
  68. c084: 3f 40 a6 c1 mov #-15962,r15 ;#0xc1a6
  69. c088: b0 12 34 c1 call #0xc134
  70. unsigned char c = uart_getc();
  71. c08c: b0 12 18 c1 call #0xc118
  72. uart_putc(c);
  73. c090: b0 12 26 c1 call #0xc126
  74. uart_puts((char *)"\n\rOK\n\r");
  75. c094: 3f 40 cf c1 mov #-15921,r15 ;#0xc1cf
  76. c098: b0 12 34 c1 call #0xc134
  77. volatile unsigned long i;
  78. while(1) {
  79. P1OUT ^= BIT6; // Toggle P1.6 output (green LED) using exclusive-OR
  80. c09c: f2 e0 40 00 xor.b #64, &0x0021 ;#0x0040
  81. c0a0: 21 00
  82. i = 50000; // Delay
  83. c0a2: b1 40 50 c3 mov #-15536,0(r1) ;#0xc350, 0x0000(r1)
  84. c0a6: 00 00
  85. c0a8: 81 43 02 00 mov #0, 2(r1) ;r3 As==00, 0x0002(r1)
  86. do (i--); // busy waiting (bad)
  87. c0ac: 2e 41 mov @r1, r14
  88. c0ae: 1f 41 02 00 mov 2(r1), r15 ;0x0002(r1)
  89. c0b2: 3e 53 add #-1, r14 ;r3 As==11
  90. c0b4: 3f 63 addc #-1, r15 ;r3 As==11
  91. c0b6: 81 4e 00 00 mov r14, 0(r1) ;0x0000(r1)
  92. c0ba: 81 4f 02 00 mov r15, 2(r1) ;0x0002(r1)
  93. while (i != 0);
  94. c0be: 2e 41 mov @r1, r14
  95. c0c0: 1f 41 02 00 mov 2(r1), r15 ;0x0002(r1)
  96. c0c4: 0e 93 tst r14
  97. c0c6: f2 23 jnz $-26 ;abs 0xc0ac
  98. c0c8: 0f 93 tst r15
  99. c0ca: f0 23 jnz $-30 ;abs 0xc0ac
  100. c0cc: e7 3f jmp $-48 ;abs 0xc09c
  101. 0000c0ce <__stop_progExec__>:
  102. c0ce: 32 d0 f0 00 bis #240, r2 ;#0x00f0
  103. c0d2: fd 3f jmp $-4 ;abs 0xc0ce
  104. 0000c0d4 <__ctors_end>:
  105. c0d4: 30 40 6a c1 br #0xc16a
  106. 0000c0d8 <uart_rx_isr>:
  107. #include <msp430g2553.h>
  108. #include "uart.h"
  109. void uart_rx_isr(unsigned char c) {
  110. uart_putc(c);
  111. c0d8: b0 12 26 c1 call #0xc126
  112. P1OUT ^= BIT0; // toggle P1.0 (red led)
  113. c0dc: d2 e3 21 00 xor.b #1, &0x0021 ;r3 As==01
  114. }
  115. c0e0: 30 41 ret
  116. 0000c0e2 <uart_init>:
  117. IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
  118. }
  119. void uart_set_rx_isr_ptr(void (*isr_ptr)(unsigned char c))
  120. {
  121. uart_rx_isr_ptr = isr_ptr;
  122. c0e2: 82 43 00 02 mov #0, &0x0200 ;r3 As==00
  123. void uart_init(void)
  124. {
  125. uart_set_rx_isr_ptr(0L);
  126. P1SEL = RXD + TXD;
  127. c0e6: f2 40 06 00 mov.b #6, &0x0026 ;#0x0006
  128. c0ea: 26 00
  129. P1SEL2 = RXD + TXD;
  130. c0ec: f2 40 06 00 mov.b #6, &0x0041 ;#0x0006
  131. c0f0: 41 00
  132. UCA0CTL1 |= UCSSEL_2; // SMCLK
  133. c0f2: f2 d0 80 ff bis.b #-128, &0x0061 ;#0xff80
  134. c0f6: 61 00
  135. UCA0BR0 = 104; // 1MHz 9600
  136. c0f8: f2 40 68 00 mov.b #104, &0x0062 ;#0x0068
  137. c0fc: 62 00
  138. UCA0BR1 = 0; // 1MHz 9600
  139. c0fe: c2 43 63 00 mov.b #0, &0x0063 ;r3 As==00
  140. UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1
  141. c102: e2 43 64 00 mov.b #2, &0x0064 ;r3 As==10
  142. UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine
  143. c106: f2 f0 fe ff and.b #-2, &0x0061 ;#0xfffe
  144. c10a: 61 00
  145. IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
  146. c10c: d2 d3 01 00 bis.b #1, &0x0001 ;r3 As==01
  147. }
  148. c110: 30 41 ret
  149. 0000c112 <uart_set_rx_isr_ptr>:
  150. void uart_set_rx_isr_ptr(void (*isr_ptr)(unsigned char c))
  151. {
  152. uart_rx_isr_ptr = isr_ptr;
  153. c112: 82 4f 00 02 mov r15, &0x0200
  154. }
  155. c116: 30 41 ret
  156. 0000c118 <uart_getc>:
  157. unsigned char uart_getc()
  158. {
  159. while (!(IFG2&UCA0RXIFG)); // USCI_A0 RX buffer ready?
  160. c118: 5f 42 03 00 mov.b &0x0003,r15
  161. c11c: 1f f3 and #1, r15 ;r3 As==01
  162. c11e: fc 27 jz $-6 ;abs 0xc118
  163. return UCA0RXBUF;
  164. c120: 5f 42 66 00 mov.b &0x0066,r15
  165. }
  166. c124: 30 41 ret
  167. 0000c126 <uart_putc>:
  168. void uart_putc(unsigned char c)
  169. {
  170. while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
  171. c126: 5e 42 03 00 mov.b &0x0003,r14
  172. c12a: 2e f3 and #2, r14 ;r3 As==10
  173. c12c: fc 27 jz $-6 ;abs 0xc126
  174. UCA0TXBUF = c; // TX
  175. c12e: c2 4f 67 00 mov.b r15, &0x0067
  176. }
  177. c132: 30 41 ret
  178. 0000c134 <uart_puts>:
  179. void uart_puts(const char *str)
  180. {
  181. c134: 0b 12 push r11
  182. c136: 0b 4f mov r15, r11
  183. while(*str) uart_putc(*str++);
  184. c138: 03 3c jmp $+8 ;abs 0xc140
  185. c13a: 1b 53 inc r11
  186. c13c: b0 12 26 c1 call #0xc126
  187. c140: 6f 4b mov.b @r11, r15
  188. c142: 4f 93 tst.b r15
  189. c144: fa 23 jnz $-10 ;abs 0xc13a
  190. }
  191. c146: 3b 41 pop r11
  192. c148: 30 41 ret
  193. 0000c14a <USCI0RX_ISR>:
  194. interrupt(USCIAB0RX_VECTOR) USCI0RX_ISR(void)
  195. {
  196. c14a: 0f 12 push r15
  197. c14c: 0e 12 push r14
  198. c14e: 0d 12 push r13
  199. c150: 0c 12 push r12
  200. if(uart_rx_isr_ptr != 0L) {
  201. c152: 1e 42 00 02 mov &0x0200,r14
  202. c156: 0e 93 tst r14
  203. c158: 03 24 jz $+8 ;abs 0xc160
  204. (uart_rx_isr_ptr)(UCA0RXBUF);
  205. c15a: 5f 42 66 00 mov.b &0x0066,r15
  206. c15e: 8e 12 call r14
  207. }
  208. }
  209. c160: 3c 41 pop r12
  210. c162: 3d 41 pop r13
  211. c164: 3e 41 pop r14
  212. c166: 3f 41 pop r15
  213. c168: 00 13 reti
  214. 0000c16a <_unexpected_>:
  215. c16a: 00 13 reti
  216. Disassembly of section .vectors:
  217. 0000ffe0 <__ivtbl_16>:
  218. ffe0: d4 c0 d4 c0 d4 c0 d4 c0 d4 c0 d4 c0 d4 c0 4a c1 ..............J.
  219. fff0: d4 c0 d4 c0 d4 c0 d4 c0 d4 c0 d4 c0 d4 c0 00 c0 ................