![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
stellaris? lm3s1p51 microcontroller data sheet copyright ? 2007-2011 texas instruments incorporated ds-lm3s1p51-9538 texas instruments-advance information
copyright copyright ? 2007-2011 texas instruments incorporated all rights reserved. stellaris and stellarisware are registered trademarks of texas instruments incorporated. arm and thumb are registered trademarks and cortex is a trademark of arm limited. other names and brands may be claimed as the property of others. advance information concerns new products in the sampling or preproduction phase of development. characteristic data and other specifcations are subject to change without notice. please be aware that an important notice concerning availability, standard warranty, and use in critical applications of texas instruments semiconductor products and disclaimers thereto appears at the end of this data sheet. texas instruments incorporated 108 wild basin, suite 350 austin, tx 78746 http://www.ti.com/stellaris http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm march 20, 2011 2 texas instruments-advance information table of contents revision history ............................................................................................................................. 28 about this document .................................................................................................................... 35 audience .............................................................................................................................................. 35 about this manual ................................................................................................................................ 35 related documents ............................................................................................................................... 35 documentation conventions .................................................................................................................. 36 1 architectural overview .......................................................................................... 38 1.1 functional overview ...................................................................................................... 40 1.1.1 arm cortex-m3 ............................................................................................................ 40 1.1.2 on-chip memory ........................................................................................................... 42 1.1.3 serial communications peripherals ................................................................................ 43 1.1.4 system integration ........................................................................................................ 47 1.1.5 advanced motion control ............................................................................................... 52 1.1.6 analog .......................................................................................................................... 54 1.1.7 jtag and arm serial wire debug ................................................................................ 56 1.1.8 packaging and temperature .......................................................................................... 56 1.2 target applications ........................................................................................................ 56 1.3 high-level block diagram ............................................................................................. 57 1.4 hardware details .......................................................................................................... 59 2 the cortex-m3 processor ...................................................................................... 60 2.1 block diagram .............................................................................................................. 61 2.2 overview ...................................................................................................................... 62 2.2.1 system-level interface .................................................................................................. 62 2.2.2 integrated configurable debug ...................................................................................... 62 2.2.3 trace port interface unit (tpiu) ..................................................................................... 63 2.2.4 cortex-m3 system component details ........................................................................... 63 2.3 programming model ...................................................................................................... 64 2.3.1 processor mode and privilege levels for software execution ........................................... 64 2.3.2 stacks .......................................................................................................................... 64 2.3.3 register map ................................................................................................................ 65 2.3.4 register descriptions .................................................................................................... 66 2.3.5 exceptions and interrupts .............................................................................................. 79 2.3.6 data types ................................................................................................................... 79 2.4 memory model .............................................................................................................. 79 2.4.1 memory regions, types and attributes ........................................................................... 81 2.4.2 memory system ordering of memory accesses .............................................................. 81 2.4.3 behavior of memory accesses ....................................................................................... 82 2.4.4 software ordering of memory accesses ......................................................................... 82 2.4.5 bit-banding ................................................................................................................... 84 2.4.6 data storage ................................................................................................................ 86 2.4.7 synchronization primitives ............................................................................................. 86 2.5 exception model ........................................................................................................... 87 2.5.1 exception states ........................................................................................................... 88 2.5.2 exception types ............................................................................................................ 88 2.5.3 exception handlers ....................................................................................................... 91 3 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller 2.5.4 vector table .................................................................................................................. 92 2.5.5 exception priorities ....................................................................................................... 93 2.5.6 interrupt priority grouping .............................................................................................. 93 2.5.7 exception entry and return ........................................................................................... 93 2.6 fault handling .............................................................................................................. 95 2.6.1 fault types ................................................................................................................... 96 2.6.2 fault escalation and hard faults .................................................................................... 96 2.6.3 fault status registers and fault address registers ........................................................ 97 2.6.4 lockup ......................................................................................................................... 97 2.7 power management ...................................................................................................... 97 2.7.1 entering sleep modes ................................................................................................... 98 2.7.2 wake up from sleep mode ............................................................................................ 98 2.8 instruction set summary ............................................................................................... 99 3 cortex-m3 peripherals ......................................................................................... 103 3.1 functional description ................................................................................................. 103 3.1.1 system timer (systick) ............................................................................................... 103 3.1.2 nested vectored interrupt controller (nvic) .................................................................. 104 3.1.3 system control block (scb) ........................................................................................ 106 3.1.4 memory protection unit (mpu) ..................................................................................... 106 3.2 register map .............................................................................................................. 111 3.3 system timer (systick) register descriptions .............................................................. 113 3.4 nvic register descriptions .......................................................................................... 117 3.5 system control block (scb) register descriptions ........................................................ 130 3.6 memory protection unit (mpu) register descriptions .................................................... 159 4 jtag interface ...................................................................................................... 169 4.1 block diagram ............................................................................................................ 170 4.2 signal description ....................................................................................................... 170 4.3 functional description ................................................................................................. 171 4.3.1 jtag interface pins ..................................................................................................... 171 4.3.2 jtag tap controller ................................................................................................... 173 4.3.3 shift registers ............................................................................................................ 173 4.3.4 operational considerations .......................................................................................... 174 4.4 initialization and configuration ..................................................................................... 176 4.5 register descriptions .................................................................................................. 177 4.5.1 instruction register (ir) ............................................................................................... 177 4.5.2 data registers ............................................................................................................ 179 5 system control ..................................................................................................... 181 5.1 signal description ....................................................................................................... 181 5.2 functional description ................................................................................................. 181 5.2.1 device identification .................................................................................................... 182 5.2.2 reset control .............................................................................................................. 182 5.2.3 non-maskable interrupt ............................................................................................... 187 5.2.4 power control ............................................................................................................. 187 5.2.5 clock control .............................................................................................................. 188 5.2.6 system control ........................................................................................................... 195 5.3 initialization and configuration ..................................................................................... 197 5.4 register map .............................................................................................................. 197 5.5 register descriptions .................................................................................................. 199 march 20, 2011 4 texas instruments-advance information table of contents 6 hibernation module .............................................................................................. 282 6.1 block diagram ............................................................................................................ 283 6.2 signal description ....................................................................................................... 283 6.3 functional description ................................................................................................. 284 6.3.1 register access timing ............................................................................................... 285 6.3.2 hibernation clock source ............................................................................................ 285 6.3.3 battery management ................................................................................................... 287 6.3.4 real-time clock .......................................................................................................... 287 6.3.5 non-volatile memory ................................................................................................... 288 6.3.6 power control using hib ............................................................................................. 288 6.3.7 power control using vdd3on mode ........................................................................... 288 6.3.8 initiating hibernate ...................................................................................................... 288 6.3.9 interrupts and status ................................................................................................... 289 6.4 initialization and configuration ..................................................................................... 289 6.4.1 initialization ................................................................................................................. 289 6.4.2 rtc match functionality (no hibernation) .................................................................... 290 6.4.3 rtc match/wake-up from hibernation ......................................................................... 290 6.4.4 external wake-up from hibernation .............................................................................. 291 6.4.5 rtc or external wake-up from hibernation .................................................................. 291 6.4.6 register reset ............................................................................................................ 291 6.5 register map .............................................................................................................. 292 6.6 register descriptions .................................................................................................. 293 7 internal memory ................................................................................................... 310 7.1 block diagram ............................................................................................................ 310 7.2 functional description ................................................................................................. 310 7.2.1 sram ........................................................................................................................ 311 7.2.2 rom .......................................................................................................................... 311 7.2.3 flash memory ............................................................................................................. 313 7.3 register map .............................................................................................................. 317 7.4 flash memory register descriptions (flash control offset) ............................................ 318 7.5 memory register descriptions (system control offset) .................................................. 330 8 micro direct memory access (dma) ................................................................ 346 8.1 block diagram ............................................................................................................ 347 8.2 functional description ................................................................................................. 347 8.2.1 channel assignments .................................................................................................. 348 8.2.2 priority ........................................................................................................................ 349 8.2.3 arbitration size ............................................................................................................ 349 8.2.4 request types ............................................................................................................ 349 8.2.5 channel configuration ................................................................................................. 350 8.2.6 transfer modes ........................................................................................................... 352 8.2.7 transfer size and increment ........................................................................................ 360 8.2.8 peripheral interface ..................................................................................................... 360 8.2.9 software request ........................................................................................................ 360 8.2.10 interrupts and errors .................................................................................................... 361 8.3 initialization and configuration ..................................................................................... 361 8.3.1 module initialization ..................................................................................................... 361 8.3.2 configuring a memory-to-memory transfer ................................................................... 361 8.3.3 configuring a peripheral for simple transmit ................................................................ 363 5 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller 8.3.4 configuring a peripheral for ping-pong receive ............................................................ 364 8.3.5 configuring channel assignments ................................................................................ 367 8.4 register map .............................................................................................................. 367 8.5 dma channel control structure ................................................................................. 368 8.6 dma register descriptions ........................................................................................ 375 9 general-purpose input/outputs (gpios) ........................................................... 404 9.1 signal description ....................................................................................................... 404 9.2 functional description ................................................................................................. 409 9.2.1 data control ............................................................................................................... 410 9.2.2 interrupt control .......................................................................................................... 411 9.2.3 mode control .............................................................................................................. 412 9.2.4 commit control ........................................................................................................... 412 9.2.5 pad control ................................................................................................................. 413 9.2.6 identification ............................................................................................................... 413 9.3 initialization and configuration ..................................................................................... 413 9.4 register map .............................................................................................................. 414 9.5 register descriptions .................................................................................................. 417 10 general-purpose timers ...................................................................................... 460 10.1 block diagram ............................................................................................................ 461 10.2 signal description ....................................................................................................... 461 10.3 functional description ................................................................................................. 464 10.3.1 gptm reset conditions .............................................................................................. 465 10.3.2 timer modes ............................................................................................................... 465 10.3.3 dma operation ........................................................................................................... 470 10.3.4 accessing concatenated register values ..................................................................... 471 10.4 initialization and configuration ..................................................................................... 471 10.4.1 one-shot/periodic timer mode .................................................................................... 471 10.4.2 real-time clock (rtc) mode ...................................................................................... 472 10.4.3 input edge-count mode ............................................................................................... 472 10.4.4 input edge timing mode .............................................................................................. 473 10.4.5 pwm mode ................................................................................................................. 473 10.5 register map .............................................................................................................. 474 10.6 register descriptions .................................................................................................. 475 11 watchdog timers ................................................................................................. 506 11.1 block diagram ............................................................................................................ 507 11.2 functional description ................................................................................................. 507 11.2.1 register access timing ............................................................................................... 508 11.3 initialization and configuration ..................................................................................... 508 11.4 register map .............................................................................................................. 508 11.5 register descriptions .................................................................................................. 509 12 analog-to-digital converter (adc) ..................................................................... 531 12.1 block diagram ............................................................................................................ 532 12.2 signal description ....................................................................................................... 533 12.3 functional description ................................................................................................. 535 12.3.1 sample sequencers .................................................................................................... 535 12.3.2 module control ............................................................................................................ 536 12.3.3 hardware sample averaging circuit ............................................................................. 538 march 20, 2011 6 texas instruments-advance information table of contents 12.3.4 analog-to-digital converter .......................................................................................... 539 12.3.5 differential sampling ................................................................................................... 541 12.3.6 internal temperature sensor ........................................................................................ 544 12.3.7 digital comparator unit ............................................................................................... 544 12.4 initialization and configuration ..................................................................................... 549 12.4.1 module initialization ..................................................................................................... 549 12.4.2 sample sequencer configuration ................................................................................. 550 12.5 register map .............................................................................................................. 550 12.6 register descriptions .................................................................................................. 552 13 universal asynchronous receivers/transmitters (uarts) ............................. 610 13.1 block diagram ............................................................................................................ 611 13.2 signal description ....................................................................................................... 611 13.3 functional description ................................................................................................. 613 13.3.1 transmit/receive logic ............................................................................................... 613 13.3.2 baud-rate generation ................................................................................................. 614 13.3.3 data transmission ...................................................................................................... 615 13.3.4 serial ir (sir) ............................................................................................................. 615 13.3.5 iso 7816 support ....................................................................................................... 616 13.3.6 modem handshake support ......................................................................................... 616 13.3.7 lin support ................................................................................................................ 618 13.3.8 fifo operation ........................................................................................................... 619 13.3.9 interrupts .................................................................................................................... 619 13.3.10 loopback operation .................................................................................................... 620 13.3.11 dma operation ........................................................................................................... 620 13.4 initialization and configuration ..................................................................................... 621 13.5 register map .............................................................................................................. 622 13.6 register descriptions .................................................................................................. 623 14 synchronous serial interface (ssi) .................................................................... 671 14.1 block diagram ............................................................................................................ 672 14.2 signal description ....................................................................................................... 672 14.3 functional description ................................................................................................. 673 14.3.1 bit rate generation ..................................................................................................... 674 14.3.2 fifo operation ........................................................................................................... 674 14.3.3 interrupts .................................................................................................................... 674 14.3.4 frame formats ........................................................................................................... 675 14.3.5 dma operation ........................................................................................................... 683 14.4 initialization and configuration ..................................................................................... 683 14.5 register map .............................................................................................................. 685 14.6 register descriptions .................................................................................................. 686 15 inter-integrated circuit (i 2 c) interface ................................................................ 714 15.1 block diagram ............................................................................................................ 715 15.2 signal description ....................................................................................................... 715 15.3 functional description ................................................................................................. 716 15.3.1 i 2 c bus functional overview ........................................................................................ 716 15.3.2 available speed modes ............................................................................................... 718 15.3.3 interrupts .................................................................................................................... 719 15.3.4 loopback operation .................................................................................................... 720 15.3.5 command sequence flow charts ................................................................................ 721 7 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller 15.4 initialization and configuration ..................................................................................... 728 15.5 register map .............................................................................................................. 729 15.6 register descriptions (i 2 c master) ............................................................................... 730 15.7 register descriptions (i 2 c slave) ................................................................................. 742 16 inter-integrated circuit sound (i 2 s) interface .................................................... 751 16.1 block diagram ............................................................................................................ 752 16.2 signal description ....................................................................................................... 752 16.3 functional description ................................................................................................. 754 16.3.1 transmit ..................................................................................................................... 755 16.3.2 receive ...................................................................................................................... 759 16.4 initialization and configuration ..................................................................................... 761 16.5 register map .............................................................................................................. 762 16.6 register descriptions .................................................................................................. 763 17 analog comparators ............................................................................................ 787 17.1 block diagram ............................................................................................................ 787 17.2 signal description ....................................................................................................... 788 17.3 functional description ................................................................................................. 789 17.3.1 internal reference programming .................................................................................. 789 17.4 initialization and configuration ..................................................................................... 791 17.5 register map .............................................................................................................. 791 17.6 register descriptions .................................................................................................. 792 18 pulse width modulator (pwm) ............................................................................ 800 18.1 block diagram ............................................................................................................ 801 18.2 signal description ....................................................................................................... 802 18.3 functional description ................................................................................................. 805 18.3.1 pwm timer ................................................................................................................. 805 18.3.2 pwm comparators ...................................................................................................... 805 18.3.3 pwm signal generator ................................................................................................ 807 18.3.4 dead-band generator ................................................................................................. 808 18.3.5 interrupt/adc-trigger selector ..................................................................................... 808 18.3.6 synchronization methods ............................................................................................ 808 18.3.7 fault conditions .......................................................................................................... 809 18.3.8 output control block ................................................................................................... 810 18.4 initialization and configuration ..................................................................................... 811 18.5 register map .............................................................................................................. 811 18.6 register descriptions .................................................................................................. 814 19 quadrature encoder interface (qei) ................................................................... 873 19.1 block diagram ............................................................................................................ 873 19.2 signal description ....................................................................................................... 874 19.3 functional description ................................................................................................. 875 19.4 initialization and configuration ..................................................................................... 878 19.5 register map .............................................................................................................. 878 19.6 register descriptions .................................................................................................. 879 20 pin diagram .......................................................................................................... 896 21 signal tables ........................................................................................................ 898 21.1 100-pin lqfp package pin tables ............................................................................... 899 21.2 108-pin bga package pin tables ................................................................................ 930 march 20, 2011 8 texas instruments-advance information table of contents 21.3 connections for unused signals ................................................................................... 961 22 operating characteristics ................................................................................... 963 23 electrical characteristics .................................................................................... 964 23.1 dc characteristics ...................................................................................................... 964 23.1.1 maximum ratings ....................................................................................................... 964 23.1.2 recommended dc operating conditions ...................................................................... 964 23.1.3 on-chip low drop-out (ldo) regulator characteristics ................................................ 965 23.1.4 hibernation module characteristics .............................................................................. 965 23.1.5 flash memory characteristics ...................................................................................... 965 23.1.6 gpio module characteristics ....................................................................................... 966 23.1.7 current specifications .................................................................................................. 966 23.2 ac characteristics ....................................................................................................... 970 23.2.1 load conditions .......................................................................................................... 970 23.2.2 clocks ........................................................................................................................ 970 23.2.3 power and brown-out characteristics ........................................................................... 973 23.2.4 jtag and boundary scan ............................................................................................ 975 23.2.5 reset ......................................................................................................................... 976 23.2.6 sleep modes ............................................................................................................... 977 23.2.7 hibernation module ..................................................................................................... 978 23.2.8 general-purpose i/o (gpio) ........................................................................................ 979 23.2.9 analog-to-digital converter (adc) ................................................................................ 980 23.2.10 synchronous serial interface (ssi) ............................................................................... 981 23.2.11 inter-integrated circuit (i 2 c) interface ........................................................................... 983 23.2.12 inter-integrated circuit sound (i 2 s) interface ................................................................. 984 23.2.13 analog comparator ..................................................................................................... 985 a register quick reference ................................................................................... 987 b ordering and contact information ................................................................... 1017 b.1 ordering information .................................................................................................. 1017 b.2 part markings ............................................................................................................ 1017 b.3 kits ........................................................................................................................... 1018 b.4 support information ................................................................................................... 1018 c package information .......................................................................................... 1019 c.1 100-pin lqfp package ............................................................................................. 1019 c.1.1 package dimensions ................................................................................................. 1019 c.1.2 tray dimensions ....................................................................................................... 1021 c.1.3 tape and reel dimensions ........................................................................................ 1021 c.2 108-ball bga package .............................................................................................. 1023 c.2.1 package dimensions ................................................................................................. 1023 c.2.2 tray dimensions ....................................................................................................... 1025 c.2.3 tape and reel dimensions ........................................................................................ 1026 9 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller list of figures figure 1-1. stellaris lm3s1p51 microcontroller high-level block diagram .............................. 58 figure 2-1. cpu block diagram ............................................................................................. 62 figure 2-2. tpiu block diagram ............................................................................................ 63 figure 2-3. cortex-m3 register set ........................................................................................ 65 figure 2-4. bit-band mapping ................................................................................................ 85 figure 2-5. data storage ....................................................................................................... 86 figure 2-6. vector table ......................................................................................................... 92 figure 2-7. exception stack frame ........................................................................................ 94 figure 3-1. srd use example ............................................................................................. 109 figure 4-1. jtag module block diagram .............................................................................. 170 figure 4-2. test access port state machine ......................................................................... 173 figure 4-3. idcode register format ................................................................................... 179 figure 4-4. bypass register format ................................................................................... 179 figure 4-5. boundary scan register format ......................................................................... 180 figure 5-1. basic rst configuration .................................................................................... 184 figure 5-2. external circuitry to extend power-on reset ....................................................... 184 figure 5-3. reset circuit controlled by switch ...................................................................... 185 figure 5-4. power architecture ............................................................................................ 188 figure 5-5. main clock tree ................................................................................................ 191 figure 6-1. hibernation module block diagram ..................................................................... 283 figure 6-2. using a crystal as the hibernation clock source ................................................. 286 figure 6-3. using a dedicated oscillator as the hibernation clock source with vdd3on mode ................................................................................................................ 286 figure 7-1. internal memory block diagram .......................................................................... 310 figure 8-1. dma block diagram ......................................................................................... 347 figure 8-2. example of ping-pong dma transaction ........................................................... 353 figure 8-3. memory scatter-gather, setup and configuration ................................................ 355 figure 8-4. memory scatter-gather, dma copy sequence .................................................. 356 figure 8-5. peripheral scatter-gather, setup and configuration ............................................. 358 figure 8-6. peripheral scatter-gather, dma copy sequence ............................................... 359 figure 9-1. digital i/o pads ................................................................................................. 409 figure 9-2. analog/digital i/o pads ...................................................................................... 410 figure 9-3. gpiodata write example ................................................................................. 411 figure 9-4. gpiodata read example ................................................................................. 411 figure 10-1. gptm module block diagram ............................................................................ 461 figure 10-2. timer daisy chain ............................................................................................. 467 figure 10-3. input edge-count mode example ....................................................................... 468 figure 10-4. 16-bit input edge-time mode example ............................................................... 469 figure 10-5. 16-bit pwm mode example ................................................................................ 470 figure 11-1. wdt module block diagram .............................................................................. 507 figure 12-1. implementation of two adc blocks .................................................................... 532 figure 12-2. adc module block diagram ............................................................................... 533 figure 12-3. adc sample phases ......................................................................................... 537 figure 12-4. doubling the adc sample rate .......................................................................... 538 figure 12-5. skewed sampling .............................................................................................. 538 figure 12-6. sample averaging example ............................................................................... 539 march 20, 2011 10 texas instruments-advance information table of contents figure 12-7. internal voltage conversion result ..................................................................... 540 figure 12-8. external voltage conversion result .................................................................... 541 figure 12-9. differential sampling range, v in_odd = 1.5 v ...................................................... 542 figure 12-10. differential sampling range, v in_odd = 0.75 v .................................................... 543 figure 12-11. differential sampling range, v in_odd = 2.25 v .................................................... 543 figure 12-12. internal temperature sensor characteristic ......................................................... 544 figure 12-13. low-band operation (cic=0x0 and/or ctc=0x0) ................................................ 547 figure 12-14. mid-band operation (cic=0x1 and/or ctc=0x1) ................................................. 548 figure 12-15. high-band operation (cic=0x3 and/or ctc=0x3) ................................................ 549 figure 13-1. uart module block diagram ............................................................................. 611 figure 13-2. uart character frame ..................................................................................... 614 figure 13-3. irda data modulation ......................................................................................... 616 figure 13-4. lin message ..................................................................................................... 618 figure 13-5. lin synchronization field ................................................................................... 619 figure 14-1. ssi module block diagram ................................................................................. 672 figure 14-2. ti synchronous serial frame format (single transfer) ........................................ 676 figure 14-3. ti synchronous serial frame format (continuous transfer) ................................ 677 figure 14-4. freescale spi format (single transfer) with spo=0 and sph=0 .......................... 677 figure 14-5. freescale spi format (continuous transfer) with spo=0 and sph=0 .................. 678 figure 14-6. freescale spi frame format with spo=0 and sph=1 ......................................... 679 figure 14-7. freescale spi frame format (single transfer) with spo=1 and sph=0 ............... 679 figure 14-8. freescale spi frame format (continuous transfer) with spo=1 and sph=0 ........ 680 figure 14-9. freescale spi frame format with spo=1 and sph=1 ......................................... 681 figure 14-10. microwire frame format (single frame) ........................................................ 681 figure 14-11. microwire frame format (continuous transfer) ............................................. 682 figure 14-12. microwire frame format, ssifss input setup and hold requirements ............ 683 figure 15-1. i 2 c block diagram ............................................................................................. 715 figure 15-2. i 2 c bus configuration ........................................................................................ 716 figure 15-3. start and stop conditions ............................................................................. 717 figure 15-4. complete data transfer with a 7-bit address ....................................................... 717 figure 15-5. r/s bit in first byte ............................................................................................ 718 figure 15-6. data validity during bit transfer on the i 2 c bus ................................................... 718 figure 15-7. master single transmit .................................................................................. 722 figure 15-8. master single receive ..................................................................................... 723 figure 15-9. master transmit with repeated start ........................................................... 724 figure 15-10. master receive with repeated start ............................................................. 725 figure 15-11. master receive with repeated start after transmit with repeated start .............................................................................................................. 726 figure 15-12. master transmit with repeated start after receive with repeated start .............................................................................................................. 727 figure 15-13. slave command sequence ................................................................................ 728 figure 16-1. i 2 s block diagram ............................................................................................. 752 figure 16-2. i 2 s data transfer ............................................................................................... 755 figure 16-3. left-justified data transfer ................................................................................ 755 figure 16-4. right-justified data transfer .............................................................................. 755 figure 17-1. analog comparator module block diagram ......................................................... 787 figure 17-2. structure of comparator unit .............................................................................. 789 figure 17-3. comparator internal reference structure ............................................................ 790 11 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller figure 18-1. pwm module diagram ....................................................................................... 802 figure 18-2. pwm generator block diagram .......................................................................... 802 figure 18-3. pwm count-down mode .................................................................................... 806 figure 18-4. pwm count-up/down mode .............................................................................. 807 figure 18-5. pwm generation example in count-up/down mode ........................................... 807 figure 18-6. pwm dead-band generator ............................................................................... 808 figure 19-1. qei block diagram ............................................................................................ 874 figure 19-2. quadrature encoder and velocity predivider operation ........................................ 877 figure 20-1. 100-pin lqfp package pin diagram .................................................................. 896 figure 20-2. 108-ball bga package pin diagram (top view) ................................................... 897 figure 23-1. typical current across frequency, pll bypassed ............................................... 969 figure 23-2. typical current across frequency, using pll ..................................................... 970 figure 23-3. load conditions ................................................................................................ 970 figure 23-4. power-on reset timing ..................................................................................... 973 figure 23-5. brown-out reset timing .................................................................................... 974 figure 23-6. power-on reset and voltage parameters ........................................................... 974 figure 23-7. voltage requirements when using an external v ddc source ............................... 975 figure 23-8. jtag test clock input timing ............................................................................. 976 figure 23-9. jtag test access port (tap) timing .................................................................. 976 figure 23-10. external reset timing (rst ) .............................................................................. 977 figure 23-11. software reset timing ....................................................................................... 977 figure 23-12. watchdog reset timing ..................................................................................... 977 figure 23-13. mosc failure reset timing ............................................................................... 977 figure 23-14. hibernation module timing with internal oscillator running in hibernation ............ 978 figure 23-15. hibernation module timing with internal oscillator stopped in hibernation ............ 979 figure 23-16. vdd ramp when waking from hibernation ......................................................... 979 figure 23-17. adc input equivalency diagram ......................................................................... 981 figure 23-18. ssi timing for ti frame format (frf=01), single transfer timing measurement .................................................................................................... 982 figure 23-19. ssi timing for microwire frame format (frf=10), single transfer ................. 982 figure 23-20. ssi timing for spi frame format (frf=00), with sph=1 ..................................... 983 figure 23-21. i 2 c timing ......................................................................................................... 984 figure 23-22. i 2 s master mode transmit timing ....................................................................... 984 figure 23-23. i 2 s master mode receive timing ........................................................................ 985 figure 23-24. i 2 s slave mode transmit timing ......................................................................... 985 figure 23-25. i 2 s slave mode receive timing .......................................................................... 985 figure c-1. 100-pin lqfp package dimensions ................................................................. 1019 figure c-2. 100-pin lqfp tray dimensions ........................................................................ 1021 figure c-3. 100-pin lqfp tape and reel dimensions ......................................................... 1022 figure c-4. 108-ball bga package dimensions .................................................................. 1023 figure c-5. 108-ball bga tray dimensions ......................................................................... 1025 figure c-6. 108-ball bga tape and reel dimensions .......................................................... 1026 march 20, 2011 12 texas instruments-advance information table of contents list of tables table 1. revision history .................................................................................................. 28 table 2. documentation conventions ................................................................................ 36 table 2-1. summary of processor mode, privilege level, and stack use ................................ 65 table 2-2. processor register map ....................................................................................... 66 table 2-3. psr register combinations ................................................................................. 71 table 2-4. memory map ....................................................................................................... 79 table 2-5. memory access behavior ..................................................................................... 82 table 2-6. sram memory bit-banding regions .................................................................... 84 table 2-7. peripheral memory bit-banding regions ............................................................... 84 table 2-8. exception types .................................................................................................. 90 table 2-9. interrupts ............................................................................................................ 90 table 2-10. exception return behavior ................................................................................... 95 table 2-11. faults ................................................................................................................. 96 table 2-12. fault status and fault address registers .............................................................. 97 table 2-13. cortex-m3 instruction summary ........................................................................... 99 table 3-1. core peripheral register regions ....................................................................... 103 table 3-2. memory attributes summary .............................................................................. 106 table 3-3. tex, s, c, and b bit field encoding ................................................................... 109 table 3-4. cache policy for memory attribute encoding ....................................................... 110 table 3-5. ap bit field encoding ........................................................................................ 110 table 3-6. memory region attributes for stellaris microcontrollers ........................................ 110 table 3-7. peripherals register map ................................................................................... 111 table 3-8. interrupt priority levels ...................................................................................... 138 table 3-9. example size field values ................................................................................ 166 table 4-1. signals for jtag_swd_swo (100lqfp) ........................................................... 170 table 4-2. signals for jtag_swd_swo (108bga) ............................................................ 171 table 4-3. jtag port pins state after power-on reset or rst assertion .............................. 172 table 4-4. jtag instruction register commands ................................................................. 177 table 5-1. signals for system control & clocks (100lqfp) .................................................. 181 table 5-2. signals for system control & clocks (108bga) ................................................... 181 table 5-3. reset sources ................................................................................................... 182 table 5-4. clock source options ........................................................................................ 189 table 5-5. possible system clock frequencies using the sysdiv field ............................... 192 table 5-6. examples of possible system clock frequencies using the sysdiv2 field .......... 192 table 5-7. examples of possible system clock frequencies with div400=1 ......................... 193 table 5-8. system control register map ............................................................................. 198 table 5-9. rcc2 fields that override rcc fields ............................................................... 218 table 6-1. signals for hibernate (100lqfp) ........................................................................ 283 table 6-2. signals for hibernate (108bga) .......................................................................... 284 table 6-3. hibernation module clock operation ................................................................... 290 table 6-4. hibernation module register map ....................................................................... 292 table 7-1. flash memory protection policy combinations .................................................... 314 table 7-2. user-programmable flash memory resident registers ....................................... 317 table 7-3. flash register map ............................................................................................ 318 table 8-1. dma channel assignments .............................................................................. 348 table 8-2. request type support ....................................................................................... 350 13 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller table 8-3. control structure memory map ........................................................................... 351 table 8-4. channel control structure .................................................................................. 351 table 8-5. dma read example: 8-bit peripheral ................................................................ 360 table 8-6. dma interrupt assignments .............................................................................. 361 table 8-7. channel control structure offsets for channel 30 ................................................ 362 table 8-8. channel control word configuration for memory transfer example ...................... 362 table 8-9. channel control structure offsets for channel 7 .................................................. 363 table 8-10. channel control word configuration for peripheral transmit example .................. 364 table 8-11. primary and alternate channel control structure offsets for channel 8 ................. 365 table 8-12. channel control word configuration for peripheral ping-pong receive example ............................................................................................................ 366 table 8-13. dma register map .......................................................................................... 367 table 9-1. gpio pins with non-zero reset values .............................................................. 405 table 9-2. gpio pins and alternate functions (100lqfp) ................................................... 405 table 9-3. gpio pins and alternate functions (108bga) ..................................................... 407 table 9-4. gpio pad configuration examples ..................................................................... 413 table 9-5. gpio interrupt configuration example ................................................................ 414 table 9-6. gpio pins with non-zero reset values .............................................................. 415 table 9-7. gpio register map ........................................................................................... 415 table 9-8. gpio pins with non-zero reset values .............................................................. 428 table 9-9. gpio pins with non-zero reset values .............................................................. 434 table 9-10. gpio pins with non-zero reset values .............................................................. 436 table 9-11. gpio pins with non-zero reset values .............................................................. 439 table 9-12. gpio pins with non-zero reset values .............................................................. 446 table 10-1. available ccp pins ............................................................................................ 461 table 10-2. signals for general-purpose timers (100lqfp) .................................................. 462 table 10-3. signals for general-purpose timers (108bga) .................................................... 463 table 10-4. general-purpose timer capabilities .................................................................... 464 table 10-5. 16-bit timer with prescaler configurations ......................................................... 466 table 10-6. timers register map .......................................................................................... 474 table 11-1. watchdog timers register map .......................................................................... 509 table 12-1. signals for adc (100lqfp) ............................................................................... 533 table 12-2. signals for adc (108bga) ................................................................................. 534 table 12-3. samples and fifo depth of sequencers ............................................................ 535 table 12-4. differential sampling pairs ................................................................................. 541 table 12-5. adc register map ............................................................................................. 550 table 13-1. signals for uart (100lqfp) ............................................................................. 612 table 13-2. signals for uart (108bga) ............................................................................... 612 table 13-3. flow control mode ............................................................................................. 617 table 13-4. uart register map ........................................................................................... 622 table 14-1. signals for ssi (100lqfp) ................................................................................. 673 table 14-2. signals for ssi (108bga) ................................................................................... 673 table 14-3. ssi register map .............................................................................................. 685 table 15-1. signals for i2c (100lqfp) ................................................................................. 715 table 15-2. signals for i2c (108bga) ................................................................................... 715 table 15-3. examples of i 2 c master timer period versus speed mode ................................... 719 table 15-4. inter-integrated circuit (i 2 c) interface register map ............................................. 729 table 15-5. write field decoding for i2cmcs[3:0] field ......................................................... 734 march 20, 2011 14 texas instruments-advance information table of contents table 16-1. signals for i2s (100lqfp) ................................................................................. 753 table 16-2. signals for i2s (108bga) ................................................................................... 753 table 16-3. i 2 s transmit fifo interface ................................................................................ 756 table 16-4. crystal frequency (values from 3.5795 mhz to 5 mhz) ........................................ 757 table 16-5. crystal frequency (values from 5.12 mhz to 8.192 mhz) ..................................... 757 table 16-6. crystal frequency (values from 10 mhz to 14.3181 mhz) .................................... 758 table 16-7. crystal frequency (values from 16 mhz to 16.384 mhz) ...................................... 758 table 16-8. i 2 s receive fifo interface ................................................................................. 760 table 16-9. audio formats configuration .............................................................................. 762 table 16-10. inter-integrated circuit sound (i 2 s) interface register map ................................... 763 table 17-1. signals for analog comparators (100lqfp) ........................................................ 788 table 17-2. signals for analog comparators (108bga) .......................................................... 788 table 17-3. internal reference voltage and acrefctl field values ..................................... 790 table 17-4. analog comparators register map ..................................................................... 791 table 18-1. signals for pwm (100lqfp) .............................................................................. 803 table 18-2. signals for pwm (108bga) ................................................................................ 804 table 18-3. pwm register map ............................................................................................ 812 table 19-1. signals for qei (100lqfp) ................................................................................. 874 table 19-2. signals for qei (108bga) .................................................................................. 875 table 19-3. qei register map .............................................................................................. 879 table 21-1. gpio pins with default alternate functions ........................................................ 898 table 21-2. signals by pin number ....................................................................................... 899 table 21-3. signals by signal name ..................................................................................... 909 table 21-4. signals by function, except for gpio ................................................................. 917 table 21-5. gpio pins and alternate functions ..................................................................... 925 table 21-6. possible pin assignments for alternate functions ................................................ 928 table 21-7. signals by pin number ....................................................................................... 930 table 21-8. signals by signal name ..................................................................................... 940 table 21-9. signals by function, except for gpio ................................................................. 949 table 21-10. gpio pins and alternate functions ..................................................................... 956 table 21-11. possible pin assignments for alternate functions ................................................ 959 table 21-12. connections for unused signals (100-pin lqfp) ................................................. 961 table 21-13. connections for unused signals, 108-pin bga .................................................... 961 table 22-1. temperature characteristics ............................................................................... 963 table 22-2. thermal characteristics ..................................................................................... 963 table 22-3. esd absolute maximum ratings ........................................................................ 963 table 23-1. maximum ratings .............................................................................................. 964 table 23-2. recommended dc operating conditions ............................................................ 964 table 23-3. ldo regulator characteristics ........................................................................... 965 table 23-4. hibernation module dc characteristics ............................................................... 965 table 23-5. flash memory characteristics ............................................................................ 965 table 23-6. gpio module dc characteristics ........................................................................ 966 table 23-7. nominal power consumption ............................................................................. 966 table 23-8. detailed current specifications ........................................................................... 967 table 23-9. hibernation detailed current specifications ......................................................... 968 table 23-10. external v ddc source current specifications ....................................................... 968 table 23-11. current consumption vs. frequency, pll bypassed ............................................ 969 table 23-12. current consumption vs. frequency, using pll .................................................. 969 15 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller table 23-13. phase locked loop (pll) characteristics ........................................................... 971 table 23-14. actual pll frequency ........................................................................................ 971 table 23-15. piosc clock characteristics .............................................................................. 971 table 23-16. 30-khz clock characteristics .............................................................................. 972 table 23-17. hibernation clock characteristics ....................................................................... 972 table 23-18. hib oscillator input characteristics ..................................................................... 972 table 23-19. main oscillator clock characteristics .................................................................. 972 table 23-20. mosc oscillator input characteristics ................................................................ 973 table 23-21. system clock characteristics with adc operation ............................................... 973 table 23-22. power characteristics ........................................................................................ 973 table 23-23. jtag characteristics ......................................................................................... 975 table 23-24. reset characteristics ......................................................................................... 976 table 23-25. sleep modes ac characteristics ......................................................................... 977 table 23-26. hibernation module ac characteristics ............................................................... 978 table 23-27. gpio characteristics ......................................................................................... 979 table 23-28. adc characteristics ........................................................................................... 980 table 23-29. adc module external reference characteristics ................................................. 981 table 23-30. adc module internal reference characteristics .................................................. 981 table 23-31. ssi characteristics ............................................................................................ 981 table 23-32. i 2 c characteristics ............................................................................................. 983 table 23-33. i 2 s master clock (receive and transmit) ............................................................ 984 table 23-34. i 2 s slave clock (receive and transmit) .............................................................. 984 table 23-35. i 2 s master mode ................................................................................................ 984 table 23-36. i 2 s slave mode ................................................................................................. 985 table 23-37. analog comparator characteristics ..................................................................... 985 table 23-38. analog comparator voltage reference characteristics ........................................ 986 table b-1. part ordering information ................................................................................. 1017 march 20, 2011 16 texas instruments-advance information table of contents list of registers the cortex-m3 processor ............................................................................................................. 60 register 1: cortex general-purpose register 0 (r0) ........................................................................... 67 register 2: cortex general-purpose register 1 (r1) ........................................................................... 67 register 3: cortex general-purpose register 2 (r2) ........................................................................... 67 register 4: cortex general-purpose register 3 (r3) ........................................................................... 67 register 5: cortex general-purpose register 4 (r4) ........................................................................... 67 register 6: cortex general-purpose register 5 (r5) ........................................................................... 67 register 7: cortex general-purpose register 6 (r6) ........................................................................... 67 register 8: cortex general-purpose register 7 (r7) ........................................................................... 67 register 9: cortex general-purpose register 8 (r8) ........................................................................... 67 register 10: cortex general-purpose register 9 (r9) ........................................................................... 67 register 11: cortex general-purpose register 10 (r10) ....................................................................... 67 register 12: cortex general-purpose register 11 (r11) ........................................................................ 67 register 13: cortex general-purpose register 12 (r12) ....................................................................... 67 register 14: stack pointer (sp) ........................................................................................................... 68 register 15: link register (lr) ............................................................................................................ 69 register 16: program counter (pc) ..................................................................................................... 70 register 17: program status register (psr) ........................................................................................ 71 register 18: priority mask register (primask) .................................................................................... 75 register 19: fault mask register (faultmask) .................................................................................. 76 register 20: base priority mask register (basepri) ............................................................................ 77 register 21: control register (control) ........................................................................................... 78 cortex-m3 peripherals ................................................................................................................. 103 register 1: systick control and status register (stctrl), offset 0x010 ........................................... 114 register 2: systick reload value register (streload), offset 0x014 .............................................. 116 register 3: systick current value register (stcurrent), offset 0x018 ........................................... 117 register 4: interrupt 0-31 set enable (en0), offset 0x100 .................................................................. 118 register 5: interrupt 32-54 set enable (en1), offset 0x104 ................................................................ 119 register 6: interrupt 0-31 clear enable (dis0), offset 0x180 .............................................................. 120 register 7: interrupt 32-54 clear enable (dis1), offset 0x184 ............................................................ 121 register 8: interrupt 0-31 set pending (pend0), offset 0x200 ........................................................... 122 register 9: interrupt 32-54 set pending (pend1), offset 0x204 ......................................................... 123 register 10: interrupt 0-31 clear pending (unpend0), offset 0x280 ................................................... 124 register 11: interrupt 32-54 clear pending (unpend1), offset 0x284 .................................................. 125 register 12: interrupt 0-31 active bit (active0), offset 0x300 ............................................................. 126 register 13: interrupt 32-54 active bit (active1), offset 0x304 ........................................................... 127 register 14: interrupt 0-3 priority (pri0), offset 0x400 ......................................................................... 128 register 15: interrupt 4-7 priority (pri1), offset 0x404 ......................................................................... 128 register 16: interrupt 8-11 priority (pri2), offset 0x408 ....................................................................... 128 register 17: interrupt 12-15 priority (pri3), offset 0x40c .................................................................... 128 register 18: interrupt 16-19 priority (pri4), offset 0x410 ..................................................................... 128 register 19: interrupt 20-23 priority (pri5), offset 0x414 ..................................................................... 128 register 20: interrupt 24-27 priority (pri6), offset 0x418 ..................................................................... 128 register 21: interrupt 28-31 priority (pri7), offset 0x41c .................................................................... 128 register 22: interrupt 32-35 priority (pri8), offset 0x420 ..................................................................... 128 17 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller register 23: interrupt 36-39 priority (pri9), offset 0x424 ..................................................................... 128 register 24: interrupt 40-43 priority (pri10), offset 0x428 ................................................................... 128 register 25: interrupt 44-47 priority (pri11), offset 0x42c ................................................................... 128 register 26: interrupt 48-51 priority (pri12), offset 0x430 ................................................................... 128 register 27: interrupt 52-54 priority (pri13), offset 0x434 ................................................................... 128 register 28: software trigger interrupt (swtrig), offset 0xf00 .......................................................... 130 register 29: auxiliary control (actlr), offset 0x008 .......................................................................... 131 register 30: cpu id base (cpuid), offset 0xd00 ............................................................................... 133 register 31: interrupt control and state (intctrl), offset 0xd04 ........................................................ 134 register 32: vector table offset (vtable), offset 0xd08 .................................................................... 137 register 33: application interrupt and reset control (apint), offset 0xd0c ......................................... 138 register 34: system control (sysctrl), offset 0xd10 ....................................................................... 140 register 35: configuration and control (cfgctrl), offset 0xd14 ....................................................... 142 register 36: system handler priority 1 (syspri1), offset 0xd18 ......................................................... 144 register 37: system handler priority 2 (syspri2), offset 0xd1c ........................................................ 145 register 38: system handler priority 3 (syspri3), offset 0xd20 ......................................................... 146 register 39: system handler control and state (syshndctrl), offset 0xd24 .................................... 147 register 40: configurable fault status (faultstat), offset 0xd28 ..................................................... 151 register 41: hard fault status (hfaultstat), offset 0xd2c .............................................................. 157 register 42: memory management fault address (mmaddr), offset 0xd34 ........................................ 158 register 43: bus fault address (faultaddr), offset 0xd38 .............................................................. 159 register 44: mpu type (mputype), offset 0xd90 ............................................................................. 160 register 45: mpu control (mpuctrl), offset 0xd94 .......................................................................... 161 register 46: mpu region number (mpunumber), offset 0xd98 ....................................................... 163 register 47: mpu region base address (mpubase), offset 0xd9c ................................................... 164 register 48: mpu region base address alias 1 (mpubase1), offset 0xda4 ....................................... 164 register 49: mpu region base address alias 2 (mpubase2), offset 0xdac ...................................... 164 register 50: mpu region base address alias 3 (mpubase3), offset 0xdb4 ....................................... 164 register 51: mpu region attribute and size (mpuattr), offset 0xda0 ............................................... 166 register 52: mpu region attribute and size alias 1 (mpuattr1), offset 0xda8 .................................. 166 register 53: mpu region attribute and size alias 2 (mpuattr2), offset 0xdb0 .................................. 166 register 54: mpu region attribute and size alias 3 (mpuattr3), offset 0xdb8 .................................. 166 system control ............................................................................................................................ 181 register 1: device identification 0 (did0), offset 0x000 ..................................................................... 200 register 2: brown-out reset control (pborctl), offset 0x030 ........................................................ 202 register 3: raw interrupt status (ris), offset 0x050 .......................................................................... 203 register 4: interrupt mask control (imc), offset 0x054 ...................................................................... 205 register 5: masked interrupt status and clear (misc), offset 0x058 .................................................. 207 register 6: reset cause (resc), offset 0x05c ................................................................................ 209 register 7: run-mode clock configuration (rcc), offset 0x060 ......................................................... 211 register 8: xtal to pll translation (pllcfg), offset 0x064 ............................................................. 215 register 9: gpio high-performance bus control (gpiohbctl), offset 0x06c ................................... 216 register 10: run-mode clock configuration 2 (rcc2), offset 0x070 .................................................... 218 register 11: main oscillator control (moscctl), offset 0x07c ........................................................... 221 register 12: deep sleep clock configuration (dslpclkcfg), offset 0x144 ........................................ 222 register 13: precision internal oscillator calibration (piosccal), offset 0x150 ................................... 224 register 14: precision internal oscillator statistics (pioscstat), offset 0x154 .................................... 226 register 15: i 2 s mclk configuration (i2smclkcfg), offset 0x170 ..................................................... 227 march 20, 2011 18 texas instruments-advance information table of contents register 16: device identification 1 (did1), offset 0x004 ..................................................................... 229 register 17: device capabilities 0 (dc0), offset 0x008 ........................................................................ 231 register 18: device capabilities 1 (dc1), offset 0x010 ........................................................................ 232 register 19: device capabilities 2 (dc2), offset 0x014 ........................................................................ 234 register 20: device capabilities 3 (dc3), offset 0x018 ........................................................................ 236 register 21: device capabilities 4 (dc4), offset 0x01c ....................................................................... 238 register 22: device capabilities 5 (dc5), offset 0x020 ........................................................................ 240 register 23: device capabilities 6 (dc6), offset 0x024 ........................................................................ 242 register 24: device capabilities 7 (dc7), offset 0x028 ........................................................................ 243 register 25: device capabilities 8 adc channels (dc8), offset 0x02c ................................................ 247 register 26: device capabilities 9 adc digital comparators (dc9), offset 0x190 ................................. 249 register 27: non-volatile memory information (nvmstat), offset 0x1a0 ............................................. 251 register 28: run mode clock gating control register 0 (rcgc0), offset 0x100 ................................... 252 register 29: sleep mode clock gating control register 0 (scgc0), offset 0x110 ................................. 255 register 30: deep sleep mode clock gating control register 0 (dcgc0), offset 0x120 ....................... 258 register 31: run mode clock gating control register 1 (rcgc1), offset 0x104 ................................... 260 register 32: sleep mode clock gating control register 1 (scgc1), offset 0x114 ................................. 263 register 33: deep-sleep mode clock gating control register 1 (dcgc1), offset 0x124 ....................... 266 register 34: run mode clock gating control register 2 (rcgc2), offset 0x108 ................................... 269 register 35: sleep mode clock gating control register 2 (scgc2), offset 0x118 ................................. 271 register 36: deep sleep mode clock gating control register 2 (dcgc2), offset 0x128 ....................... 273 register 37: software reset control 0 (srcr0), offset 0x040 ............................................................. 275 register 38: software reset control 1 (srcr1), offset 0x044 ............................................................. 277 register 39: software reset control 2 (srcr2), offset 0x048 ............................................................. 280 hibernation module ..................................................................................................................... 282 register 1: hibernation rtc counter (hibrtcc), offset 0x000 ......................................................... 294 register 2: hibernation rtc match 0 (hibrtcm0), offset 0x004 ....................................................... 295 register 3: hibernation rtc match 1 (hibrtcm1), offset 0x008 ....................................................... 296 register 4: hibernation rtc load (hibrtcld), offset 0x00c ........................................................... 297 register 5: hibernation control (hibctl), offset 0x010 ..................................................................... 298 register 6: hibernation interrupt mask (hibim), offset 0x014 ............................................................. 301 register 7: hibernation raw interrupt status (hibris), offset 0x018 .................................................. 303 register 8: hibernation masked interrupt status (hibmis), offset 0x01c ............................................ 305 register 9: hibernation interrupt clear (hibic), offset 0x020 ............................................................. 307 register 10: hibernation rtc trim (hibrtct), offset 0x024 ............................................................... 308 register 11: hibernation data (hibdata), offset 0x030-0x12c ............................................................ 309 internal memory ........................................................................................................................... 310 register 1: flash memory address (fma), offset 0x000 .................................................................... 319 register 2: flash memory data (fmd), offset 0x004 ......................................................................... 320 register 3: flash memory control (fmc), offset 0x008 ..................................................................... 321 register 4: flash controller raw interrupt status (fcris), offset 0x00c ............................................ 324 register 5: flash controller interrupt mask (fcim), offset 0x010 ........................................................ 325 register 6: flash controller masked interrupt status and clear (fcmisc), offset 0x014 ..................... 326 register 7: flash memory control 2 (fmc2), offset 0x020 ................................................................. 327 register 8: flash write buffer valid (fwbval), offset 0x030 ............................................................. 328 register 9: flash control (fctl), offset 0x0f8 ................................................................................. 329 register 10: flash write buffer n (fwbn), offset 0x100 - 0x17c .......................................................... 330 register 11: rom control (rmctl), offset 0x0f0 .............................................................................. 331 19 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller register 12: flash memory protection read enable 0 (fmpre0), offset 0x130 and 0x200 ................... 332 register 13: flash memory protection program enable 0 (fmppe0), offset 0x134 and 0x400 ............... 333 register 14: boot configuration (bootcfg), offset 0x1d0 ................................................................. 334 register 15: user register 0 (user_reg0), offset 0x1e0 .................................................................. 336 register 16: user register 1 (user_reg1), offset 0x1e4 .................................................................. 337 register 17: user register 2 (user_reg2), offset 0x1e8 .................................................................. 338 register 18: user register 3 (user_reg3), offset 0x1ec ................................................................. 339 register 19: flash memory protection read enable 1 (fmpre1), offset 0x204 .................................... 340 register 20: flash memory protection read enable 2 (fmpre2), offset 0x208 .................................... 341 register 21: flash memory protection read enable 3 (fmpre3), offset 0x20c ................................... 342 register 22: flash memory protection program enable 1 (fmppe1), offset 0x404 ............................... 343 register 23: flash memory protection program enable 2 (fmppe2), offset 0x408 ............................... 344 register 24: flash memory protection program enable 3 (fmppe3), offset 0x40c ............................... 345 micro direct memory access (dma) ........................................................................................ 346 register 1: dma channel source address end pointer (dmasrcendp), offset 0x000 ...................... 369 register 2: dma channel destination address end pointer (dmadstendp), offset 0x004 ................ 370 register 3: dma channel control word (dmachctl), offset 0x008 .................................................. 371 register 4: dma status (dmastat), offset 0x000 ............................................................................ 376 register 5: dma configuration (dmacfg), offset 0x004 ................................................................... 378 register 6: dma channel control base pointer (dmactlbase), offset 0x008 .................................. 379 register 7: dma alternate channel control base pointer (dmaaltbase), offset 0x00c .................... 380 register 8: dma channel wait-on-request status (dmawaitstat), offset 0x010 ............................. 381 register 9: dma channel software request (dmaswreq), offset 0x014 ......................................... 382 register 10: dma channel useburst set (dmauseburstset), offset 0x018 .................................... 383 register 11: dma channel useburst clear (dmauseburstclr), offset 0x01c ................................. 384 register 12: dma channel request mask set (dmareqmaskset), offset 0x020 .............................. 385 register 13: dma channel request mask clear (dmareqmaskclr), offset 0x024 ........................... 386 register 14: dma channel enable set (dmaenaset), offset 0x028 ................................................... 387 register 15: dma channel enable clear (dmaenaclr), offset 0x02c ............................................... 388 register 16: dma channel primary alternate set (dmaaltset), offset 0x030 .................................... 389 register 17: dma channel primary alternate clear (dmaaltclr), offset 0x034 ................................. 390 register 18: dma channel priority set (dmaprioset), offset 0x038 ................................................. 391 register 19: dma channel priority clear (dmaprioclr), offset 0x03c .............................................. 392 register 20: dma bus error clear (dmaerrclr), offset 0x04c ........................................................ 393 register 21: dma channel assignment (dmachasgn), offset 0x500 ................................................. 394 register 22: dma peripheral identification 0 (dmaperiphid0), offset 0xfe0 ......................................... 395 register 23: dma peripheral identification 1 (dmaperiphid1), offset 0xfe4 ......................................... 396 register 24: dma peripheral identification 2 (dmaperiphid2), offset 0xfe8 ......................................... 397 register 25: dma peripheral identification 3 (dmaperiphid3), offset 0xfec ........................................ 398 register 26: dma peripheral identification 4 (dmaperiphid4), offset 0xfd0 ......................................... 399 register 27: dma primecell identification 0 (dmapcellid0), offset 0xff0 ........................................... 400 register 28: dma primecell identification 1 (dmapcellid1), offset 0xff4 ........................................... 401 register 29: dma primecell identification 2 (dmapcellid2), offset 0xff8 ........................................... 402 register 30: dma primecell identification 3 (dmapcellid3), offset 0xffc ........................................... 403 general-purpose input/outputs (gpios) ................................................................................... 404 register 1: gpio data (gpiodata), offset 0x000 ............................................................................ 418 register 2: gpio direction (gpiodir), offset 0x400 ......................................................................... 419 register 3: gpio interrupt sense (gpiois), offset 0x404 .................................................................. 420 march 20, 2011 20 texas instruments-advance information table of contents register 4: gpio interrupt both edges (gpioibe), offset 0x408 ........................................................ 421 register 5: gpio interrupt event (gpioiev), offset 0x40c ................................................................ 422 register 6: gpio interrupt mask (gpioim), offset 0x410 ................................................................... 423 register 7: gpio raw interrupt status (gpioris), offset 0x414 ........................................................ 424 register 8: gpio masked interrupt status (gpiomis), offset 0x418 ................................................... 425 register 9: gpio interrupt clear (gpioicr), offset 0x41c ................................................................ 427 register 10: gpio alternate function select (gpioafsel), offset 0x420 ............................................ 428 register 11: gpio 2-ma drive select (gpiodr2r), offset 0x500 ........................................................ 430 register 12: gpio 4-ma drive select (gpiodr4r), offset 0x504 ........................................................ 431 register 13: gpio 8-ma drive select (gpiodr8r), offset 0x508 ........................................................ 432 register 14: gpio open drain select (gpioodr), offset 0x50c ......................................................... 433 register 15: gpio pull-up select (gpiopur), offset 0x510 ................................................................ 434 register 16: gpio pull-down select (gpiopdr), offset 0x514 ........................................................... 436 register 17: gpio slew rate control select (gpioslr), offset 0x518 ................................................ 438 register 18: gpio digital enable (gpioden), offset 0x51c ................................................................ 439 register 19: gpio lock (gpiolock), offset 0x520 ............................................................................ 441 register 20: gpio commit (gpiocr), offset 0x524 ............................................................................ 442 register 21: gpio analog mode select (gpioamsel), offset 0x528 ................................................... 444 register 22: gpio port control (gpiopctl), offset 0x52c ................................................................. 446 register 23: gpio peripheral identification 4 (gpioperiphid4), offset 0xfd0 ....................................... 448 register 24: gpio peripheral identification 5 (gpioperiphid5), offset 0xfd4 ....................................... 449 register 25: gpio peripheral identification 6 (gpioperiphid6), offset 0xfd8 ....................................... 450 register 26: gpio peripheral identification 7 (gpioperiphid7), offset 0xfdc ...................................... 451 register 27: gpio peripheral identification 0 (gpioperiphid0), offset 0xfe0 ....................................... 452 register 28: gpio peripheral identification 1 (gpioperiphid1), offset 0xfe4 ....................................... 453 register 29: gpio peripheral identification 2 (gpioperiphid2), offset 0xfe8 ....................................... 454 register 30: gpio peripheral identification 3 (gpioperiphid3), offset 0xfec ...................................... 455 register 31: gpio primecell identification 0 (gpiopcellid0), offset 0xff0 .......................................... 456 register 32: gpio primecell identification 1 (gpiopcellid1), offset 0xff4 .......................................... 457 register 33: gpio primecell identification 2 (gpiopcellid2), offset 0xff8 .......................................... 458 register 34: gpio primecell identification 3 (gpiopcellid3), offset 0xffc ......................................... 459 general-purpose timers ............................................................................................................. 460 register 1: gptm configuration (gptmcfg), offset 0x000 .............................................................. 476 register 2: gptm timer a mode (gptmtamr), offset 0x004 ........................................................... 477 register 3: gptm timer b mode (gptmtbmr), offset 0x008 ........................................................... 479 register 4: gptm control (gptmctl), offset 0x00c ........................................................................ 481 register 5: gptm interrupt mask (gptmimr), offset 0x018 .............................................................. 484 register 6: gptm raw interrupt status (gptmris), offset 0x01c ..................................................... 486 register 7: gptm masked interrupt status (gptmmis), offset 0x020 ................................................ 489 register 8: gptm interrupt clear (gptmicr), offset 0x024 .............................................................. 492 register 9: gptm timer a interval load (gptmtailr), offset 0x028 ................................................ 494 register 10: gptm timer b interval load (gptmtbilr), offset 0x02c ................................................ 495 register 11: gptm timer a match (gptmtamatchr), offset 0x030 .................................................. 496 register 12: gptm timer b match (gptmtbmatchr), offset 0x034 ................................................. 497 register 13: gptm timer a prescale (gptmtapr), offset 0x038 ....................................................... 498 register 14: gptm timer b prescale (gptmtbpr), offset 0x03c ...................................................... 499 register 15: gptm timera prescale match (gptmtapmr), offset 0x040 ........................................... 500 register 16: gptm timerb prescale match (gptmtbpmr), offset 0x044 ........................................... 501 21 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller register 17: gptm timer a (gptmtar), offset 0x048 ....................................................................... 502 register 18: gptm timer b (gptmtbr), offset 0x04c ....................................................................... 503 register 19: gptm timer a value (gptmtav), offset 0x050 ............................................................... 504 register 20: gptm timer b value (gptmtbv), offset 0x054 .............................................................. 505 watchdog timers ......................................................................................................................... 506 register 1: watchdog load (wdtload), offset 0x000 ...................................................................... 510 register 2: watchdog value (wdtvalue), offset 0x004 ................................................................... 511 register 3: watchdog control (wdtctl), offset 0x008 ..................................................................... 512 register 4: watchdog interrupt clear (wdticr), offset 0x00c .......................................................... 514 register 5: watchdog raw interrupt status (wdtris), offset 0x010 .................................................. 515 register 6: watchdog masked interrupt status (wdtmis), offset 0x014 ............................................. 516 register 7: watchdog test (wdttest), offset 0x418 ....................................................................... 517 register 8: watchdog lock (wdtlock), offset 0xc00 ..................................................................... 518 register 9: watchdog peripheral identification 4 (wdtperiphid4), offset 0xfd0 ................................. 519 register 10: watchdog peripheral identification 5 (wdtperiphid5), offset 0xfd4 ................................. 520 register 11: watchdog peripheral identification 6 (wdtperiphid6), offset 0xfd8 ................................. 521 register 12: watchdog peripheral identification 7 (wdtperiphid7), offset 0xfdc ................................ 522 register 13: watchdog peripheral identification 0 (wdtperiphid0), offset 0xfe0 ................................. 523 register 14: watchdog peripheral identification 1 (wdtperiphid1), offset 0xfe4 ................................. 524 register 15: watchdog peripheral identification 2 (wdtperiphid2), offset 0xfe8 ................................. 525 register 16: watchdog peripheral identification 3 (wdtperiphid3), offset 0xfec ................................. 526 register 17: watchdog primecell identification 0 (wdtpcellid0), offset 0xff0 .................................... 527 register 18: watchdog primecell identification 1 (wdtpcellid1), offset 0xff4 .................................... 528 register 19: watchdog primecell identification 2 (wdtpcellid2), offset 0xff8 .................................... 529 register 20: watchdog primecell identification 3 (wdtpcellid3 ), offset 0xffc .................................. 530 analog-to-digital converter (adc) ............................................................................................. 531 register 1: adc active sample sequencer (adcactss), offset 0x000 ............................................. 553 register 2: adc raw interrupt status (adcris), offset 0x004 ........................................................... 554 register 3: adc interrupt mask (adcim), offset 0x008 ..................................................................... 556 register 4: adc interrupt status and clear (adcisc), offset 0x00c .................................................. 558 register 5: adc overflow status (adcostat), offset 0x010 ............................................................ 561 register 6: adc event multiplexer select (adcemux), offset 0x014 ................................................. 563 register 7: adc underflow status (adcustat), offset 0x018 ........................................................... 568 register 8: adc sample sequencer priority (adcsspri), offset 0x020 ............................................. 569 register 9: adc sample phase control (adcspc), offset 0x024 ...................................................... 571 register 10: adc processor sample sequence initiate (adcpssi), offset 0x028 ................................. 573 register 11: adc sample averaging control (adcsac), offset 0x030 ................................................. 575 register 12: adc digital comparator interrupt status and clear (adcdcisc), offset 0x034 ................. 576 register 13: adc control (adcctl), offset 0x038 ............................................................................. 578 register 14: adc sample sequence input multiplexer select 0 (adcssmux0), offset 0x040 ............... 579 register 15: adc sample sequence control 0 (adcssctl0), offset 0x044 ........................................ 581 register 16: adc sample sequence result fifo 0 (adcssfifo0), offset 0x048 ................................ 584 register 17: adc sample sequence result fifo 1 (adcssfifo1), offset 0x068 ................................ 584 register 18: adc sample sequence result fifo 2 (adcssfifo2), offset 0x088 ................................ 584 register 19: adc sample sequence result fifo 3 (adcssfifo3), offset 0x0a8 ............................... 584 register 20: adc sample sequence fifo 0 status (adcssfstat0), offset 0x04c ............................. 585 register 21: adc sample sequence fifo 1 status (adcssfstat1), offset 0x06c ............................. 585 register 22: adc sample sequence fifo 2 status (adcssfstat2), offset 0x08c ............................ 585 march 20, 2011 22 texas instruments-advance information table of contents register 23: adc sample sequence fifo 3 status (adcssfstat3), offset 0x0ac ............................ 585 register 24: adc sample sequence 0 operation (adcssop0), offset 0x050 ...................................... 587 register 25: adc sample sequence 0 digital comparator select (adcssdc0), offset 0x054 .............. 589 register 26: adc sample sequence input multiplexer select 1 (adcssmux1), offset 0x060 ............... 591 register 27: adc sample sequence input multiplexer select 2 (adcssmux2), offset 0x080 ............... 591 register 28: adc sample sequence control 1 (adcssctl1), offset 0x064 ........................................ 592 register 29: adc sample sequence control 2 (adcssctl2), offset 0x084 ........................................ 592 register 30: adc sample sequence 1 operation (adcssop1), offset 0x070 ...................................... 594 register 31: adc sample sequence 2 operation (adcssop2), offset 0x090 ..................................... 594 register 32: adc sample sequence 1 digital comparator select (adcssdc1), offset 0x074 .............. 595 register 33: adc sample sequence 2 digital comparator select (adcssdc2), offset 0x094 .............. 595 register 34: adc sample sequence input multiplexer select 3 (adcssmux3), offset 0x0a0 ............... 597 register 35: adc sample sequence control 3 (adcssctl3), offset 0x0a4 ........................................ 598 register 36: adc sample sequence 3 operation (adcssop3), offset 0x0b0 ..................................... 599 register 37: adc sample sequence 3 digital comparator select (adcssdc3), offset 0x0b4 .............. 600 register 38: adc digital comparator reset initial conditions (adcdcric), offset 0xd00 ..................... 601 register 39: adc digital comparator control 0 (adcdcctl0), offset 0xe00 ....................................... 606 register 40: adc digital comparator control 1 (adcdcctl1), offset 0xe04 ....................................... 606 register 41: adc digital comparator control 2 (adcdcctl2), offset 0xe08 ....................................... 606 register 42: adc digital comparator control 3 (adcdcctl3), offset 0xe0c ...................................... 606 register 43: adc digital comparator control 4 (adcdcctl4), offset 0xe10 ....................................... 606 register 44: adc digital comparator control 5 (adcdcctl5), offset 0xe14 ....................................... 606 register 45: adc digital comparator control 6 (adcdcctl6), offset 0xe18 ....................................... 606 register 46: adc digital comparator control 7 (adcdcctl7), offset 0xe1c ...................................... 606 register 47: adc digital comparator range 0 (adcdccmp0), offset 0xe40 ....................................... 609 register 48: adc digital comparator range 1 (adcdccmp1), offset 0xe44 ....................................... 609 register 49: adc digital comparator range 2 (adcdccmp2), offset 0xe48 ....................................... 609 register 50: adc digital comparator range 3 (adcdccmp3), offset 0xe4c ...................................... 609 register 51: adc digital comparator range 4 (adcdccmp4), offset 0xe50 ....................................... 609 register 52: adc digital comparator range 5 (adcdccmp5), offset 0xe54 ....................................... 609 register 53: adc digital comparator range 6 (adcdccmp6), offset 0xe58 ....................................... 609 register 54: adc digital comparator range 7 (adcdccmp7), offset 0xe5c ...................................... 609 universal asynchronous receivers/transmitters (uarts) ..................................................... 610 register 1: uart data (uartdr), offset 0x000 ............................................................................... 624 register 2: uart receive status/error clear (uartrsr/uartecr), offset 0x004 ........................... 626 register 3: uart flag (uartfr), offset 0x018 ................................................................................ 629 register 4: uart irda low-power register (uartilpr), offset 0x020 ............................................. 632 register 5: uart integer baud-rate divisor (uartibrd), offset 0x024 ............................................ 633 register 6: uart fractional baud-rate divisor (uartfbrd), offset 0x028 ....................................... 634 register 7: uart line control (uartlcrh), offset 0x02c ............................................................... 635 register 8: uart control (uartctl), offset 0x030 ......................................................................... 637 register 9: uart interrupt fifo level select (uartifls), offset 0x034 ........................................... 641 register 10: uart interrupt mask (uartim), offset 0x038 ................................................................. 643 register 11: uart raw interrupt status (uartris), offset 0x03c ...................................................... 647 register 12: uart masked interrupt status (uartmis), offset 0x040 ................................................. 650 register 13: uart interrupt clear (uarticr), offset 0x044 ............................................................... 653 register 14: uart dma control (uartdmactl), offset 0x048 .......................................................... 655 register 15: uart lin control (uartlctl), offset 0x090 ................................................................. 656 23 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller register 16: uart lin snap shot (uartlss), offset 0x094 ............................................................... 657 register 17: uart lin timer (uartltim), offset 0x098 ..................................................................... 658 register 18: uart peripheral identification 4 (uartperiphid4), offset 0xfd0 ..................................... 659 register 19: uart peripheral identification 5 (uartperiphid5), offset 0xfd4 ..................................... 660 register 20: uart peripheral identification 6 (uartperiphid6), offset 0xfd8 ..................................... 661 register 21: uart peripheral identification 7 (uartperiphid7), offset 0xfdc ..................................... 662 register 22: uart peripheral identification 0 (uartperiphid0), offset 0xfe0 ...................................... 663 register 23: uart peripheral identification 1 (uartperiphid1), offset 0xfe4 ...................................... 664 register 24: uart peripheral identification 2 (uartperiphid2), offset 0xfe8 ...................................... 665 register 25: uart peripheral identification 3 (uartperiphid3), offset 0xfec ..................................... 666 register 26: uart primecell identification 0 (uartpcellid0), offset 0xff0 ........................................ 667 register 27: uart primecell identification 1 (uartpcellid1), offset 0xff4 ........................................ 668 register 28: uart primecell identification 2 (uartpcellid2), offset 0xff8 ........................................ 669 register 29: uart primecell identification 3 (uartpcellid3), offset 0xffc ........................................ 670 synchronous serial interface (ssi) ............................................................................................ 671 register 1: ssi control 0 (ssicr0), offset 0x000 .............................................................................. 687 register 2: ssi control 1 (ssicr1), offset 0x004 .............................................................................. 689 register 3: ssi data (ssidr), offset 0x008 ...................................................................................... 691 register 4: ssi status (ssisr), offset 0x00c ................................................................................... 692 register 5: ssi clock prescale (ssicpsr), offset 0x010 .................................................................. 694 register 6: ssi interrupt mask (ssiim), offset 0x014 ......................................................................... 695 register 7: ssi raw interrupt status (ssiris), offset 0x018 .............................................................. 696 register 8: ssi masked interrupt status (ssimis), offset 0x01c ........................................................ 698 register 9: ssi interrupt clear (ssiicr), offset 0x020 ....................................................................... 700 register 10: ssi dma control (ssidmactl), offset 0x024 ................................................................. 701 register 11: ssi peripheral identification 4 (ssiperiphid4), offset 0xfd0 ............................................. 702 register 12: ssi peripheral identification 5 (ssiperiphid5), offset 0xfd4 ............................................. 703 register 13: ssi peripheral identification 6 (ssiperiphid6), offset 0xfd8 ............................................. 704 register 14: ssi peripheral identification 7 (ssiperiphid7), offset 0xfdc ............................................ 705 register 15: ssi peripheral identification 0 (ssiperiphid0), offset 0xfe0 ............................................. 706 register 16: ssi peripheral identification 1 (ssiperiphid1), offset 0xfe4 ............................................. 707 register 17: ssi peripheral identification 2 (ssiperiphid2), offset 0xfe8 ............................................. 708 register 18: ssi peripheral identification 3 (ssiperiphid3), offset 0xfec ............................................ 709 register 19: ssi primecell identification 0 (ssipcellid0), offset 0xff0 ............................................... 710 register 20: ssi primecell identification 1 (ssipcellid1), offset 0xff4 ............................................... 711 register 21: ssi primecell identification 2 (ssipcellid2), offset 0xff8 ............................................... 712 register 22: ssi primecell identification 3 (ssipcellid3), offset 0xffc ............................................... 713 inter-integrated circuit (i 2 c) interface ........................................................................................ 714 register 1: i 2 c master slave address (i2cmsa), offset 0x000 ........................................................... 731 register 2: i 2 c master control/status (i2cmcs), offset 0x004 ........................................................... 732 register 3: i 2 c master data (i2cmdr), offset 0x008 ......................................................................... 736 register 4: i 2 c master timer period (i2cmtpr), offset 0x00c ........................................................... 737 register 5: i 2 c master interrupt mask (i2cmimr), offset 0x010 ......................................................... 738 register 6: i 2 c master raw interrupt status (i2cmris), offset 0x014 ................................................. 739 register 7: i 2 c master masked interrupt status (i2cmmis), offset 0x018 ........................................... 740 register 8: i 2 c master interrupt clear (i2cmicr), offset 0x01c ......................................................... 741 register 9: i 2 c master configuration (i2cmcr), offset 0x020 ............................................................ 742 march 20, 2011 24 texas instruments-advance information table of contents register 10: i 2 c slave own address (i2csoar), offset 0x800 ............................................................ 743 register 11: i 2 c slave control/status (i2cscsr), offset 0x804 ........................................................... 744 register 12: i 2 c slave data (i2csdr), offset 0x808 ........................................................................... 746 register 13: i 2 c slave interrupt mask (i2csimr), offset 0x80c ........................................................... 747 register 14: i 2 c slave raw interrupt status (i2csris), offset 0x810 ................................................... 748 register 15: i 2 c slave masked interrupt status (i2csmis), offset 0x814 .............................................. 749 register 16: i 2 c slave interrupt clear (i2csicr), offset 0x818 ............................................................ 750 inter-integrated circuit sound (i 2 s) interface ............................................................................ 751 register 1: i 2 s transmit fifo data (i2stxfifo), offset 0x000 .......................................................... 764 register 2: i 2 s transmit fifo configuration (i2stxfifocfg), offset 0x004 ...................................... 765 register 3: i 2 s transmit module configuration (i2stxcfg), offset 0x008 .......................................... 766 register 4: i 2 s transmit fifo limit (i2stxlimit), offset 0x00c ........................................................ 768 register 5: i 2 s transmit interrupt status and mask (i2stxism), offset 0x010 ..................................... 769 register 6: i 2 s transmit fifo level (i2stxlev), offset 0x018 .......................................................... 770 register 7: i 2 s receive fifo data (i2srxfifo), offset 0x800 .......................................................... 771 register 8: i 2 s receive fifo configuration (i2srxfifocfg), offset 0x804 ...................................... 772 register 9: i 2 s receive module configuration (i2srxcfg), offset 0x808 ........................................... 773 register 10: i 2 s receive fifo limit (i2srxlimit), offset 0x80c ......................................................... 775 register 11: i 2 s receive interrupt status and mask (i2srxism), offset 0x810 ..................................... 776 register 12: i 2 s receive fifo level (i2srxlev), offset 0x818 ........................................................... 777 register 13: i 2 s module configuration (i2scfg), offset 0xc00 ............................................................ 778 register 14: i 2 s interrupt mask (i2sim), offset 0xc10 ......................................................................... 780 register 15: i 2 s raw interrupt status (i2sris), offset 0xc14 ............................................................... 782 register 16: i 2 s masked interrupt status (i2smis), offset 0xc18 ......................................................... 784 register 17: i 2 s interrupt clear (i2sic), offset 0xc1c ......................................................................... 786 analog comparators ................................................................................................................... 787 register 1: analog comparator masked interrupt status (acmis), offset 0x000 .................................. 793 register 2: analog comparator raw interrupt status (acris), offset 0x004 ....................................... 794 register 3: analog comparator interrupt enable (acinten), offset 0x008 ......................................... 795 register 4: analog comparator reference voltage control (acrefctl), offset 0x010 ....................... 796 register 5: analog comparator status 0 (acstat0), offset 0x020 ..................................................... 797 register 6: analog comparator status 1 (acstat1), offset 0x040 ..................................................... 797 register 7: analog comparator control 0 (acctl0), offset 0x024 ..................................................... 798 register 8: analog comparator control 1 (acctl1), offset 0x044 ..................................................... 798 pulse width modulator (pwm) .................................................................................................... 800 register 1: pwm master control (pwmctl), offset 0x000 ................................................................ 815 register 2: pwm time base sync (pwmsync), offset 0x004 ........................................................... 816 register 3: pwm output enable (pwmenable), offset 0x008 .......................................................... 817 register 4: pwm output inversion (pwminvert), offset 0x00c ....................................................... 819 register 5: pwm output fault (pwmfault), offset 0x010 ................................................................ 821 register 6: pwm interrupt enable (pwminten), offset 0x014 ........................................................... 823 register 7: pwm raw interrupt status (pwmris), offset 0x018 ........................................................ 825 register 8: pwm interrupt status and clear (pwmisc), offset 0x01c ................................................ 827 register 9: pwm status (pwmstatus), offset 0x020 ...................................................................... 829 register 10: pwm fault condition value (pwmfaultval), offset 0x024 ............................................ 831 register 11: pwm enable update (pwmenupd), offset 0x028 ........................................................... 833 25 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller register 12: pwm0 control (pwm0ctl), offset 0x040 ....................................................................... 836 register 13: pwm1 control (pwm1ctl), offset 0x080 ....................................................................... 836 register 14: pwm2 control (pwm2ctl), offset 0x0c0 ....................................................................... 836 register 15: pwm0 interrupt and trigger enable (pwm0inten), offset 0x044 ..................................... 841 register 16: pwm1 interrupt and trigger enable (pwm1inten), offset 0x084 ..................................... 841 register 17: pwm2 interrupt and trigger enable (pwm2inten), offset 0x0c4 .................................... 841 register 18: pwm0 raw interrupt status (pwm0ris), offset 0x048 ..................................................... 844 register 19: pwm1 raw interrupt status (pwm1ris), offset 0x088 ..................................................... 844 register 20: pwm2 raw interrupt status (pwm2ris), offset 0x0c8 .................................................... 844 register 21: pwm0 interrupt status and clear (pwm0isc), offset 0x04c ............................................ 846 register 22: pwm1 interrupt status and clear (pwm1isc), offset 0x08c ............................................ 846 register 23: pwm2 interrupt status and clear (pwm2isc), offset 0x0cc ............................................ 846 register 24: pwm0 load (pwm0load), offset 0x050 ........................................................................ 848 register 25: pwm1 load (pwm1load), offset 0x090 ........................................................................ 848 register 26: pwm2 load (pwm2load), offset 0x0d0 ....................................................................... 848 register 27: pwm0 counter (pwm0count), offset 0x054 ................................................................. 849 register 28: pwm1 counter (pwm1count), offset 0x094 ................................................................. 849 register 29: pwm2 counter (pwm2count), offset 0x0d4 ................................................................ 849 register 30: pwm0 compare a (pwm0cmpa), offset 0x058 .............................................................. 850 register 31: pwm1 compare a (pwm1cmpa), offset 0x098 .............................................................. 850 register 32: pwm2 compare a (pwm2cmpa), offset 0x0d8 .............................................................. 850 register 33: pwm0 compare b (pwm0cmpb), offset 0x05c ............................................................. 851 register 34: pwm1 compare b (pwm1cmpb), offset 0x09c ............................................................. 851 register 35: pwm2 compare b (pwm2cmpb), offset 0x0dc ............................................................. 851 register 36: pwm0 generator a control (pwm0gena), offset 0x060 ................................................. 852 register 37: pwm1 generator a control (pwm1gena), offset 0x0a0 ................................................. 852 register 38: pwm2 generator a control (pwm2gena), offset 0x0e0 ................................................. 852 register 39: pwm0 generator b control (pwm0genb), offset 0x064 ................................................. 855 register 40: pwm1 generator b control (pwm1genb), offset 0x0a4 ................................................. 855 register 41: pwm2 generator b control (pwm2genb), offset 0x0e4 ................................................. 855 register 42: pwm0 dead-band control (pwm0dbctl), offset 0x068 ................................................. 858 register 43: pwm1 dead-band control (pwm1dbctl), offset 0x0a8 ................................................. 858 register 44: pwm2 dead-band control (pwm2dbctl), offset 0x0e8 ................................................. 858 register 45: pwm0 dead-band rising-edge delay (pwm0dbrise), offset 0x06c .............................. 859 register 46: pwm1 dead-band rising-edge delay (pwm1dbrise), offset 0x0ac .............................. 859 register 47: pwm2 dead-band rising-edge delay (pwm2dbrise), offset 0x0ec .............................. 859 register 48: pwm0 dead-band falling-edge-delay (pwm0dbfall), offset 0x070 .............................. 860 register 49: pwm1 dead-band falling-edge-delay (pwm1dbfall), offset 0x0b0 .............................. 860 register 50: pwm2 dead-band falling-edge-delay (pwm2dbfall), offset 0x0f0 .............................. 860 register 51: pwm0 fault source 0 (pwm0fltsrc0), offset 0x074 .................................................... 861 register 52: pwm1 fault source 0 (pwm1fltsrc0), offset 0x0b4 .................................................... 861 register 53: pwm2 fault source 0 (pwm2fltsrc0), offset 0x0f4 .................................................... 861 register 54: pwm0 fault source 1 (pwm0fltsrc1), offset 0x078 .................................................... 863 register 55: pwm1 fault source 1 (pwm1fltsrc1), offset 0x0b8 .................................................... 863 register 56: pwm2 fault source 1 (pwm2fltsrc1), offset 0x0f8 .................................................... 863 register 57: pwm0 minimum fault period (pwm0minfltper), offset 0x07c ..................................... 866 register 58: pwm1 minimum fault period (pwm1minfltper), offset 0x0bc ..................................... 866 register 59: pwm2 minimum fault period (pwm2minfltper), offset 0x0fc ..................................... 866 march 20, 2011 26 texas instruments-advance information table of contents register 60: pwm0 fault pin logic sense (pwm0fltsen), offset 0x800 ............................................ 867 register 61: pwm1 fault pin logic sense (pwm1fltsen), offset 0x880 ............................................ 867 register 62: pwm2 fault pin logic sense (pwm2fltsen), offset 0x900 ............................................ 867 register 63: pwm3 fault pin logic sense (pwm3fltsen), offset 0x980 ............................................ 867 register 64: pwm0 fault status 0 (pwm0fltstat0), offset 0x804 .................................................... 868 register 65: pwm1 fault status 0 (pwm1fltstat0), offset 0x884 .................................................... 868 register 66: pwm2 fault status 0 (pwm2fltstat0), offset 0x904 .................................................... 868 register 67: pwm0 fault status 1 (pwm0fltstat1), offset 0x808 .................................................... 870 register 68: pwm1 fault status 1 (pwm1fltstat1), offset 0x888 .................................................... 870 register 69: pwm2 fault status 1 (pwm2fltstat1), offset 0x908 .................................................... 870 quadrature encoder interface (qei) .......................................................................................... 873 register 1: qei control (qeictl), offset 0x000 ................................................................................ 880 register 2: qei status (qeistat), offset 0x004 ................................................................................ 883 register 3: qei position (qeipos), offset 0x008 .............................................................................. 884 register 4: qei maximum position (qeimaxpos), offset 0x00c ....................................................... 885 register 5: qei timer load (qeiload), offset 0x010 ....................................................................... 886 register 6: qei timer (qeitime), offset 0x014 ................................................................................. 887 register 7: qei velocity counter (qeicount), offset 0x018 ............................................................. 888 register 8: qei velocity (qeispeed), offset 0x01c .......................................................................... 889 register 9: qei interrupt enable (qeiinten), offset 0x020 ............................................................... 890 register 10: qei raw interrupt status (qeiris), offset 0x024 ............................................................. 892 register 11: qei interrupt status and clear (qeiisc), offset 0x028 ..................................................... 894 27 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller revision history the revision history table notes changes made between the indicated revisions of the lm3s1p51 data sheet. table 1. revision history description revision date clarified "reset control" section in the "system control" chapter. corrected usb pll speed in "main clock tree" diagram. clarified hibernation module initialization and configuration. corrected reset value for dma channel wait-on-request status (dmawaitstat) register. corrected "gpio pins with non-zero reset values" table. clarified that that the timer reload only happens in periodic mode. clarified that only bit 0 in the watchdog control (wdtctl) register is protected from writes once set. added "sample averaging example" diagram to adc chapter. corrected "ssi timing for spi frame format" figure. in "electrical characteristics" chapter: C deleted t pormin parameter from "power characteristics" table, and deleted corresponding diagram. C added t adcsamp sample time parameter to "adc characteristics" table. additional minor data sheet clarifications and corrections. 9538 march 2011 clarified main oscillator verification circuit sequence. added note that there must be a delay of 3 system clocks after the module clock is enabled before any of that module's registers are accessed. clarified initialization and configuration procedure in "analog comparators" chapter. in electrical characteristics chapter: C added specification for maximum input voltage on a non-power pin when the microcontroller is unpowered (v non parameter in maximum ratings table). C replaced preliminary current consumption specifications with nominal power consumption, maximum current specifications, and typical current consumption vs. frequency sections. C clarified reset, and power and brown-out characteristics and added a new specification for powering down before powering back up. C added characteristics required when using an external regulator to provide power for v ddc . additional minor data sheet clarifications and corrections. 9161 january 2011 march 20, 2011 28 texas instruments-advance information revision history table 1. revision history (continued) description revision date information on advanced encryption standard (aes) cryptography tables and cyclic redundancy check (crc) error detection functionality was inadvertently omitted from some datasheets. this has been added. in apint register, changed bit name from sysresetreq to sysresreq. added debug (debug priority) bit field to syspri3 register. clarified flash memory caution. restructured the general-purpose timer chapter to combine duplicated text. combined high and low bit fields in gptmtailr , gptmtamatchr , gptmtar , gptmtav , gptmtbilr , gptmtamatchr , gptmtbr and gptmtbv registers for compatibility with future releases. removed mention of false-start bit detection in the uart chapter. this feature is not supported. added ssi master clock restriction that ssiclk cannot be faster than 25 mhz. changed i 2 c master and slave register base addresses and offsets to be relative to i 2 c module base, so register base and offsets were changed for all i 2 c slave registers. in electrical characteristics chapter: C added single-ended clock source input voltage values to "recommended dc operating conditions" table. C deleted oscillation mode value from "mosc oscillator input characteristics" table. C added t vdd2_3 supply voltage parameter to "reset characteristics" table. C added "power-on reset and voltage parameters" timing diagram. C added t vddrise_hib su"pply voltage parameter to "hibernation module ac characteristics" table. C added "vdd ramp when waking from hibernation" timing diagram. 8832 december 2010 29 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller table 1. revision history (continued) description revision date reorganized arm cortex-m3 processor core, memory map and interrupts chapters, creating two new chapters, the cortex-m3 processor and cortex-m3 peripherals. much additional content was added, including all the cortex-m3 registers. changed register names to be consistent with stellarisware ? names: the cortex-m3 interrupt control and status (icsr) register to the interrupt control and state (intctrl) register, and the cortex-m3 interrupt set enable (setna) register to the interrupt 0-31 set enable (en0) register. in the system control chapter: C corrected reset sources table (see table 5-3 on page 182). C added section "special considerations for reset." in the hibernation module chapter, added section special considerations when using a 4.194304-mhz crystal on page 287. clarified how reset operation affects the hibernation module (register reset on page 291). in the internal memory chapter: C added clarification of instruction execution during flash operations. C deleted rom version (rmver) register as it is not used. modified figure 9-1 on page 409 and figure 9-2 on page 410 to clarify operation of the gpio inputs when used as an alternate function. corrected bit field in gpio analog mode select (gpioamsel) register to be eight-bits wide, bits[7:0]. in general-purpose timers chapter, clarified operation of the 32-bit rtc mode. in operating characteristics chapter, corrected thermal resistance (junction to ambient) value to 32. in electrical characteristics chapter: C added "input voltage for a gpio configured as an analog input" value to table 23-1 on page 964. C added parameter (gpio input leakage current) to table 23-6 on page 966. C corrected nom values for and in table 23-7 on page 966. C corrected reset timing in table 23-24 on page 976. C corrected values for in table 23-26 on page 978. C specified max value for in table 23-29 on page 981. C corrected values for ( rise/fall time) in table 23-31 on page 981. C added i 2 c characteristics table (see table 23-32 on page 983). added dimensions for tray and tape and reel shipping mediums. 7794 september 2010 in "thermal characteristics" table, corrected thermal resistance value from 34 to 32. 7413 june 2010 march 20, 2011 30 texas instruments-advance information revision history table 1. revision history (continued) description revision date removed 4.194304-mhz crystal as a source for the system clock and pll. summarized rom contents descriptions in the "internal memory" chapter and removed various rom appendices. clarified dma channel terminology: changed name of dma channel alternate select (dmachalt) register to dma channel assignment (dmachasgn) register, changed chalt bit field to chasgn, and changed terminology from primary and alternate channels to primary and secondary channels. in signal tables chapter, added table "connections for unused signals." in "electrical characteristics" chapter: C in "reset characteristics" table, corrected supply voltage (vdd) rise time. C clarified figure "sdram initialization and load mode register timing". 7299 june 2010 added data sheets for five new stellaris? tempest-class parts: lm3s1r26, lm3s1621, lm3s1b21, lm3s9781, and lm3s9b81. additional minor data sheet clarifications and corrections. 7164 may 2010 added pin table "possible pin assignments for alternate functions", which lists the signals based on number of possible pin assignments. this table can be used to plan how to configure the pins for a particular functionality. additional minor data sheet clarifications and corrections. 7101 may 2010 extended tbrl bit field in gptmtbr register. additional minor data sheet clarifications and corrections. 6983 march 2010 renamed the user_dbg register to the bootcfg register in the internal memory chapter. added information on how to use a gpio pin to force the rom boot loader to execute on reset. added three figures to the adc chapter on sample phase control. 6912 march 2010 31 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller table 1. revision history (continued) description revision date added 108-ball bga package. in "system control" chapter: C clarified functional description for external reset and brown-out reset. C clarified debug access port operation after sleep modes. C corrected the reset value of the run-mode clock configuration 2 (rcc2) register. in "internal memory" chapter, clarified wording on flash memory access errors and added a section on interrupts to the flash memory description. added clarification about timer operating modes and added register descriptions for the gptm timer n prescale match (gptmtnpmr) registers. clarified register descriptions for gptm timer a value (gptmtav) and gptm timer b value (gptmtbv) registers. corrected the reset value of the adc sample sequence result fifo n (adcssfifon) registers. added adc sample phase control (adcspc) register at offset 0x24. added caution note to the i 2 c master timer period (i2cmtpr) register description and changed field width to 7 bits. made these changes to the operating characteristics chapter: C added storage temperature ratings to "temperature characteristics" table C added "esd absolute maximum ratings" table made these changes to the electrical characteristics chapter: C in "flash memory characteristics" table, corrected mass erase time C added sleep and deep-sleep wake-up times ("sleep modes ac characteristics" table) C in "reset characteristics" table, corrected units for supply voltage (vdd) rise time C added table entry for vdd3on power consumption to table 23-7 on page 966. added additional driverlib functions to appendix. 6790 february 2010 march 20, 2011 32 texas instruments-advance information revision history table 1. revision history (continued) description revision date released new 1000, 3000, 5000 and 9000 series stellaris ? devices. the idcode value was corrected to be 0x4ba0.0477. clarified that the bit in the icsr register in the nvic is also a source for nmi. clarified the use of the ldo. to clarify clock operation, reorganized clocking section, changed the bit to the bit and the bit to the bit in the rcc2 register, added tables, and rewrote descriptions. corrected bit description of the field in the dslpclkcfg register. removed the dsflashcfg register at system control offset 0x14c as it does not function correctly. removed the and fields from the dcgc0 as they have no function in deep-sleep mode. corrected address offsets for the flash write buffer (fwbn) registers. added flash control (fctl) register at internal memory offset 0x0f8 to help control frequent power cycling when hibernation is not used. changed the name of the epi channels for clarification: epi0_tx became epi0_wfifo and epi0_rx became epi0_nbrfifo. this change was also made in the dc7 bit descriptions. removed the dmachis register at dma module offset 0x504 as it does not function correctly. corrected alternate channel assignments for the dma controller. major improvements to the epi chapter. episdramcfg2 register was deleted as its function is not needed. clarified pwm source for adc triggering changed ssi set up and hold times to be expressed in system clocks, not ns. updated electrical characteristics chapter with latest data. changes were made to hibernation, adc and epi content. additional minor data sheet clarifications and corrections. 6458 october 2009 33 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller table 1. revision history (continued) description revision date corrected values for maxadc0spd and maxadc1spd bits in dc1, rcgc0 , scgc0 , and dcgc0 registers. corrected figure "ti synchronous serial frame format (single transfer)". changed hib pin from type ttl to type od. made a number of corrections to the electrical characteristics chapter: C deleted v bat and v refa parameters from and added footnotes to recommended dc operating conditions table. C modified hibernation module dc characteristics table. C deleted nominal and maximum current specifications section. C deleted sdram read command timing, sdram write command timing, sdram write burst timing, sdram precharge command timing and sdram cas latency timing figures and replaced with sdram read timing and sdram write timing figures. C modified host-bus 8/16 mode write timing figure. C modified general-purpose mode read and write timing figure. C major changes to adc characteristics tables, including adding additonal tables and diagram. added missing rom_i2sintstatus function to rom driverlib functions appendix. corrected ordering part numbers. additional minor data sheet clarifications and corrections. 5930 july 2009 in system control chapter, clarified power-on reset and external reset pin descriptions in "reset sources" section. added missing comparator output pin bits to dc3 register; reset value changed as well. clarified explanation of nonvolatile register programming in internal memory chapter. added explanation of reset value to fmpre0/1/2/3 , fmppe0/1/2/3 , user_dbg , and user_reg0 registers. in request type support table in dma chapter, corrected general-purpose timer row. in general-purpose timers chapter, clarified dma operation. added table "preliminary current consumption" to characteristics chapter. corrected nom and max values in "hibernation detailed current specifications" table. corrected nom and max values in epi characteristics table. added "csn to output invalid" parameter to epi table "epi host-bus 8 and host-bus 16 interface characteristics" and figure "host-bus 8/16 mode read timing". corrected inl, dnl, off and gain values in adc characteristics table. updated rom driverlib appendix with revc0 functions. updated part ordering numbers. additional minor data sheet clarifications and corrections. 5779 june 2009 started tracking revision history. 5285 may 2009 march 20, 2011 34 texas instruments-advance information revision history about this document this data sheet provides reference information for the lm3s1p51 microcontroller, describing the functional blocks of the system-on-chip (soc) device designed around the arm? cortex?-m3 core. audience this manual is intended for system software developers, hardware designers, and application developers. about this manual this document is organized into sections that correspond to each major feature. related documents the following related documents are available on the stellaris ? web site at www.ti.com/stellaris: stellaris? errata arm? cortex?-m3 errata cortex?-m3 instruction set technical user's manual stellaris? boot loader user's guide stellaris? graphics library user's guide stellaris? peripheral driver library user's guide stellaris? rom users guide the following related documents are also referenced: arm? debug interface v5 architecture specification ieee standard 1149.1-test access port and boundary-scan architecture this documentation list was current as of publication date. please check the web site for additional documentation, including application notes and white papers. 35 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller documentation conventions this document uses the conventions shown in table 2 on page 36. table 2. documentation conventions meaning notation general register notation apb registers are indicated in uppercase bold. for example, pborctl is the power-on and brown-out reset control register. if a register name contains a lowercase n, it represents more than one register. for example, srcrn represents any (or all) of the three software reset control registers: srcr0, srcr1 , and srcr2 . register a single bit in a register. bit two or more consecutive and related bits. bit field a hexadecimal increment to a register's address, relative to that module's base address as specified in table 2-4 on page 79. offset 0x nnn registers are numbered consecutively throughout the document to aid in referencing them. the register number has no meaning to software. register n register bits marked reserved are reserved for future use. in most cases, reserved bits are set to 0; however, user software should not rely on the value of a reserved bit. to provide software compatibility with future products, the value of a reserved bit should be preserved across a read-modify-write operation. reserved the range of register bits inclusive from xx to yy. for example, 31:15 means bits 15 through 31 in that register. yy:xx this value in the register bit diagram indicates whether software running on the controller can change the value of the bit field. register bit/field types software can read this field. the bit or field is cleared by hardware after reading the bit/field. rc software can read this field. always write the chip reset value. ro software can read or write this field. r/w software can read or write this field. writing to it with any value clears the register. r/wc software can read or write this field. a write of a 0 to a w1c bit does not affect the bit value in the register. a write of a 1 clears the value of the bit in the register; the remaining bits remain unchanged. this register type is primarily used for clearing interrupt status bits where the read operation provides the interrupt status and the write of the read value clears only the interrupts being reported at the time the register was read. r/w1c software can read or write a 1 to this field. a write of a 0 to a r/w1s bit does not affect the bit value in the register. r/w1s software can write this field. a write of a 0 to a w1c bit does not affect the bit value in the register. a write of a 1 clears the value of the bit in the register; the remaining bits remain unchanged. a read of the register returns no meaningful data. this register is typically used to clear the corresponding bit in an interrupt register. w1c only a write by software is valid; a read of the register returns no meaningful data. wo this value in the register bit diagram shows the bit/field value after any reset, unless noted. register bit/field reset value bit cleared to 0 on chip reset. 0 bit set to 1 on chip reset. 1 nondeterministic. - pin/signal notation pin alternate function; a pin defaults to the signal without the brackets. [ ] refers to the physical connection on the package. pin refers to the electrical signal encoding of a pin. signal march 20, 2011 36 texas instruments-advance information about this document table 2. documentation conventions (continued) meaning notation change the value of the signal from the logically false state to the logically true state. for active high signals, the asserted signal value is 1 (high); for active low signals, the asserted signal value is 0 (low). the active polarity (high or low) is defined by the signal name (see signal and signal below). assert a signal change the value of the signal from the logically true state to the logically false state. deassert a signal signal names are in uppercase and in the courier font. an overbar on a signal name indicates that it is active low. to assert signal is to drive it low; to deassert signal is to drive it high. signal signal names are in uppercase and in the courier font. an active high signal has no overbar. to assert signal is to drive it high; to deassert signal is to drive it low. signal numbers an uppercase x indicates any of several values is allowed, where x can be any legal pattern. for example, a binary value of 0x00 can be either 0100 or 0000, a hex value of 0xx is 0x0 or 0x1, and so on. x hexadecimal numbers have a prefix of 0x. for example, 0x00ff is the hexadecimal number ff. all other numbers within register tables are assumed to be binary. within conceptual information, binary numbers are indicated with a b suffix, for example, 1011b, and decimal numbers are written without a prefix or suffix. 0x 37 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller 1 architectural overview texas instruments is the industry leader in bringing 32-bit capabilities and the full benefits of arm ? cortex ? -m3-based microcontrollers to the broadest reach of the microcontroller market. for current users of 8- and 16-bit mcus, stellaris ? with cortex-m3 offers a direct path to the strongest ecosystem of development tools, software and knowledge in the industry. designers who migrate to stellaris benefit from great tools, small code footprint and outstanding performance. even more important, designers can enter the arm ecosystem with full confidence in a compatible roadmap from $1 to 1 ghz. for users of current 32-bit mcus, the stellaris family offers the industrys first implementation of cortex-m3 and the thumb-2 instruction set. with blazingly-fast responsiveness, thumb-2 technology combines both 16-bit and 32-bit instructions to deliver the best balance of code density and performance. thumb-2 uses 26 percent less memory than pure 32-bit code to reduce system cost while delivering 25 percent better performance. the texas instruments stellaris family of microcontrollersthe first arm cortex-m3 based controllersbrings high-performance 32-bit computing to cost-sensitive embedded microcontroller applications. these pioneering parts deliver customers 32-bit performance at a cost equivalent to legacy 8- and 16-bit devices, all in a package with a small footprint. the lm3s1p51 microcontroller has the following features: arm cortex-m3 processor core C 80-mhz operation; 100 dmips performance C arm cortex systick timer C nested vectored interrupt controller (nvic) on-chip memory C 64 kb single-cycle flash memory up to 50 mhz; a prefetch buffer improves performance above 50 mhz C 24 kb single-cycle sram C internal rom loaded with stellarisware ? software: ? stellaris peripheral driver library ? stellaris boot loader ? advanced encryption standard (aes) cryptography tables ? cyclic redundancy check (crc) error detection functionality advanced serial integration C three uarts with irda and iso 7816 support (one uart with full modem controls) C two i 2 c modules C two synchronous serial interface modules (ssi) C integrated interchip sound (i 2 s) module system integration C direct memory access controller (dma) march 20, 2011 38 texas instruments-advance information architectural overview C system control and clocks including on-chip precision 16-mhz oscillator C four 32-bit timers (up to eight 16-bit) C eight capture compare pwm pins (ccp) C lower-power battery-backed hibernation module C real-time clock in hibernation module C two watchdog timers ? one timer runs off the main oscillator ? one timer runs off the precision internal oscillator C up to 67 gpios, depending on configuration ? highly flexible pin muxing allows use as gpio or one of several peripheral functions ? independently configurable to 2, 4 or 8 ma drive capability ? up to 4 gpios can have 18 ma drive capability advanced motion control C six advanced pwm outputs for motion and energy applications C four fault inputs to promote low-latency shutdown C two quadrature encoder inputs (qei) analog C two 10-bit analog-to-digital converters (adc) with 16 analog input channels and a sample rate of one million samples/second C two analog comparators C 16 digital comparators C on-chip voltage regulator jtag and arm serial wire debug (swd) 100-pin lqfp and 108-ball bga package industrial (-40c to 85c) temperature range the lm3s1p51 microcontroller is targeted for industrial applications, including remote monitoring, electronic point-of-sale machines, test and measurement equipment, network appliances and switches, factory automation, hvac and building control, gaming equipment, motion control, medical instrumentation, and fire and security. for applications requiring extreme conservation of power, the lm3s1p51 microcontroller features a battery-backed hibernation module to efficiently power down the lm3s1p51 to a low-power state during extended periods of inactivity. with a power-up/power-down sequencer, a continuous time counter (rtc), a pair of match registers, an apb interface to the system bus, and dedicated non-volatile memory, the hibernation module positions the lm3s1p51 microcontroller perfectly for battery applications. 39 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller in addition, the lm3s1p51 microcontroller offers the advantages of arm's widely available development tools, system-on-chip (soc) infrastructure ip applications, and a large user community. additionally, the microcontroller uses arm's thumb?-compatible thumb-2 instruction set to reduce memory requirements and, thereby, cost. finally, the lm3s1p51 microcontroller is code-compatible to all members of the extensive stellaris family; providing flexibility to fit our customers' precise needs. texas instruments offers a complete solution to get to market quickly, with evaluation and development boards, white papers and application notes, an easy-to-use peripheral driver library, and a strong support, sales, and distributor network. see ordering and contact information on page 1017 for ordering information for stellaris family devices. 1.1 functional overview the following sections provide an overview of the features of the lm3s1p51 microcontroller. the page number in parentheses indicates where that feature is discussed in detail. ordering and support information can be found in ordering and contact information on page 1017. 1.1.1 arm cortex-m3 the following sections provide an overview of the arm cortex-m3 processor core and instruction set, the integrated system timer (systick) and the nested vectored interrupt controller. 1.1.1.1 processor core (see page 60) all members of the stellaris product family, including the lm3s1p51 microcontroller, are designed around an arm cortex-m3 processor core. the arm cortex-m3 processor provides the core for a high-performance, low-cost platform that meets the needs of minimal memory implementation, reduced pin count, and low power consumption, while delivering outstanding computational performance and exceptional system response to interrupts. 32-bit arm cortex-m3 architecture optimized for small-footprint embedded applications outstanding processing performance combined with fast interrupt handling thumb-2 mixed 16-/32-bit instruction set delivers the high performance expected of a 32-bit arm core in a compact memory size usually associated with 8- and 16-bit devices, typically in the range of a few kilobytes of memory for microcontroller-class applications C single-cycle multiply instruction and hardware divide C atomic bit manipulation (bit-banding), delivering maximum memory utilization and streamlined peripheral control C unaligned data access, enabling data to be efficiently packed into memory fast code execution permits slower processor clock or increases sleep mode time harvard architecture characterized by separate buses for instruction and data efficient processor core, system and memories hardware division and fast multiplier deterministic, high-performance interrupt handling for time-critical applications march 20, 2011 40 texas instruments-advance information architectural overview memory protection unit (mpu) to provide a privileged mode for protected operating system functionality enhanced system debug with extensive breakpoint and trace capabilities serial wire debug and serial wire trace reduce the number of pins required for debugging and tracing migration from the arm7 processor family for better performance and power efficiency optimized for single-cycle flash memory usage ultra-low power consumption with integrated sleep modes 80-mhz operation 1.25 dmips/mhz 1.1.1.2 memory map (see page 79) a memory map lists the location of instructions and data in memory. the memory map for the lm3s1p51 controller can be found in memory model on page 79. register addresses are given as a hexadecimal increment, relative to the module's base address as shown in the memory map. 1.1.1.3 system timer (systick) (see page 103) arm cortex-m3 includes an integrated system timer, systick. systick provides a simple, 24-bit, clear-on-write, decrementing, wrap-on-zero counter with a flexible control mechanism. the counter can be used in several different ways, for example: an rtos tick timer that fires at a programmable rate (for example, 100 hz) and invokes a systick routine a high-speed alarm timer using the system clock a variable rate alarm or signal timerthe duration is range-dependent on the reference clock used and the dynamic range of the counter a simple counter used to measure time to completion and time used an internal clock-source control based on missing/meeting durations. 1.1.1.4 nested vectored interrupt controller (nvic) (see page 104) the lm3s1p51 controller includes the arm nested vectored interrupt controller (nvic). the nvic and cortex-m3 prioritize and handle all exceptions in handler mode. the processor state is automatically stored to the stack on an exception and automatically restored from the stack at the end of the interrupt service routine (isr). the interrupt vector is fetched in parallel to the state saving, enabling efficient interrupt entry. the processor supports tail-chaining, meaning that back-to-back interrupts can be performed without the overhead of state saving and restoration. software can set eight priority levels on 7 exceptions (system handlers) and 47 interrupts. deterministic, fast interrupt processing: always 12 cycles, or just 6 cycles with tail-chaining external non-maskable interrupt signal (nmi) available for immediate execution of nmi handler for safety critical applications 41 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller dynamically reprioritizable interrupts exceptional interrupt handling via hardware implementation of required register manipulations 1.1.1.5 system control block (scb) (see page 106) the scb provides system implementation information and system control, including configuration, control, and reporting of system exceptions. 1.1.1.6 memory protection unit (mpu) (see page 106) the mpu supports the standard arm7 protected memory system architecture (pmsa) model. the mpu provides full support for protection regions, overlapping protection regions, access permissions, and exporting memory attributes to the system. 1.1.2 on-chip memory the following sections describe the on-chip memory modules. 1.1.2.1 sram (see page 311) the lm3s1p51 microcontroller provides 24 kb of single-cycle on-chip sram. the internal sram of the stellaris devices is located at offset 0x2000.0000 of the device memory map. because read-modify-write (rmw) operations are very time consuming, arm has introduced bit-banding technology in the cortex-m3 processor. with a bit-band-enabled processor, certain regions in the memory map (sram and peripheral space) can use address aliases to access individual bits in a single, atomic operation. data can be transferred to and from the sram using the micro direct memory access controller (dma). 1.1.2.2 flash memory (see page 313) the lm3s1p51 microcontroller provides 64 kb of single-cycle on-chip flash memory (above 50 mhz, the flash memory can be accessed in a single cycle as long as the code is linear; branches incur a one-cycle stall). the flash memory is organized as a set of 1-kb blocks that can be individually erased. erasing a block causes the entire contents of the block to be reset to all 1s. these blocks are paired into a set of 2-kb blocks that can be individually protected. the blocks can be marked as read-only or execute-only, providing different levels of code protection. read-only blocks cannot be erased or programmed, protecting the contents of those blocks from being modified. execute-only blocks cannot be erased or programmed, and can only be read by the controller instruction fetch mechanism, protecting the contents of those blocks from being read by either the controller or by a debugger. 1.1.2.3 rom (see page 311) the lm3s1p51 rom is preprogrammed with the following software and programs: stellaris peripheral driver library stellaris boot loader advanced encryption standard (aes) cryptography tables cyclic redundancy check (crc) error-detection functionality march 20, 2011 42 texas instruments-advance information architectural overview the stellaris peripheral driver library is a royalty-free software library for controlling on-chip peripherals with a boot-loader capability. the library performs both peripheral initialization and control functions, with a choice of polled or interrupt-driven peripheral support. in addition, the library is designed to take full advantage of the stellar interrupt performance of the arm cortex-m3 core. no special pragmas or custom assembly code prologue/epilogue functions are required. for applications that require in-field programmability, the royalty-free stellaris boot loader can act as an application loader and support in-field firmware updates. the advanced encryption standard (aes) is a publicly defined encryption standard used by the u.s. government. aes is a strong encryption method with reasonable performance and size. in addition, it is fast in both hardware and software, is fairly easy to implement, and requires little memory. the texas instruments encryption package is available with full source code, and is based on lesser general public license (lgpl) source. an lgpl means that the code can be used within an application without any copyleft implications for the application (the code does not automatically become open source). modifications to the package source, however, must be open source. crc (cyclic redundancy check) is a technique to validate a span of data has the same contents as when previously checked. this technique can be used to validate correct receipt of messages (nothing lost or modified in transit), to validate data after decompression, to validate that flash memory contents have not been changed, and for other cases where the data needs to be validated. a crc is preferred over a simple checksum (e.g. xor all bits) because it catches changes more readily. 1.1.3 serial communications peripherals the lm3s1p51 controller supports both asynchronous and synchronous serial communications with: three uarts with irda and iso 7816 support (one uart with full modem controls) two i 2 c modules two synchronous serial interface modules (ssi) integrated interchip sound (i 2 s) module the following sections provide more detail on each of these communications functions. 1.1.3.1 uart (see page 610) a universal asynchronous receiver/transmitter (uart) is an integrated circuit used for rs-232c serial communications, containing a transmitter (parallel-to-serial converter) and a receiver (serial-to-parallel converter), each clocked separately. the lm3s1p51 microcontroller includes three fully programmable 16c550-type uarts. although the functionality is similar to a 16c550 uart, this uart design is not register compatible. the uart can generate individually masked interrupts from the rx, tx, modem status, and error conditions. the module generates a single combined interrupt when any of the interrupts are asserted and are unmasked. the three uarts have the following features: programmable baud-rate generator allowing speeds up to 5 mbps for regular speed (divide by 16) and 10 mbps for high speed (divide by 8) separate 16x8 transmit (tx) and receive (rx) fifos to reduce cpu interrupt service loading 43 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller programmable fifo length, including 1-byte deep operation providing conventional double-buffered interface fifo trigger levels of 1/8, 1/4, 1/2, 3/4, and 7/8 standard asynchronous communication bits for start, stop, and parity line-break generation and detection fully programmable serial interface characteristics C 5, 6, 7, or 8 data bits C even, odd, stick, or no-parity bit generation/detection C 1 or 2 stop bit generation irda serial-ir (sir) encoder/decoder providing C programmable use of irda serial infrared (sir) or uart input/output C support of irda sir encoder/decoder functions for data rates up to 115.2 kbps half-duplex C support of normal 3/16 and low-power (1.41-2.23 s) bit durations C programmable internal clock generator enabling division of reference clock by 1 to 256 for low-power mode bit duration support for communication with iso 7816 smart cards full modem handshake support (on uart1) lin protocol support standard fifo-level and end-of-transmission interrupts efficient transfers using micro direct memory access controller (dma) C separate channels for transmit and receive C receive single request asserted when data is in the fifo; burst request asserted at programmed fifo level C transmit single request asserted when there is space in the fifo; burst request asserted at programmed fifo level 1.1.3.2 i 2 c (see page 714) the inter-integrated circuit (i 2 c) bus provides bi-directional data transfer through a two-wire design (a serial data line sda and a serial clock line scl). the i 2 c bus interfaces to external i 2 c devices such as serial memory (rams and roms), networking devices, lcds, tone generators, and so on. the i 2 c bus may also be used for system testing and diagnostic purposes in product development and manufacture. march 20, 2011 44 texas instruments-advance information architectural overview each device on the i 2 c bus can be designated as either a master or a slave. each i 2 c module supports both sending and receiving data as either a master or a slave and can operate simultaneously as both a master and a slave. both the i 2 c master and slave can generate interrupts. the lm3s1p51 microcontroller includes two i 2 c modules with the following features: devices on the i 2 c bus can be designated as either a master or a slave C supports both transmitting and receiving data as either a master or a slave C supports simultaneous master and slave operation four i 2 c modes C master transmit C master receive C slave transmit C slave receive two transmission speeds: standard (100 kbps) and fast (400 kbps) master and slave interrupt generation C master generates interrupts when a transmit or receive operation completes (or aborts due to an error) C slave generates interrupts when data has been transferred or requested by a master or when a start or stop condition is detected master with arbitration and clock synchronization, multimaster support, and 7-bit addressing mode 1.1.3.3 ssi (see page 671) synchronous serial interface (ssi) is a four-wire bi-directional communications interface that converts data between parallel and serial. the ssi module performs serial-to-parallel conversion on data received from a peripheral device, and parallel-to-serial conversion on data transmitted to a peripheral device. the ssi module can be configured as either a master or slave device. as a slave device, the ssi module can also be configured to disable its output, which allows a master device to be coupled with multiple slave devices. the tx and rx paths are buffered with separate internal fifos. the ssi module also includes a programmable bit rate clock divider and prescaler to generate the output serial clock derived from the ssi module's input clock. bit rates are generated based on the input clock and the maximum bit rate is determined by the connected peripheral. the lm3s1p51 microcontroller includes two ssi modules with the following features: programmable interface operation for freescale spi, microwire, or texas instruments synchronous serial interfaces master or slave operation programmable clock bit rate and prescaler 45 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller separate transmit and receive fifos, each 16 bits wide and 8 locations deep programmable data frame size from 4 to 16 bits internal loopback test mode for diagnostic/debug testing standard fifo-based interrupts and end-of-transmission interrupt efficient transfers using micro direct memory access controller (dma) C separate channels for transmit and receive C receive single request asserted when data is in the fifo; burst request asserted when fifo contains 4 entries C transmit single request asserted when there is space in the fifo; burst request asserted when fifo contains 4 entries 1.1.3.4 inter-integrated circuit sound (i 2 s) interface (see page 751) the i 2 s interface is a configurable serial audio core that contains a transmit module and a receive module. the module is configurable for the i 2 s as well as left-justified and right-justified serial audio formats. data can be in one of four modes: stereo, mono, compact 16-bit stereo and compact 8-bit stereo. the transmit and receive modules each have an 8-entry audio-sample fifo. an audio sample can consist of a left and right stereo sample, a mono sample, or a left and right compact stereo sample. in compact 16-bit stereo, each fifo entry contains both the 16-bit left and 16-bit right samples, allowing efficient data transfers and requiring less memory space. in compact 8-bit stereo, each fifo entry contains an 8-bit left and an 8-bit right sample, reducing memory requirements further. both the transmitter and receiver are capable of being a master or a slave. the stellaris i 2 s interface has the following features: configurable audio format supporting i 2 s, left-justification, and right-justification configurable sample size from 8 to 32 bits mono and stereo support 8-, 16-, and 32-bit fifo interface for packing memory independent transmit and receive 8-entry fifos configurable fifo-level interrupt and dma requests independent transmit and receive mclk direction control transmit and receive internal mclk sources independent transmit and receive control for serial clock and word select mclk and sclk can be independently set to master or slave configurable transmit zero or last sample when fifo empty march 20, 2011 46 texas instruments-advance information architectural overview efficient transfers using micro direct memory access controller (dma) C separate channels for transmit and receive C burst requests C channel requests asserted when fifo contains required amount of data 1.1.4 system integration the lm3s1p51 microcontroller provides a variety of standard system functions integrated into the device, including: direct memory access controller (dma) system control and clocks including on-chip precision 16-mhz oscillator four 32-bit timers (up to eight 16-bit) eight capture compare pwm pins (ccp) lower-power battery-backed hibernation module real-time clock in hibernation module two watchdog timers C one timer runs off the main oscillator C one timer runs off the precision internal oscillator up to 67 gpios, depending on configuration C highly flexible pin muxing allows use as gpio or one of several peripheral functions C independently configurable to 2, 4 or 8 ma drive capability C up to 4 gpios can have 18 ma drive capability the following sections provide more detail on each of these functions. 1.1.4.1 direct memory access (see page 346) the lm3s1p51 microcontroller includes a direct memory access (dma) controller, known as micro-dma (dma). the dma controller provides a way to offload data transfer tasks from the cortex-m3 processor, allowing for more efficient use of the processor and the available bus bandwidth. the dma controller can perform transfers between memory and peripherals. it has dedicated channels for each supported on-chip module and can be programmed to automatically perform transfers between peripherals and memory as the peripheral is ready to transfer more data. the dma controller provides the following features: arm primecell ? 32-channel configurable dma controller support for memory-to-memory, memory-to-peripheral, and peripheral-to-memory in multiple transfer modes C basic for simple transfer scenarios C ping-pong for continuous data flow C scatter-gather for a programmable list of arbitrary transfers initiated from a single request 47 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller highly flexible and configurable channel operation C independently configured and operated channels C dedicated channels for supported on-chip modules C primary and secondary channel assignments C one channel each for receive and transmit path for bidirectional modules C dedicated channel for software-initiated transfers C per-channel configurable priority scheme C optional software-initiated requests for any channel two levels of priority design optimizations for improved bus access performance between dma controller and the processor core C dma controller access is subordinate to core access C ram striping C peripheral bus segmentation data sizes of 8, 16, and 32 bits transfer size is programmable in binary steps from 1 to 1024 source and destination address increment size of byte, half-word, word, or no increment maskable peripheral requests 1.1.4.2 system control and clocks (see page 181) system control determines the overall operation of the device. it provides information about the device, controls power-saving features, controls the clocking of the device and individual peripherals, and handles reset detection and reporting. device identification information: version, part number, sram size, flash memory size, and so on power control C on-chip fixed low drop-out (ldo) voltage regulator C hibernation module handles the power-up/down 3.3 v sequencing and control for the core digital logic and analog circuits C low-power options for microcontroller: sleep and deep-sleep modes with clock gating C low-power options for on-chip modules: software controls shutdown of individual peripherals and memory C 3.3-v supply brown-out detection and reporting via interrupt or reset march 20, 2011 48 texas instruments-advance information architectural overview multiple clock sources for microcontroller system clock C precision oscillator (piosc): on-chip resource providing a 16 mhz 1% frequency at room temperature ? 16 mhz 3% across temperature ? can be recalibrated with 7-bit trim resolution ? software power down control for low power modes C main oscillator (mosc): a frequency-accurate clock source by one of two means: an external single-ended clock source is connected to the osc0 input pin, or an external crystal is connected across the osc0 input and osc1 output pins. ? external oscillator used with or without on-chip pll: select supported frequencies from 1 mhz to 16.384 mhz. ? external crystal: from dc to maximum device speed C internal 30-khz oscillator: on chip resource providing a 30 khz 50% frequency, used during power-saving modes C 32.768-khz external oscillator for the hibernation module: eliminates need for additional crystal for main clock source flexible reset sources C power-on reset (por) C reset pin assertion C brown-out reset (bor) detector alerts to system power drops C software reset C watchdog timer reset C mosc failure 1.1.4.3 programmable timers (see page 460) programmable timers can be used to count or time external events that drive the timer input pins. each gptm block provides two 16-bit timers/counters that can be configured to operate independently as timers or event counters, or configured to operate as one 32-bit timer or one 32-bit real-time clock (rtc). timers can also be used to trigger analog-to-digital (adc) conversions. the general-purpose timer module (gptm) contains four gptm blocks with the following functional options: operating modes: C 16- or 32-bit programmable one-shot timer C 16- or 32-bit programmable periodic timer C 16-bit general-purpose timer with an 8-bit prescaler C 32-bit real-time clock (rtc) when using an external 32.768-khz clock as the input C 16-bit input-edge count- or time-capture modes 49 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller C 16-bit pwm mode with software-programmable output inversion of the pwm signal count up or down eight capture compare pwm pins (ccp) daisy chaining of timer modules to allow a single timer to initiate multiple timing events adc event trigger user-enabled stalling when the microcontroller asserts cpu halt flag during debug (excluding rtc mode) ability to determine the elapsed time between the assertion of the timer interrupt and entry into the interrupt service routine. efficient transfers using micro direct memory access controller (dma) C dedicated channel for each timer C burst request generated on timer interrupt 1.1.4.4 ccp pins (see page 467) capture compare pwm pins (ccp) can be used by the general-purpose timer module to time/count external events using the ccp pin as an input. alternatively, the gptm can generate a simple pwm output on the ccp pin. the lm3s1p51 microcontroller includes eight capture compare pwm pins (ccp) that can be programmed to operate in the following modes: capture: the gp timer is incremented/decremented by programmed events on the ccp input. the gp timer captures and stores the current timer value when a programmed event occurs. compare: the gp timer is incremented/decremented by programmed events on the ccp input. the gp timer compares the current value with a stored value and generates an interrupt when a match occurs. pwm: the gp timer is incremented/decremented by the system clock. a pwm signal is generated based on a match between the counter value and a value stored in a match register and is output on the ccp pin. 1.1.4.5 hibernation module (see page 282) the hibernation module provides logic to switch power off to the main processor and peripherals and to wake on external or time-based events. the hibernation module includes power-sequencing logic and has the following features: 32-bit real-time counter (rtc) C two 32-bit rtc match registers for timed wake-up and interrupt generation C rtc predivider trim for making fine adjustments to the clock rate two mechanisms for power control C system power control using discrete external regulator march 20, 2011 50 texas instruments-advance information architectural overview C on-chip power control using internal switches under register control dedicated pin for waking using an external signal rtc operational and hibernation memory valid as long as v bat is valid low-battery detection, signaling, and interrupt generation clock source from a 32.768-khz external oscillator or a 4.194304-mhz crystal; 32.768-khz external oscillator can be used for main controller clock 64 32-bit words of non-volatile memory to save state during hibernation programmable interrupts for rtc match, external wake, and low battery events 1.1.4.6 watchdog timers (see page 506) a watchdog timer is used to regain control when a system has failed due to a software error or to the failure of an external device to respond in the expected way. the stellaris watchdog timer can generate an interrupt or a reset when a time-out value is reached. in addition, the watchdog timer is arm firm-compliant and can be configured to generate an interrupt to the microcontroller on its first time-out, and to generate a reset signal on its second time-out. once the watchdog timer has been configured, the lock register can be written to prevent the timer configuration from being inadvertently altered. the lm3s1p51 microcontroller has two watchdog timer modules: watchdog timer 0 uses the system clock for its timer clock; watchdog timer 1 uses the piosc as its timer clock. the stellaris watchdog timer module has the following features: 32-bit down counter with a programmable load register separate watchdog clock with an enable programmable interrupt generation logic with interrupt masking lock register protection from runaway software reset generation logic with an enable/disable user-enabled stalling when the microcontroller asserts the cpu halt flag during debug 1.1.4.7 programmable gpios (see page 404) general-purpose input/output (gpio) pins offer flexibility for a variety of connections. the stellaris gpio module is comprised of nine physical gpio blocks, each corresponding to an individual gpio port. the gpio module is firm-compliant (compliant to the arm foundation ip for real-time microcontrollers specification) and supports 0-67 programmable input/output pins. the number of gpios available depends on the peripherals being used (see signal tables on page 898 for the signals available to each gpio pin). up to 67 gpios, depending on configuration highly flexible pin muxing allows use as gpio or one of several peripheral functions 5-v-tolerant in input configuration fast toggle capable of a change every two clock cycles 51 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller two means of port access: either advanced high-performance bus (ahb) with better back-to-back access performance, or the legacy advanced peripheral bus (apb) for backwards-compatibility with existing code programmable control for gpio interrupts C interrupt generation masking C edge-triggered on rising, falling, or both C level-sensitive on high or low values bit masking in both read and write operations through address lines can be used to initiate an adc sample sequence pins configured as digital inputs are schmitt-triggered programmable control for gpio pad configuration C weak pull-up or pull-down resistors C 2-ma, 4-ma, and 8-ma pad drive for digital communication; up to four pads can be configured with an 18-ma pad drive for high-current applications C slew rate control for the 8-ma drive C open drain enables C digital input enables 1.1.5 advanced motion control the lm3s1p51 microcontroller provides motion control functions integrated into the device, including: six advanced pwm outputs for motion and energy applications four fault inputs to promote low-latency shutdown two quadrature encoder inputs (qei) the following provides more detail on these motion control functions. 1.1.5.1 pwm (see page 800) pulse width modulation (pwm) is a powerful technique for digitally encoding analog signal levels. high-resolution counters are used to generate a square wave, and the duty cycle of the square wave is modulated to encode an analog signal. typical applications include switching power supplies and motor control. the lm3s1p51 pwm module consists of three pwm generator blocks and a control block. each pwm generator block contains one timer (16-bit down or up/down counter), two comparators, a pwm signal generator, a dead-band generator, and an interrupt/adc-trigger selector. each pwm generator block produces two pwm signals that can either be independent signals or a single pair of complementary signals with dead-band delays inserted. each pwm generator has the following features: march 20, 2011 52 texas instruments-advance information architectural overview four fault-condition handling inputs to quickly provide low-latency shutdown and prevent damage to the motor being controlled one 16-bit counter C runs in down or up/down mode C output frequency controlled by a 16-bit load value C load value updates can be synchronized C produces output signals at zero and load value two pwm comparators C comparator value updates can be synchronized C produces output signals on match pwm signal generator C output pwm signal is constructed based on actions taken as a result of the counter and pwm comparator output signals C produces two independent pwm signals dead-band generator C produces two pwm signals with programmable dead-band delays suitable for driving a half-h bridge C can be bypassed, leaving input pwm signals unmodified can initiate an adc sample sequence the control block determines the polarity of the pwm signals and which signals are passed through to the pins. the output of the pwm generation blocks are managed by the output control block before being passed to the device pins. the pwm control block has the following options: pwm output enable of each pwm signal optional output inversion of each pwm signal (polarity control) optional fault handling for each pwm signal synchronization of timers in the pwm generator blocks synchronization of timer/comparator updates across the pwm generator blocks synchronization of pwm output enables across the pwm generator blocks interrupt status summary of the pwm generator blocks extended fault capabilities with multiple fault signals, programmable polarities, and filtering pwm generators can be operated independently or synchronized with other generators 53 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller 1.1.5.2 qei (see page 873) a quadrature encoder, also known as a 2-channel incremental encoder, converts linear displacement into a pulse signal. by monitoring both the number of pulses and the relative phase of the two signals, the position, direction of rotation, and speed can be tracked. in addition, a third channel, or index signal, can be used to reset the position counter. the stellaris quadrature encoder with index (qei) module interprets the code produced by a quadrature encoder wheel to integrate position over time and determine direction of rotation. in addition, it can capture a running estimate of the velocity of the encoder wheel. the input frequency of the qei inputs may be as high as 1/4 of the processor frequency (for example, 20 mhz for a 80-mhz system). the lm3s1p51 microcontroller includes two qei modules providing control of two motors at the same time with the following features: position integrator that tracks the encoder position programmable noise filter on the inputs velocity capture using built-in timer the input frequency of the qei inputs may be as high as 1/4 of the processor frequency (for example, 12.5 mhz for a 50-mhz system) interrupt generation on: C index pulse C velocity-timer expiration C direction change C quadrature error detection 1.1.6 analog the lm3s1p51 microcontroller provides analog functions integrated into the device, including: two 10-bit analog-to-digital converters (adc) with 16 analog input channels and a sample rate of one million samples/second two analog comparators 16 digital comparators on-chip voltage regulator the following provides more detail on these analog functions. 1.1.6.1 adc (see page 531) an analog-to-digital converter (adc) is a peripheral that converts a continuous analog voltage to a discrete digital number. the stellaris adc module features 10-bit conversion resolution and supports 16 input channels plus an internal temperature sensor. four buffered sample sequencers allow rapid sampling of up to 16 analog input sources without controller intervention. each sample sequencer provides flexible programming with fully configurable input source, trigger events, interrupt generation, and sequencer priority. each adc module has a digital comparator function that allows the conversion value to be diverted to a comparison unit that provides eight digital comparators. march 20, 2011 54 texas instruments-advance information architectural overview the lm3s1p51 microcontroller provides two adc modules with the following features: 16 shared analog input channels single-ended and differential-input configurations on-chip internal temperature sensor maximum sample rate of one million samples/second optional phase shift in sample time programmable from 22.5o to 337.5o four programmable sample conversion sequencers from one to eight entries long, with corresponding conversion result fifos flexible trigger control C controller (software) C timers C analog comparators C pwm C gpio hardware averaging of up to 64 samples for improved accuracy digital comparison unit providing eight digital comparators converter uses an internal 3-v reference or an external reference power and ground for the analog circuitry is separate from the digital power and ground efficient transfers using micro direct memory access controller (dma) C dedicated channel for each sample sequencer C adc module uses burst requests for dma 1.1.6.2 analog comparators (see page 787) an analog comparator is a peripheral that compares two analog voltages and provides a logical output that signals the comparison result. the lm3s1p51 microcontroller provides two independent integrated analog comparators that can be configured to drive an output or generate an interrupt or adc event. the comparator can provide its output to a device pin, acting as a replacement for an analog comparator on the board, or it can be used to signal the application via interrupts or triggers to the adc to cause it to start capturing a sample sequence. the interrupt generation and adc triggering logic is separate. this means, for example, that an interrupt can be generated on a rising edge and the adc triggered on a falling edge. the lm3s1p51 microcontroller provides two independent integrated analog comparators with the following functions: 55 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller compare external pin input to external pin input or to internal programmable voltage reference compare a test voltage against any one of the following voltages: C an individual external reference voltage C a shared single external reference voltage C a shared internal reference voltage 1.1.7 jtag and arm serial wire debug (see page 169) the joint test action group (jtag) port is an ieee standard that defines a test access port and boundary scan architecture for digital integrated circuits and provides a standardized serial interface for controlling the associated test logic. the tap, instruction register (ir), and data registers (dr) can be used to test the interconnections of assembled printed circuit boards and obtain manufacturing information on the components. the jtag port also provides a means of accessing and controlling design-for-test features such as i/o pin observation and control, scan testing, and debugging. texas instruments replaces the arm sw-dp and jtag-dp with the arm serial wire jtag debug port (swj-dp) interface. the swj-dp interface combines the swd and jtag debug ports into one module providing all the normal jtag debug and test functionality plus real-time access to system memory without halting the core or requiring any target resident code. the swj-dp interface has the following features: ieee 1149.1-1990 compatible test access port (tap) controller four-bit instruction register (ir) chain for storing jtag instructions ieee standard instructions: bypass, idcode, sample/preload, extest and intest arm additional instructions: apacc, dpacc and abort integrated arm serial wire debug (swd) C serial wire jtag debug port (swj-dp) C flash patch and breakpoint (fpb) unit for implementing breakpoints C data watchpoint and trace (dwt) unit for implementing watchpoints, trigger resources, and system profiling C instrumentation trace macrocell (itm) for support of printf style debugging C trace port interface unit (tpiu) for bridging to a trace port analyzer 1.1.8 packaging and temperature industrial-range 100-pin rohs-compliant lqfp package industrial-range 108-ball rohs-compliant bga package 1.2 target applications the stellaris family is positioned for cost-conscious applications requiring significant control processing and connectivity capabilities such as: march 20, 2011 56 texas instruments-advance information architectural overview test and measurement equipment factory automation hvac and building control gaming equipment motion control medical instrumentation fire and security power and energy transportation 1.3 high-level block diagram figure 1-1 on page 58 depicts the features on the stellaris lm3s1p51 microcontroller. note that there are two on-chip buses that connect the core to the peripherals. the advanced peripheral bus (apb) bus is the legacy bus. the advanced high-performance bus (ahb) bus provides better back-to-back access performance than the apb bus. 57 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller figure 1-1. stellaris lm3s1p51 microcontroller high-level block diagram march 20, 2011 58 texas instruments-advance information architectural overview lm3s1p51 arm? cor te x?-m3 (80 mhz) nvic mpu flash (64 kb) boot loader dr iv erlib aes & crc r om dcode b us icode b us jt a g/swd system control and cloc ks (w/ precis . osc.) bus matr ix system bus sram (24 kb) system peripherals w atchdog timers (2) dma hiber nation module gener al- pur pose timers (4) gpios (67) serial peripherals u ar ts (3) i2c (2) ssi (2) i2s analog peripherals adc channels (16) analog compar ators (2) mo tion contr ol peripherals qei (2) pwm (6) adv anced p er ipher al bus (apb) adv anced high-p erf or mance bus (ahb) 1.4 hardware details details on the pins and package can be found in the following sections: pin diagram on page 896 signal tables on page 898 operating characteristics on page 963 electrical characteristics on page 964 package information on page 1019 59 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller 2 the cortex-m3 processor the arm? cortex?-m3 processor provides a high-performance, low-cost platform that meets the system requirements of minimal memory implementation, reduced pin count, and low power consumption, while delivering outstanding computational performance and exceptional system response to interrupts. features include: 32-bit arm ? cortex ? -m3 architecture optimized for small-footprint embedded applications outstanding processing performance combined with fast interrupt handling thumb-2 mixed 16-/32-bit instruction set delivers the high performance expected of a 32-bit arm core in a compact memory size usually associated with 8- and 16-bit devices, typically in the range of a few kilobytes of memory for microcontroller-class applications C single-cycle multiply instruction and hardware divide C atomic bit manipulation (bit-banding), delivering maximum memory utilization and streamlined peripheral control C unaligned data access, enabling data to be efficiently packed into memory fast code execution permits slower processor clock or increases sleep mode time harvard architecture characterized by separate buses for instruction and data efficient processor core, system and memories hardware division and fast multiplier deterministic, high-performance interrupt handling for time-critical applications memory protection unit (mpu) to provide a privileged mode for protected operating system functionality enhanced system debug with extensive breakpoint and trace capabilities serial wire debug and serial wire trace reduce the number of pins required for debugging and tracing migration from the arm7 processor family for better performance and power efficiency optimized for single-cycle flash memory usage ultra-low power consumption with integrated sleep modes 80-mhz operation 1.25 dmips/mhz the stellaris ? family of microcontrollers builds on this core to bring high-performance 32-bit computing to cost-sensitive embedded microcontroller applications, such as factory automation and control, industrial control power devices, building and home automation, and stepper motor control. march 20, 2011 60 texas instruments-advance information the cortex-m3 processor this chapter provides information on the stellaris implementation of the cortex-m3 processor, including the programming model, the memory model, the exception model, fault handling, and power management. for technical details on the instruction set, see the cortex?-m3 instruction set technical user's manual. 2.1 block diagram the cortex-m3 processor is built on a high-performance processor core, with a 3-stage pipeline harvard architecture, making it ideal for demanding embedded applications. the processor delivers exceptional power efficiency through an efficient instruction set and extensively optimized design, providing high-end processing hardware including single-cycle 32x32 multiplication and dedicated hardware division. to facilitate the design of cost-sensitive devices, the cortex-m3 processor implements tightly coupled system components that reduce processor area while significantly improving interrupt handling and system debug capabilities. the cortex-m3 processor implements a version of the thumb? instruction set, ensuring high code density and reduced program memory requirements. the cortex-m3 instruction set provides the exceptional performance expected of a modern 32-bit architecture, with the high code density of 8-bit and 16-bit microcontrollers. the cortex-m3 processor closely integrates a nested interrupt controller (nvic), to deliver industry-leading interrupt performance. the stellaris nvic includes a non-maskable interrupt (nmi) and provides eight interrupt priority levels. the tight integration of the processor core and nvic provides fast execution of interrupt service routines (isrs), dramatically reducing interrupt latency. the hardware stacking of registers and the ability to suspend load-multiple and store-multiple operations further reduce interrupt latency. interrupt handlers do not require any assembler stubs which removes code overhead from the isrs. tail-chaining optimization also significantly reduces the overhead when switching from one isr to another. to optimize low-power designs, the nvic integrates with the sleep modes, including deep-sleep mode, which enables the entire device to be rapidly powered down. 61 march 20, 2011 texas instruments-advance information stellaris? lm3s1p51 microcontroller figure 2-1. cpu block diagram 2.2 overview 2.2.1 system-level interface the cortex-m3 processor provides multiple interfaces using amba? technology to provide high-speed, low-latency memory accesses. the core supports unaligned data accesses and implements atomic bit manipulation that enables faster peripheral controls, system spinlocks, and thread-safe boolean data handling. the cortex-m3 processor has a memory protection unit (mpu) that provides fine-grain memory control, enabling applications to implement security privilege levels and separate code, data and stack on a task-by-task basis. 2.2.2 integrated configurable debug the cortex-m3 processor implements a complete hardware debug solution, providing high system visibility of the processor and memory through either a traditional jtag port or a 2-pin serial wire debug (swd) port that is ideal for microcontrollers and other small package devices. the stellaris implementation replaces the arm sw-dp and jtag-dp with the arm coresight?-compliant serial wire jtag debug port (swj-dp) interface. the swj-dp interface combines the swd and jtag debug ports into one module. see the arm? debug interface v5 architecture specification for details on swj-dp. for system trace, the processor integrates an instrumentation trace macrocell (itm) alongside data watchpoints and a profiling unit. to enable simple and cost-effective profiling of the system trace events, a serial wire viewer (swv) can export a stream of software-generated messages, data trace, and profiling information through a single pin. march 20, 2011 62 texas instruments-advance information the cortex-m3 processor 3 u l y d w h 3 h u l s k h u d o % x v l q w h u q d o ' d w d : d w f k s r l q w d q g 7 u d f h , q w h u u x s w v ' h e x j 6 o h h s , q v w u x p h q w d w l r q 7 u d f h 0 d f u r f h o o 7 u d f h 3 r u w , q w h u i d f h 8 q l w & |