Part Number Hot Search : 
LM258 AD526B STK12C68 C1417CG IRG4PC30 DA15CL PC923X 00100
Product Description
Full Text Search
 

To Download STR720 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  december 2004 1/401 this is preliminary information on a new product now in development or undergoing evaluation. details are subject to change wit hout notice. rev. 4.0 STR720 arm720t ? 16/32-bit mcu with 16k ram, usb, can, 3 timers, adc, 6 communications interfaces preliminary data arm720t mcu ? 32-bit risc mcu with 3-stage pipeline. ? max. cpu frequency 70 mhz ? fully instructions compatible with the arm7 family of processors ? 8 kbyte instruction + data cache, 4-way set-associative ? write buffer de-coupling cpu from system memory during write operations ? mmu for virtual to physical address mapping and memory protection memories ? 16 kbytes program ram memory ? external sdram interface for up to 128 mbytes sdram ? external memory interface (emi) for up to 8 mbytes sram, flash, rom. ? atapi interface supporting pio4 mode nested interrupt controller ? fast interrupt handling with multiple vectors ? 32 vectors with 16 irq priority levels ? 2 maskable fiq sources clock, reset and supply management ? internal system clocks generated by fully internal pll ? power management providing different operating modes: run, slow, stop, standby. 34 i/o ports ? 34 multifunctional bidirectional i/o lines ? 5 ports with interrupt capability 3 timers ? two 16-bit programmable timer modules with prescaler (f apb divided by 1 to 256) driven from internal selectable clock (oscillator or cpu clock), output compare and input capture functions. ? 16-bit watchdog timer with 8-bit prescaler 6 communications interfaces ? usb v 2.0 full speed (12mbit/s) device function with suspend and resume support ? can module compliant with the can specification v2.0 part b (active). ? two high-speed univ ersal asynchronous receiver transmitter (uart) for full-duplex asynchronous communication. ? two buffered serial peripheral interfaces (bspi) for full-duplex, synchronous, communications with external devices, master or slave operation. a/d converter ? sigma delta analog/digital converter with 11.5-bit enob resolution supporting 4 multiplexed inputs at up to 950 hz sampling rate. development tools support ? 5-pin jtag port (ieee 1149.1 standard) table 1. device summary 28 x 28 x 3.4mm pqfp208 features STR720rbq6 STR720rxh6 boot rom - bytes 4k program ram - bytes 16k operating voltage 3.0 to 3.6v for i/os and a/d, 1.8v for core and backup block operating temperature -40 to +85c package pqfp208 28x28x3.4 bga (contact marketing for details) 1 .com .com .com .com 4 .com u datasheet
table of contents 401 2/401 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2 acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3 system block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4 pin data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.1 power supply pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.2 global pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.3 jtag pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.4 port 1 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.5 port 2 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.6 port 3 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.7 port 4 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.8 main clock input pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.9 port 6 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.10 port 7 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.11 pqfp208 package pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5 architecture overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.1 enhanced interrupt controller (eic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.1.1 irq interrupt vector table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.1.2 fiq interrupt vector table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.1.3 irq interrupt vectoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2 wake-up/interrupt management unit (wiu) . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.3 dma controller (dmac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.4 dram controller (dramc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.5 external memory interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.6 atapi ide interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.7 reset and clock control unit (rccu) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.7.1 clock management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.7.2 reset management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.8 real time clock (rtc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.9 ahb-apb bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.10 clock gating control (cgc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.11 universal asynchronous receiver/transmitter (uart) . . . . . . . . . . . . . . . 42 5.12 buffered serial peripheral interface (bspi) . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.13 controller area network interface (can) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.14 universal serial bus interface (usb) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.15 watchdog timer (wdg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.16 extended function timer (eft) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.17 s-d analog to digital converter (adc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 5.18 general purpose i/o ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 5.19 dedicated pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 1 .com .com .com .com .com 4 .com u datasheet
table of contents 3/401 5.20 miscellanea registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 6 memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 6.1 program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 6.2 memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 6.3 apb bridges mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 6.3.1 asynchronous apb sub-system (a-apb) . . . . . . . . . . . . . . . . . . . . . . . . 48 6.3.2 synchronous apb sub-system (s-apb) . . . . . . . . . . . . . . . . . . . . . . . . . 50 7 enhanced interrupt controller (eic) . . . . . . . . . . . . . . . . . . . . 51 7.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 7.3.1 priority level arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 7.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 7.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 7.5 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.6 application note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.6.1 avoiding lr_sys and r5 registers content loss . . . . . . . . . . . . . . . . . . . . 68 7.6.2 hints about subroutines used inside isrs . . . . . . . . . . . . . . . . . . . . . . . 69 7.7 interrupt latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 8 wake-up interrupt unit (wiu) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 8.3.1 interrupt mode selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 8.3.2 wake-up mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 8.3.3 stop mode entering conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 8.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 8.5 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 8.6 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 8.6.1 procedure for entering/exiting stop mode . . . . . . . . . . . . . . . . . . . . . . 79 8.6.2 simultaneous setting of pending bits . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 8.6.3 dealing with level-active signals as interrupt lines . . . . . . . . . . . . . . . . . 80 9 dma controller (dmac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 9.3.1 circular mode operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 9.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 9.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 10 dram controller (dramc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 1 .com .com .com .com .com 4 .com u datasheet
table of contents 401 4/401 10.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 10.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 10.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 10.3.1 ahb interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 10.3.2 apb interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 10.3.3 refresh timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 10.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 10.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 10.5 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 11 external memory interface (emi) . . . . . . . . . . . . . . . . . . . . . . . 115 11.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 11.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 11.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 11.3.1 emi programmable timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 11.3.2 write access examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 11.3.3 read access examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 11.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 11.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 11.5 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 12 atapi-ide interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 12.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 12.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 12.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 12.4 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 12.4.1 initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 12.4.2 basic read transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 12.5 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 12.5.1 ide command block register set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 12.5.2 ide configuration register set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 12.6 timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 12.6.1 ide pio read/write cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 13 reset and clock control unit (rccu) . . . . . . . . . . . . . . . . . . . 138 13.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 13.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 13.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 13.3.1 reset management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 13.3.2 pll management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 13.3.3 mode of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 13.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 13.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 1 .com .com .com .com .com 4 .com u datasheet
table of contents 5/401 14 real time clock (rtc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 14.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 14.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 14.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 14.3.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 14.3.2 reset procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 14.3.3 free-running mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 14.3.4 configuration mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 14.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 14.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 14.5 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 15 asynchronous ahb-apb bridge (a3brg) . . . . . . . . . . . . . . . . . 160 15.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 15.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 15.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 15.3.1 peripherals clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 15.3.2 peripherals reset control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 15.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 15.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 16 uart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 16.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 16.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 16.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 16.3.1 data frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 16.3.2 transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 16.3.3 reception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 16.3.4 timeout mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 16.3.5 baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 16.3.6 interrupt control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 16.3.7 using the asc interrupts when fifos are disabled . . . . . . . . . . . . . . . . . 176 16.3.8 using the asc interrupts when fifos are enabled . . . . . . . . . . . . . . . . . 176 16.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 16.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 17 buffered spi (bspi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 17.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 17.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 17.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 17.3.1 bspi pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 17.3.2 bspi operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 17.3.3 transmit fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 1 .com .com .com .com .com 4 .com u datasheet
table of contents 401 6/401 17.3.4 receive fifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 17.3.5 start-up status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 17.3.6 clocking problems and clearing of the shift-register . . . . . . . . . . . . . . . 192 17.3.7 interrupt control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 17.3.8 dma interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 17.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 17.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 18 controller area network (can) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 18.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 18.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 18.3 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 18.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 18.4.1 software initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 18.4.2 can message transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 18.4.3 disabled automatic re-transmission mode . . . . . . . . . . . . . . . . . . . . . 205 18.4.4 test mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 18.4.5 silent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 18.4.6 loop back mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 18.4.7 loop back combined with silent mode . . . . . . . . . . . . . . . . . . . . . . . . 207 18.4.8 basic mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 18.4.9 software control of can_tx pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 18.5 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 18.5.1 can interface reset state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 18.5.2 can protocol related registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 18.5.3 message interface register sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 18.5.4 message handler registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 18.6 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 18.7 can communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 18.7.1 managing message objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 18.7.2 message handler state machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 18.7.3 configuring a transmit object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 18.7.4 updating a transmit object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 18.7.5 configuring a receive object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 18.7.6 handling received messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 18.7.7 configuring a fifo buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 18.7.8 receiving messages with fifo buffers . . . . . . . . . . . . . . . . . . . . . . . . 246 18.7.9 handling interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 18.7.10configuring the bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 18.7.11register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 19 usb slave interface (usb) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 1 .com .com .com .com .com 4 .com u datasheet
table of contents 7/401 19.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 19.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 19.3 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 19.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 19.4.1 description of usb blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 19.5 programming consideratio ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 19.5.1 generic usb device programming . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 19.5.2 system and power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 19.5.3 double-buffered endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 19.5.4 isochronous transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 19.5.5 suspend/resume events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 19.6 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 19.6.1 common registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 19.6.2 endpoint-specific registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 19.6.3 buffer descriptor table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 19.6.4 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 20 watchdog timer (wdg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 20.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 20.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 20.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 20.3.1 free-running timer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 20.3.2 watchdog mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 20.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 20.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 21 extended function timer (eft) . . . . . . . . . . . . . . . . . . . . . . . . . . 309 21.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 21.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 21.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 21.3.1 counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 21.3.2 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 21.3.3 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 21.3.4 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 21.3.5 forced compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 21.3.6 one pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 21.3.7 pulse width modulation mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 21.3.8 pulse width modulation input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 21.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 21.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 22 s-d analog/digital converter (adc) . . . . . . . . . . . . . . . . . . . . 332 22.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 1 .com .com .com .com .com 4 .com u datasheet
table of contents 401 8/401 22.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 22.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 22.3.1 normal (round-robin) operation of adc . . . . . . . . . . . . . . . . . . . . . . 333 22.3.2 single-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 22.3.3 low-rate operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 22.3.4 interrupt and dma requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 22.3.5 clock timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 22.3.6 s-d modulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 22.3.7 the sinc3 decimation filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 22.3.8 bandgap reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 22.3.9 adc input equivalent circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 22.3.10adc output coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 22.3.11power saving features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 22.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 22.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342 23 general purpose i/o ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 23.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 23.2 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 23.3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 23.3.1 input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 23.3.2 bidirectional configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 23.3.3 output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 23.3.4 alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 23.4 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 23.4.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 24 miscellanea registers (gcr - cgc - ahb_err) . . . . . . . . . . . 351 24.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 24.2 a-gcr block description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 24.3 s-gcr block description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352 24.4 cgc block description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 24.5 ahb error detection block description . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 24.5.1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 25 power reduction modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 25.1 run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 25.2 idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 25.3 slow mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 25.4 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 25.5 standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 26 system reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 26.1 reset input pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 1 .com .com .com .com .com 4 .com u datasheet
table of contents 9/401 26.2 rtcrst input pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 26.3 jtrst input pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 26.4 power-on/off and stand- by entry/exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 27 package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 28 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 28.1 parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 28.1.1 minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 28.1.2 typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 28.1.3 typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 28.1.4 loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 28.1.5 pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 28.2 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 28.3 electrical sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 28.3.1 electro-static discharge (esd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 28.3.2 static latch-up (lu) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 28.4 operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 28.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 28.6 supply current charac teristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 28.7 clock and timing characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 28.7.1 internal clock characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 28.7.2 clk pad characteristics (external clock source) . . . . . . . . . . . . . . . . . 381 28.7.3 pll characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 28.7.4 32 khz real-time clock oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 28.8 ac and dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 28.9 asynchronous reset input characteristics . . . . . . . . . . . . . . . . . . . . . . . . 386 28.10 usb - universal bus interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 28.11 s-d adc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 28.11.1adc analog input pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 28.11.2adc performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 28.12 external memory bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 28.13 sdram interface timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 29 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 .com .com .com .com .com 4 .com u datasheet
STR720 - introduction 10/401 1 introduction STR720 is an stmicroelectronics new gener ation super-integrated single-chip device. it combines the high performance of arm720t ? cpu microprocessor (revision 3) with high peripheral functionalities and enhanced i/o cap abilities. it also provides on-chip high-speed ram, clock generation via pll and several embedded custom digital logics. STR720 is software compatible with the arm processor family. it is built using 0.18 m hcmos8 process, with 1.8 v internal logic voltage and 3.3 v capable i/o lines. the arm720t ? is a member of the advanced risc machines (arm) family of general pur- pose 32-bit microprocessors combining in a single chip an 8 kbyte cache, an enlarged write buffer, and a memory management unit (mmu). the arm720t ? belongs to the arm7 family, making it software-compatible with all the arm processors. the arm architecture is based on reduced instruction set computer (risc) principles: its instruction set and related decode mechanism are much simpler than those of micro-programmed complex instruction set computers (cisc). this simplicity results in a high instruction throughput and impressive real-time interrupt response from a small and cost-effective chip. the on-chip mixed data and instruction cache, together with the write buffer, substantially rise the average execution speed and reduce the average amount of memory bandwidth required by the processor. this allows the external memory to support direct memory access (dma) channels with minimal performance loss. the mmu supports a conventional two-level, page-table structure and a number of extensions that make it ideal for embedded control, unix, and object-oriented systems. the allocation of virtual addresses with different task ids improve performance in task switching operations with the cache enabled. these relocated virtual addresses are monitored by the embedded-ice block. the memory interface is designed to allow the performance potential to be realized without incurring high costs in the memory system. speed-critical control signals are pipelined to allow system control functions to be implemented in standard low-power logic, and these control signals facilitate the exploitation of the fast local access modes offered by industry-standard drams. for more information on the arm720t core please refer to the arm720t rev 3 technical reference manual. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - acronyms 11/401 related documents: available from www.arm.com: arm720t (rev 3) technical reference manual 2 acronyms adc analog to digital converter ahb advanced high-performance bus apb advanced peripheral bus cpu central processing unit dma direct memory access eic enhanced interrupt controller eft extended function timer emi external memory interface gcr global configuration register ice in-circuit emulator irq interrupt request jtag joint test access gr oup (ieee 1149. 1 standard) pll phase-locked loop ram random access memory rom read-only memory rccu reset and clock control unit risc reduced instruct ion set computing spi serial peripheral interface bspi buffered spi uart universal asynchronous receiver transmitter wdg watch-dog unit wiu wake-up/interrupt unit 1 .com .com .com .com .com 4 .com u datasheet
STR720 - acronyms 12/401 please refer to figure 1 for an overview of the device interfaces. figure 1. STR720 pqfp package logic symbol v dd3 port 3 13 bit port 2 16 bit oscin oscout rtcrst jtdo jtdi jtms jtrst jtck a gnd v ss v dd port 1 6 bit port 4 5 bit port 6 59 bit v dd3p v ssp v dd3d v ssd v sspll v ddpll v ddrtc a vdd rstin port 7 46 bit STR720 1 .com .com .com .com .com 4 .com u datasheet
STR720 - system block diagram 13/401 3 system block diagram the figure 2: STR720 block diagram on page 13 gives an overview of the complete STR720 microcontroller, showing how arm720t processor and their peripherals are interfaced. figure 2. STR720 block diagram ahb pll v dd eft1..2 rxd[2..1] txd[2..1] eclk1 tdi tdo tms tck trst te s t / emu p o r t miso[1..2] mosi[1..2] ecs1n port1 an0 (p1.3-0) apb i/f uart1..2 apb i/f bspi1..2 apb i/f data ram (4k x 32) bridge a master i/f ahb asb slave i/f arm720 core rom (1k x 32) apb i/f port6 emi apb i/f power supply drawing not in scale an1 an2 an3 port2 dma ctrl i/f apb ahb master i/f s-apb apb bridge sync. port4 ahb i/f dramc apb i/f ahb i/f r b i t e r ahb port7 can apb i/f can ram usb apb i/f usb ram apb i/f apb bridge async. oscin oscout v dd3p mid[0..31] mia[0..13] micsn[0..3] ras cas miwen mibls[0..3] edata[0..15]/dd[0..15] eadd[1..3]/da[0..2] eadd[4..21] erdn/diorn ewr0n/diown ewr1n ecs0n ics0n ics1n iordy irq canrx cantx sck[1..2] ahb v dd3 v dd3d v ssp v ddpll v ssd v sspll v ddrtc v ss a vdd a gnd miclk miclken atapi apb i/f ahb i/f s-apb gpio a-apb wdg apb i/f eic apb i/f rccu gpio apb i/f rtc apb i/f 32 khz osc adc apb i/f port1 port1 rtcrst rstin v ddrtc dedicated supply usbck wiu apb i/f ext_boot eint0 eint1 eint2 eint3 eint4 gpio apb i/f port3 stop_req eready 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 14/401 4 pin data in the following tables, pin information are reported, including alternate function mapping and reference to package pin out. 4.1 power supply pins note1: 16 pins (1,10,46,55,66,75, 84,93,103,113,129,143,163,180,196) are v dd3 (3.3 supply). note2: 3 pins (8,59,140) are v dd (1.8 supply). note3: 19 pins (2,9,11,47,56,60,67,76 ,85,94,104,114,130,141,142, 162,181,197) are v ss (ground). 4.2 global pins in table 3 clock, reset and configuration pins of the device are reported. table 2. power supply pins symbol pin i/o function v dd3 note1 - 3.3v digital supply voltage for the i/o pads. v dd note2 - 1.8v digital supply voltage for core circuitry. v dd3p 22 - 3.3v supply voltage. v ssp 23 - ground voltage. 24 30 - reserved, must be tied to gnd. 29 31 - reserved, must be tied to gnd. v ddpll 121 - 1.8 v supply voltage for internal pll. v sspll 120 - ground voltage for internal pll. v ddrtc 159 - 1.8v digital supply voltage for rtc logic. v ss note3 - digital ground. a vdd 32 - reference voltage for the on-chip a/d converter (+3.0v/+3.6v). a gnd 37 - reference ground for the on-chip a/d converter. 28 - reserved, must be tied to gnd. 26 - reserved, must be left floating. table 3. global pins symbol pin i/o function oscin 160 i input of the 32 khz oscillator amplifier and input of the internal clock generator for rtc and wdg alternate clocks. oscout 161 o output of the 32 khz oscillator amplifier circuit. rstin (note 1) 157 i system reset input with schmitt-trigger characteristics. a low level at this pin resets asynchronously the STR720 device, except the rtc logic. this has to be driven low by an external pull-down resistor when v ddrtc is connected and the rest of the de vice is not powered. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 15/401 note1: the signal applied to this pin is internally filtered by an on-chip rc filter whose width can range from 50 ns to 500 ns. 4.3 jtag pins in table 4 the pins related to the jtag interface are listed. note1: the signal applied to this pin is internally filtered by an on-chip rc filter whose width can range from 50 ns to 500 ns. 4.4 port 1 pins port 1 is an analog port connected to the 4 analog input channels of the on-chip a/d converter are available. rtcrst (note 1) 158 i rtc reset input with schmit t-trigger characteristics. a low level at this pin asynchronously resets the rtc registers. table 4. jtag/emu pins symbol pin i/o function jtdo 42 o arm720 jtag test data out. jtdo is a test data serial output signal used for test instructions and data. jtck 39 i arm720 jtag test clock. jtck is a test input used to synchronize the jtag test logic. jtms 40 i arm720 jtag test mode select. jtms is an input signal used to sequence the test controller?s state machine. jtms is sampled on the rising edge of jtck. jtdi 41 i arm720 jtag test data in. jtdi is test data serial input used for test instructions and data. jtdi is sampled on the rising edge of jtck. jtrst (note 1) 38 i arm720 jtag test circuit reset. jtrst is an active low schmitt-trigger input signal used to asynchronously initialize the test controller. table 5. port 1 pins symbol pin i/o function p1.0 33 i a/d . analog input channel 0 ( ana0 ). p1.1 34 i a/d . analog input channel 1 ( ana1 ). p1.2 35 i a/d . analog input channel 2 ( ana2 ). p1.3 36 i a/d . analog input channel 3 ( ana3 ). p1.4 27 o reserved. p1.5 25 o reserved. table 3. global pins symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 16/401 4.5 port 2 pins port 2 consists of 16 bidirectional general pu rpose i/o pins. they are under arm720 control through a configuration register, a data register and a direction register. these registers are read/write registers. port lines can be indivi dually configured as general purpose inputs, general purpose outputs or dedicated peripheral lines. the port can be read at any time: input lines return the pin level; output lines return the level of the output driver input. when written, the port stores the data in an internal register: it drives the pins only if they are configured as general purpose outputs. port 2 outputs can be configured as push/pull or open drain drivers. table 6. port 2 pins symbol pin i/o function p2.0 122 i/o port 2 general purpose input/output data line 0. i uart1 . receive data input ( rxd1 ). p2.1 123 i/o port 2 general purpose input/output data line 1. o uart1 . transmit data output ( txd1 ). p2.2 124 i/o port 2 general purpose input/output data line 2. i uart2 . receive data input ( rxd2 ). p2.3 125 i/o port 2 general purpose input/output data line 3. o uart2 . transmit data output ( txd2 ). p2.4 126 i/o port 2 general purpose input/output data line 4. i bspi1 . master mode. master i nput/slave output line ( miso1 ). o bspi1 . slave mode. master input/slave output line ( miso1 ). p2.5 127 i/o port 2 general purpose input/output data line 5. o bspi1 . master mode. master output/slave input line ( mosi1 ). i bspi1 . slave mode. master output/slave input line ( mosi1 ). p2.6 128 i/o port 2 general purpose input/output data line 6. o bspi 1. master mode. output serial clock ( sck 1). i bspi1 . slave mode. input serial clock ( sck 1). p2.7 131 i/o port 2 general purpose input/output data line 7. i bspi2 . master mode. master i nput/slave output line ( miso2 ). o bspi2 . slave mode. master input/slave output line ( miso2 ). p2.8 132 i/o port 2 general purpose input/output data line 8. o bspi2 . master mode. master output/slave input line ( mosi2 ). i bspi2 . slave mode. master output/slave input line ( mosi2 ). p2.9 133 i/o port 2 general purpose input/output data line 9. o bspi 2. master mode. output serial clock ( sck 2). i bspi2 . slave mode. input serial clock ( sck 2). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 17/401 4.6 port 3 pins port 3 consists of 13 bidirectional general purpose i/o pins. they are controlled through a configuration register, a data register and a di rection register. these registers are read/write registers. port lines can be individually configured as general purpose inputs, general purpose outputs or dedicated peripheral lines. the port can be read at any time: input lines return the pin level; output lines return the level of the output driver input. when written, the port stores the data in an internal register: it drives the pins only if they are configured as general purpose outputs. port 3 outputs can be configured as push/pull or open drain drivers. p2.10 134 i/o port 2 general purpose input/output data line 10. i usb . usb interface 48 mhz clock input (usbck ). p2.11 135 i/o port 2 general purpose input/output data line 11. i can . can module receive pin (canrx ). p2.12 136 i/o port 2 general purpose input/output data line 12. o can . can module transmit pin (cantx ). p2.13 137 i/o port 2 general purpose input/output data line 13. i eft1 . timer 1 external clock input line (eclk1 ). p2.14 138 i/o port 2 general purpose input/output data line 14. i/o usb . usb interface d- signal (usbdm ). the usage of this alternate function require a special programming of gpio registers. p2.15 139 i/o port 2 general purpose input/output data line 15. i/o usb . usb interface d+ signal (usbdp ). the usage of this alternate function require a special programming of gpio registers. table 7. port 3 pins symbol pin i/o function p3.0 144 i/o port 3 general purpose input/output line 0. p3.1 145 i/o port 3 general purpose input/output line 1. p3.2 146 i/o port 3 general purpose input/output line 2. p3.3 147 i/o port 3 general purp ose input/output data line 3. p3.4 148 i/o port 3 general purp ose input/output data line 4. p3.5 149 i/o port 3 general purp ose input/output data line 5. p3.6 150 i/o port 3 general purp ose input/output data line 6. i sys ext_boot . external boot mode selection. the state of this pin is sampled at reset. p3.7 151 i/o port 3 general purp ose input/output data line 7. o wiu. stop mode request, active low (stop_req ). table 6. port 2 pins (continued) symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 18/401 4.7 port 4 pins port 4 consists of 5 bidirectional general pu rpose i/o pins. they are under arm720 control through a configuration register, a data register and a direction register. these registers are read/write registers. port lines can be indivi dually configured as general purpose inputs, general purpose outputs or dedicated peripheral lines. the port can be read at any time: input lines return the pin level; output lines return the level of the output driver input. when written, the port stores the data in an internal register: it drives the pins only if they are configured as general purpose outputs. port 4 outputs can be configured as push/pull or open drain drivers. p3.8 152 i/o port 3 general purp ose input/output data line 8. i external interrupt 0 ( eint0 ). p3.9 153 i/o port 3 general purp ose input/output data line 9. i external interrupt 1( eint1? ). i bspi1 . slave mode. slave select line ( ss1 ). p3.10 154 i/o port 3 general pu rpose input/output data line 10. i external interrupt 2 ( eint2 ). i bspi2 . slave mode. slave select line ( ss2 ). p3.11 155 i/o port 3 general pu rpose input/output data line 11. i external interrupt 3 ( eint3 ). o rccu . pll lock status (pll_lock). p3.12 156 i/o port 3 general pu rpose input/output data line 12. i external interrupt 4 ( eint4 ). i eft2 timer 2 input capture line b (icapb2 ). table 8. port 4 pins symbol pin i/o function p4.0 16 i/o port 4 general purp ose input/output data line 0. i emi external ready signal ( eready ). p4.1 15 i/o port 4 general purp ose input/output data line 1. p4.2 14 i/o port 4 general purp ose input/output data line 2. p4.3 13 i/o port 4 general purp ose input/output data line 3. p4.4 12 i/o port 4 general purp ose input/output data line 4. o emi active low chip select - bank 1 ( ecs1n ). table 7. port 3 pins (continued) symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 19/401 4.8 main clock input pins 4.9 port 6 pins port 6 is a configurable 8/16/32-bit interface port used by the synchronous dram memory interface. dramc is under STR720 control through configuration registers. port lines are permanently assigned to the relevant pins and they are listed in the following table. table 9. main clock input pins symbol pin) i/o function clk 17 i-p this pin is used as main system clock source. 18 i-p reserved, must be tied to gnd. 20 i-p reserved, must be tied to gnd. 21 i-p reserved, must be tied to gnd. vref 19 i clk input reference voltage table 10. port 6 pins symbol pin i/o function p6.0 108 i/o sdram data line 0 ( mid[0] ). p6.1 107 i/o sdram data line 1 ( mid[1] ). p6.2 106 i/o sdram data line 2 ( mid[2] ). p6.3 105 i/o sdram data line 3 ( mid[3] ). p6.4 102 i/o sdram data line 4 ( mid[4] ). p6.5 101 i/o sdram data line 5 ( mid[5] ). p6.6 100 i/o sdram data line 6 ( mid[6] ). p6.7 99 i/o sdram data line 7 ( mid[7] ). p6.8 118 i/o sdram data line 8 ( mid[8] ). p6.9 117 i/o sdram data line 9 ( mid[9] ). p6.10 116 i/o sdram data line 10 ( mid[10] ). p6.11 115 i/o sdram data line 11 ( mid[11] ). p6.12 112 i/o sdram data line 12 ( mid[12] ). p6.13 111 i/o sdram data line 13 ( mid[13] ). p6.14 110 i/o sdram data line 14 ( mid[14] ). p6.15 109 i/o sdram data line 15 ( mid[15] ). p6.16 53 i/o sdram data line 16 ( mid[16] ). p6.17 52 i/o sdram data line 17 ( mid[17] ). p6.18 51 i/o sdram data line 18 ( mid[18] ). p6.19 50 i/o sdram data line 19 ( mid[19] ). p6.20 49 i/o sdram data line 20 ( mid[20] ). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 20/401 p6.21 48 i/o sdram data line 21 ( mid[21] ). p6.22 45 i/o sdram data line 22 ( mid[22] ). p6.23 44 i/o sdram data line 23 ( mid[23] ). p6.24 65 i/o sdram data line 24 ( mid[24] ). p6.25 64 i/o sdram data line 25 ( mid[25] ). p6.26 63 i/o sdram data line 26 ( mid[26] ). p6.27 62 i/o sdram data line 27 ( mid[27] ). p6.28 61 i/o sdram data line 28 ( mid[28] ). p6.29 58 i/o sdram data line 29 ( mid[29] ). p6.30 57 i/o sdram data line 30 ( mid[30] ). p6.31 54 i/o sdram data line 31 ( mid[31] ). p6.32 83 o sdram address line 0 ( mia[0] ). p6.33 82 o sdram address line 1 ( mia[1] ). p6.34 81 o sdram address line 2 ( mia[2] ). p6.35 80 o sdram address line 3 ( mia[3] ). p6.36 79 o sdram address line 4 ( mia[4] ). p6.37 78 o sdram address line 5 ( mia[5] ). p6.38 77 o sdram address line 6 ( mia[6] ). p6.39 74 o sdram address line 7 ( mia[7] ). p6.40 73 o sdram address line 8 ( mia[8] ). p6.41 72 o sdram address line 9 ( mia[9] ). p6.42 86 o sdram address line 10 ( mia[10] ). p6.43 71 o sdram address line 11 ( mia[11] ). p6.44 87 o sdram address line 12 ( mia[12] ). p6.45 88 o sdram address line 13 ( mia[13] ). p6.46 n/a n/a not implemented pin. p6.47 69 o sdram memory clock signal ( miclk ). p6.48 70 o sdram memory clock enable signal ( miclken ). p6.49 89 o sdram active low chip select - bank 0 ( micsn[0] ). p6.50 95 o sdram active low chip select - bank 1 ( micsn[1] ). p6.51 97 o sdram active low chip select - bank 2 ( micsn[2] ). p6.52 98 o sdram active low chip select - bank 3 ( micsn[3] ). p6.53 90 o sdram active low setup active signal ( ras ). p6.54 91 o sdram active low access active signal ( cas ). p6.55 92 o sdram active low write enable signal ( miwen ). table 10. port 6 pins (continued) symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 21/401 4.10 port 7 pins port 7 is a configurable 8/16-bit data port shared between the external memory interface for the connection of memory components - such as rom, flash or sram devices - and the ide interface. both emi and ide are under ar m720 control through configuration registers. shared port lines can be selected by software using the related gcr register bit. p6.56 96 o sdram active low byte lane 0 strobe signal ( mibls[0] ). p6.57 119 o sdram active low byte lane 1 strobe signal ( mibls[1] ). p6.58 43 o sdram active low byte lane 2 strobe signal ( mibls[2] ). p6.59 68 o sdram active low byte lane 3 strobe signal ( mibls[3] ). table 11. port 7 pins symbol pin i/o function p7.0 194 i/o emi data line 0 ( edata[0] ). i/o ide data line 0 ( idd[0] ). p7.1 198 i/o emi data line 1 ( edata[1] ). i/o ide data line 1 ( idd[ 1 ] ). p7.2 200 i/o emi data line 2 ( edata[2] ). i/o ide data line 2 ( idd[ 2 ] ). p7.3 202 i/o emi data line 3 ( edata[3] ). i/o ide data line 3 ( idd[ 3 ] ). p7.4 204 i/o emi data line 4 ( edata[4] ). i/o ide data line 4 ( idd[ 4 ] ). p7.5 206 i/o emi data line 5 ( edata[5] ). i/o ide data line 5 ( idd[ 5 ] ). p7.6 208 i/o emi data line 6 ( edata[6] ). i/o ide data line 6 ( idd[ 6 ] ). p7.7 4 i/o emi data line 7 ( edata[7] ). i/o ide data line 7 ( idd[ 7 ] ). p7.8 195 i/o emi data line 8 ( edata[8] ). i/o ide data line 8 ( idd[8] ). p7.9 199 i/o emi data line 9 ( edata[9] ). i/o ide data line 9 ( idd[ 9 ] ). p7.10 201 i/o emi data line 10 ( edata[10] ). i/o ide data line 10 ( idd[ 10 ] ). table 10. port 6 pins (continued) symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 22/401 p7.11 203 i/o emi data line 11 ( edata[11] ). i/o ide data line 11 ( idd[ 11 ] ). p7.12 205 i/o emi data line 12 ( edata[12] ). i/o ide data line 12 ( idd[ 12 ] ). p7.13 207 i/o emi data line 13 ( edata[13] ). i/o ide data line 13 ( idd[ 13 ] ). p7.14 3 i/o emi data line 14 ( edata[14] ). i/o ide data line 14 ( idd[ 14 ] ). p7.15 5 i/o emi data line 15 ( edata[15] ). i/o ide data line 15 ( idd[ 15 ] ). p7.16 168 o emi address line 0 ( eadd[0] ). o ide address line 0 ( ida[ 0 ] ). p7.17 169 o emi address line 1 ( eadd[1] ). o ide address line 1 ( ida[ 1 ] ). p7.18 170 o emi address line 2 ( eadd[2] ). o ide address line 2 ( ida[ 2 ] ). p7.19 191 o emi address line 3 ( eadd[3] ). p7.20 190 o emi address line 4 ( eadd[4] ). p7.21 189 o emi address line 5 ( eadd[5] ). p7.22 188 o emi address line 6 ( eadd[6] ). p7.23 187 o emi address line 7 ( eadd[7] ). p7.24 178 o emi address line 8 ( eadd[8] ). p7.25 177 o emi address line 9 ( eadd[9] ). p7.26 176 o emi address line 10 ( eadd[10] ). p7.27 175 o emi address line 11 ( eadd[11] ). p7.28 174 o emi address line 12 ( eadd[12] ). p7.29 173 o emi address line 13 ( eadd[13] ). p7.30 172 o emi address line 14 ( eadd[14 ). p7.31 171 o emi address line 15 ( eadd[15] ). p7.32 7 o emi address line 16 ( eadd[16] ). p7.33 186 o emi address line 17 ( eadd[17] ). p7.34 185 o emi address line 18 ( eadd[18] ). p7.35 179 o emi address line 19 ( eadd[19] ). p7.36 182 o emi address line 20 ( eadd[20] ). p7.37 184 o emi address line 21 ( eadd[21] ). table 11. port 7 pins (continued) symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 23/401 4.11 pqfp208 package pin configuration the package used for STR720 device is a plastic quad-flat package supporting 208 pin. for a complete description of this package mechanical characteristics see ?package p7.38 193 o emi active low external read strobe. ( erdn ). o ide active low read strobe ( idiorn ). p7.39 183 o emi active low external write strobe , bits 7:0 of external memory ( ewr0n ). o ide active low write strobe (i diown ). p7.40 6 o emi active low external write strobe, bits 15:8 of external memory ( ewr1n). p7.41 192 o emi active low chip select - bank 0 ( ecs0n ). p7.42 166 o ide active low chip select 0 (i cs0n). p7.43 167 o ide active low chip select 1 (i cs1n). p7.44 164 i ide ready ( iordy). p7.45 165 i ide interrupt ( irq). table 11. port 7 pins (continued) symbol pin i/o function 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 24/401 mechanical data? on page 373. in the following drawing and table the device pin mapping is reported figure 3. STR720 pqfp208 pin configuration (top view) vdd3 vss emi/ide d14 emi/ide d7 emi/ide d15 #byte (p7.40) emi a16 vdd18 gnd vdd3 gnd p4.4 p4.3 agcdata p4.1 p4.0 eready gpsclk acqclk peclref mag sign vdd3p vssp vdddac dac filter dac- dac+ dac-iref gnddac vdd3 gnd avdd a/d0 a/d1 a/d2 a/d3 agnd jtdo jtck jtms jtdi #jtrst bls2 d23 d22 vdd3 gnd d21 d20 d19 d18 d17 d16 d31 vdd3 gnd d30 d29 vdd18 gnd18 d28 d27 d26 d25 d24 vdd3 gnd bls3 clk cke a10 a9 a8 a7 vdd3 gnd a6 a5 a4 a3 a2 a1 a0 vdd3 gnd a11 a12 a13 #bs0 #ras #cas #we vdd3 gnd #bs1 bls0 #bs2 #bs3 d7 d6 d5 d4 vdd3 gnd d3 d2 d1 d0 d15 d14 d13 d12 vdd3 gnd d11 d10 d9 d8 bls1 gndpll vddpll p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 vdd3 gnd p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 vdd18 gnd18 gnd vdd3 p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 (ext_boot) p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 #rstin #rtcrst vddrtc oscin oscout gnd vdd3 ide ready ide interrupt ide #cs0 ide #cs1 emi/ide a0 emi/ide a1 emi/ide a2 emi a15 emi a14 emi a13 emi a12 emi a11 emi a10 emi a9 emi a8 emi a19 vdd3 gnd emi a20 #we (p7.39) emi a21 emi a18 emi a17 emi a7 emi a6 emi a5 emi a4 emi a3 #ecs0n #re (p7.38) emi/ide d0 emi/ide d8 vdd3 gnd emi/ide d1 emi/ide d9 emi/ide d2 emi/ide d10 emi/ide d3 emi/ide d11 emi/ide d4 emi/ide d12 emi/ide d5 emi/ide d13 emi/ide d6 tuareg pinout v0.4 vdd3 vss emi/ide d14 emi/ide d7 emi/ide d15 #byte (p7.40) emi a16 vdd18 gnd vdd3 gnd p4.4 p4.3 agcdata p4.1 p4.0 eready clk reserved vref reserved reserved vdd3p vssp reserved reserved reserved reserved reserved reserved vdd3 gnd avdd a/d0 a/d1 a/d2 a/d3 agnd #jtrst jtck jtms jtdi jtdo bls2 d23 d22 vdd3 gnd d21 d20 d19 d18 d17 d16 d31 vdd3 gnd d30 d29 vdd18 gnd18 d28 d27 d26 d25 d24 vdd3 gnd bls3 clk cke a11 a9 a8 a7 vdd3 gnd a6 a5 a4 a3 a2 a1 a0 vdd3 gnd a10 a12 a13 #bs0 #ras #cas #we vdd3 gnd #bs1 bls0 #bs2 #bs3 d7 d6 d5 d4 vdd3 gnd d3 d2 d1 d0 d15 d14 d13 d12 vdd3 gnd d11 d10 d9 d8 bls1 gndpll vddpll p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 vdd3 gnd p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 vdd18 gnd18 gnd vdd3 p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 (ext_boot) p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 #rstin #rtcrst vddrtc oscin oscout gnd vdd3 ide ready ide interrupt ide #cs0 ide #cs1 emi/ide a0 emi/ide a1 emi/ide a2 emi a15 emi a14 emi a13 emi a12 emi a11 emi a10 emi a9 emi a8 emi a19 vdd3 gnd emi a20 #we (p7 39) emi a21 emi a18 emi a17 emi a7 emi a6 emi a5 emi a4 emi a3 #ecs0n #re (p7 38) emi/ide d0 emi/ide d8 vdd3 gnd emi/ide d1 emi/ide d9 emi/ide d2 emi/ide d10 emi/ide d3 emi/ide d11 emi/ide d4 emi/ide d12 emi/ide d5 emi/ide d13 emi/ide d6 1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 25/401 . table 12. STR720 pqfp208 pin map pin symbol pin symbol pin symbol pin symbol 1 vdd3 53 mid[16] 105 mid[3] 157 rstin_n 2 vss 54 mid[31] 106 mid[2] 158 rtcrst_n 3 edata[14] idd[14] 55 vdd3 107 mid[1] 159 vddrtc 4edata[7] idd[7] 56 vss 108 mid[0] 160 oscin 5 edata[15] idd[15] 57 mid[30] 109 mid[15] 161 oscout 6 ewr1_n 58 mid[29] 110 mid[14] 162 vss 7 eadd[16] 59 vdd 111 mid[13] 163 vdd3 8 vdd 60 vss 112 mid[12] 164 iordy 9 vss 61 mid[28] 113 vdd3 165 irq 10 vdd3 62 mid[27] 114 vss 166 ics0_n 11 vss 63 mid[26] 115 mid[11] 167 ics1_n 12 p4[4] 64 mid[25] 116 mid[10] 168 eadd[0] ida[0] 13 p4[3] 65 mid[24] 117 mid[9] 169 eadd[1] ida[1] 14 p4[2] 66 vdd3 118 mid[8] 170 eadd[2] ida[2] 15 p4[1] 67 vss 119 mibls_n[1] 171 eadd[15] 16 p4[0] 68 mibls_n[3] 120 vsspll 172 eadd[14] 17 clk 69 miclk 121 vddpll 173 eadd[13] 18 reserved (gnd) 70 miclken 122 p2[0] 174 eadd[12] 19 vref 71 mia[11] 123 p2[1] 175 eadd[11] 20 reserved (gnd) 72 mia[9] 124 p2[2] 176 eadd[10] 21 reserved (gnd) 73 mia[8] 125 p2[3] 177 eadd[9] 22 vdd3p 74 mia[7] 126 p2[4] 178 eadd[8] 23 vssp 75 vdd3 127 p2[5] 179 eadd[19] 24 reserved (gnd) 76 vss 128 p2[6] 180 vdd3 25 reserved 77 mia[6] 129 vdd3 181 vss 26 reserved (float) 78 mia[5] 130 vss 182 eadd[20] 27 reserved 79 mia[4] 131 p2[7] 183 ewr0_n 28 reserved (gnd) 80 mia[3] 132 p2[8] 184 eadd[21] 29 reserved (gnd) 81 mia[2] 133 p2[9] 185 eadd[18] 30 reserved (gnd) 82 mia[1] 134 p2[10] 186 eadd[17] 31 reserved (gnd) 83 mia[0] 135 p2[11] 187 eadd[7] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - pin data 26/401 32 avdd 84 vdd3 136 p2[12] 188 eadd[6] 33 an0 85 vss 137 p2[13] 189 eadd[5] 34 an1 86 mia[10] 138 p2[14] 190 eadd[4] 35 an2 87 mia[12] 139 p2[15] 191 eadd[3] 36 an3 88 mia[13] 140 vdd 192 ecs0_n 37 agnd 89 mcs_n[0] 141 vss 193 erd_n 38 jtrst_n 90 misa_n 142 vss 194 edata[0] idd[0] 39 jtck 91 miaa_n 143 vdd3 195 edata[8] idd[8] 40 jtms 92 miwe_n 144 p3[0] 196 vdd3 41 jtdi 93 vdd3 145 p3[1] 197 vss 42 jtdo 94 vss 146 p3[2] 198 edata[1] idd[1] 43 mibls_n[2] 95 mcs_n[1] 147 p3[3] 199 edata[9] idd[9] 44 mid[23] 96 mibls_n[0] 148 p3[4] 200 edata[2] idd[2] 45 mid[22] 97 mcs_n[2] 149 p3[5] 201 edata[10] idd[10] 46 vdd3 98 mcs_n[3] 150 p3[6] 202 edata[3] idd[3] 47 vss 99 mid[7] 151 p3[7] 203 edata[11] idd[11] 48 mid[21] 100 mid[6] 152 p3[8] 204 edata[4] idd[4] 49 mid[20] 101 mid[5] 153 p3[9] 205 edata[12] idd[12] 50 mid[19] 102 mid[4] 154 p3[10] 206 edata[5] idd[5] 51 mid[18] 103 vdd3 155 p3[11] 207 edata[13] idd[13] 52 mid[17] 104 vss 156 p3[12] 208 edata[6] idd[6] table 12. STR720 pqfp208 pin map pin symbol pin symbol pin symbol pin symbol 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 27/401 5 architecture overview this chapter is meant to give an overview of the peripherals available inside STR720, with the dedicated STR720 customizations. STR720 peripherals can be divided in the following groups: ahb peripheral set . this set is composed of all peri pherals requiring fast access and high transfer throughput and it contains program ram memory, boot-rom memory, dma processor capable of transferring data between peripherals and memory, atapi interface for ide device connection, dramc controller allowing the usage of commercial sdram banks as system memory, and emi which enab les a direct connection of external flash memories for system boot or other external memory mapped devices. two different ahb-apb bridges enable access to the rest of STR720 peripheral set. s-apb peripheral set . this set contains those system peripherals which require to run synchronously with arm720t core, due to performance requirements or ease of integration. it is composed of an enhanced interrupt controller (eic) and a specific wake-up interrupt unit (wiu) to extend arm720t interrupt capabilities, a reset-clock control unit (rccu) to select between different system clock source options and implement all the power saving modes, a real time clock to keep timing during powerdown mode, a real-time clock generator, and configurable i/o ports giving access to a large number of configurable pins. a-apb peripheral set . this set contains most of system peripherals and it is designed to run at a lower frequency independent from the arm720t one, thus reducing the overall power consumption. it is composed of a set of serial channels to implement different kind of user interfaces (bspi and uart), protocol sp ecific serial interfaces as can and usb, a 4-channel a/d converter suitable for control-voltage monitoring, 2 independent enhanced function timers (eft) which can be used as system scheduler, watch dog for system reliability (wdg), and configurable i/o port. in the following sections a brief overview of the STR720 system is given. for a more detailed description of each peripheral, please refer to the related chapters. 5.1 enhanced interrupt controller (eic) the arm720t cpu provides two levels of interrupt: fiq (fast interrupt request) for fast, low latency interrupt handling. irq (interrupt request) for more general interrupts. the enhanced interrupt controller (eic) implements the handling of multiple interrupt channels, interrupt priority and automatic vectorization. it provides: 32 maskable interrupt channels, mapped on arm720t interrupt request pin irq 32 interrupt vectors 3 maskable interrupt channels, mapped on arm720t fast interrupt request pin fiq. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 28/401 16 programmable priority levels for each interrupt channel mapped on irq hardware support for interrupt nesting (up to 16 interrupt requests can be nested), with internal hw nesting stack at register offset 0x18h, the start address of the isr of the highest priority interrupt or directly the jump instruction to it (defined by the application). the eic performs the following operations without software intervention: reject/accept an interrupt request according to the related channel mask bit, compare all irq requests with the current priori ty level interrupt. the irq is asserted if the priority of the current interrupt request is higher than the stored current priority, load the address vector of the highest priority irq to the interrupt vector register (offset 0x18h) save the previous interrupt priority in the hw priority stack whenever a new irq is accepted update the current interrupt priority register with the new priority whenever a new interrupt is accepted 5.1.1 irq interrupt vector table up to 32 interrupt channels are mapped on low priority arm720t interrupt request pin (irq). hereafter the mapping of the different interrupt sources on the vector tables is described. the highest-priority interrupt request will be issued on arm720t irq pin. in case of multiple interrupt requests mapped on the same interrupt vector, a polling on interrupt flags contained inside peripherals must be performed by the application code in order to establish the exact source of interrupt (see interrupt flags column in table 13 on page 32 ). there are 16 priority levels for irq mapped i nterrupt. the internal daisy-chain will define the priority relationship for different interrupt vectors having the same priority level: the higher is the interrupt vector number the higher is the priority in the daisy chain. interrupt vector 0  external interrupt requests. four different interrupt requests are or-ed together to generate a single interrupt request:  external interrupt 0 (eint0)  external interrupt 1 (eint1)  external interrupt 2 (eint2)  external interrupt 3 (eint3) interrupt vector 1  external interrupt request 4 (eint4). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 29/401 interrupt vector 2  wake-up controller interrupt request from 0 to 11 (the number of wake-up input alternate function pins) different interrupt requests are or-ed together to generate a single interrupt request. refer to wake-up controller specifications for further de tails on interrupt request generation. interrupt vector 3  extended function timer 1 interrupt request. five different interrupt requests are or-ed together to generate a single interrupt request:  input capture a  output compare a  timer overflow  input capture b  output compare b interrupt vector 4  extended function timer 2 interrupt request. three different interrupt requests are or-ed together to generate a single interrupt request:  input capture a  timer overflow  input capture b interrupt vector 5  uart1 interrupt request nine different interrupt requests are or-ed together to generate a single interrupt request:  receive buffer full  transmit buffer empty  transmit buffer half empty parity error frame error overrun error  timeout not empty  timeout idle  receive buffer half full 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 30/401 interrupt vector 6  uart2 interrupt request (see interrupt vector 5 ). interrupt vector 7  dma controller interrupt request. four different interrupt requests are or-ed together to generate a single interrupt request:  data stream 2 and 3 completed transfer interrupts  data stream 2 to 3 transfer error interrupts interrupt vector 8  reserved. interrupt vector 9  reserved. interrupt vector 10  usb interface high priority events interrupt request. all isochronous and double-buffer endpoint co rrect transfer interrupt requests are or-ed together to generate a single interrupt request. the number of isochronous/ double-buffered endpoints is programmable by software, so the actual number of events raising this interrupt line can vary from 0 to 7. interrupt vector 11  usb interface low priority and generic events interrupt request. all endpoint correct transfer interrupt requests, except isochronous and double-buffered (see interrupt vector 10 ) are or-ed together with the generic usb events to generate a single interrupt request. the usb events not related to endpoint activity are:  data overrun/underrun  usb error  usb wake-up  usb suspend  usb reset  start of frame  missing start of frame the number of isochronous/double-buffered endpoints is programmable by software, so the actual number of events raising this interrupt line can vary from 7 to 15. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 31/401 interrupt vector 12  can interface interrupt request. thirty-two different interrupt requests are or -ed together to generate a single interrupt request:  status interrupt  message object 1 to 32 reception/transmission interrupts interrupt vector 13  buffered spi 1 interrupt request. five different interrupt requests are or-ed together to generate a single interrupt request:  receive interrupt  receive overflow  transmit interrupt  transmit underflow  bus error interrupt vector 14  buffered spi 2 interrupt request (see interrupt vector 13 ). interrupt vectors 15  primary ide interface interrupt request. interrupt vectors 16  real-time clock periodic interrupt request. interrupt vector 23  analog to digital converter sample ready interrupt request. interrupt vector 29  extended function timer 2 output compare a interrupt request. interrupt vector 30  extended function timer 2 output compare b interrupt request. interrupt vector 31  watchdog timer interrupt request. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 32/401 5.1.2 fiq interrupt vector table three maskable interrupt sources are mapped on fiq vectors:  fiq0: external interrupt channel 0  fiq1: extended function timer 2 output compare b interrupt request  fiq2: ahb error detection interrupt request table 13. irq interrupt vector summary vector peripheral peripheral interrupt flags irq0 irq03it : external interrupts eint0-eint3 4 irq1 irq4it : external interrupt eint4 1 irq2 wiuit : wiu wake-up event interrupt 11 irq3 eft1it : eft1 global interrupt 5 irq4 eft2it : eft2 global interrupt 3 irq5 uart1it : uart 1 global interrupt 9 irq6 uart2it : uart 2 global interrupt 9 irq7 dmait : dma event global interrupt 4 irq8 reserved. irq9 reserved. irq10 usbhpit : usb high priority event interrupt 0 - 7 irq11 usblpit : usb low priority event interrupt 7 - 15 irq12 canit : can module general interrupt 32 irq13 bspi1it : bspi 1 global interrupt 5 irq14 bspi2it : bspi 2 global interrupt 5 irq15 idepirq: ide primary channel interrupt 1 irq16 rtcperit : rtc periodic interrupt 1 irq17 reserved. irq18 reserved. irq19 reserved. irq20 reserved. irq21 reserved. irq22 reserved. irq23 adcit: adc sample ready interrupt 1 irq24 reserved. irq25 reserved. irq26 reserved. irq27 reserved. irq28 reserved. irq29 eft2oca: eft2 output compare a interrupt 1 irq30 eft2ocb: eft2 output compare b interrupt 1 irq31 wdgit : wdg timer interrupt 1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 33/401 having only one fiq vector shared by the three interrupt sources, a polling on fiq interrupt pending bits contained inside eic must be performed by the application code in order to establish the exact source of interrupt, in case more than one fiq source is enabled. besides, having no priority mechanism, in case of contemporaneous fiq events, the software shall manage the priority simply by polling the pending bits and managing the concurrence. 5.1.3 irq interrupt vectoring the eic (enhanced interrupt controller) implements an interrupt structure pointing the processor at the first instruction location of the channel-specific interrupt (irq) service routine. ivr (interrupt vector register) is the eic?s 32 -bit register at address 0xffff_fc18 acting as pointer. it is composed by two main fields: the upper half word (16 bit) is directly programmable, while the lower half word is the mirrored entry of a register table (named sir) indexed by the interrupt channel (see chapter 7: enhanced interrupt controller (eic) on page 51 ). the absolute address 0x0000_0018 is where the arm720t cpu jumps as consequence of an interrupt request on its irq pin. the STR720 implementation is such that the arm?s 0x0000_0018 location and the eic?s ivr location are considered as distinct addresses. the eic ivr register can contain, for example, the absolute address of the interrupt service routine or an index to a jump table; at location 0x0000_0018 the interrupt handling routine starts, using ivr as index or pointer to the actual response routine. to implement this behaviour the absolute 0x0000_0018 location must contain an instruction which allows to perform a jump to the location pointed to by the ivr register. for instance, the absolute location 0x0000_0018 should contain the following instruction: ldr pc, [pc, offset] where ?offset? is what to add to the pc to obtain the eic ivr address. the instruction above allows the cpu to load the program counter register with the address kept in eic ivr and so to jump to the location pointed to by the ivr register. the user has to consider that when the absolute address 0x0000_0018 is being fetched, the pc is equal to 0x0000_0020 (18h + 8h). so, the offset is equal to: offset = ivr address ? 0x0000_0020 = 0xffff_fc18 ? 0x0000_0020 = 0xffff_fbf8 table 14. fiq interrupt vector table vector interrupt source fiq0 external interrupt irq0 fiq1 eft2 output compare b interrupt fiq2 ahb error detection interrupt 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 34/401 figure 4. irq interrupt vectorization this mechanism allows a jump to virtually an y location of the 4gb memory space. however, since the channel dependent portion of ivr are the lower 16 bits, once the base address (in the upper part) has been fixed the interrupt handler routines can only be within a 64kbyte range from that base address. 5.2 wake-up/interrupt management unit (wiu) the wake-up/interrupt management unit can be seen as an extension of the number of external interrupt lines but it can also manage up to 16 wake-up lines capable of exiting stop mode: 4 external wake-up lines all connected to the irq0 channel of the interrupt controller. these wake-up lines have dedicated input ports. 1 external wake-up line directly mapped to a dedicated channel of the interrupt controller (irq1). this wake-up line has a dedicated input port. 10 internal wake-up lines connected to the irq2 channel of the interrupt controller module. the ?internal? lines are mapped on some significant STR720 signals. the external wake-up pins (available as alternate function of general purpose i/o lines) can be programmed as plain external interrupt lines or as wake-up lines to exit stop mode. when the external lines are defined as wake-up pins a programmable signal edge will asynchronously trigger the wake-up event, changing the status of the alternate output function stop_req, associated to p3.7 and allowing the external power control to restore system main clock source. in this way stop mode can be exited without resetting the whole system, provided that stop_req is enabled. 0x0001 8000 ivr = 0x0001 8000 eic ivr stores the absolute address of the 0xffff fc18 interrupt service routine ldr pc, [pc, offset] 0x0000 0018 offset = 0xffff fc18 - 0x20 = 0xffff fbf8 first instruction of the isr is located at address 0x0001 8000 irq user code 2 1 3 4 pc <= [pc, offset] interrupt service routine pc = 0x0000 0020 pc = 0x0001 8000 pc = 0xffff fc18 1 2 3 4 interrupt request jump at address 0x0000 0018h: ivr used by previous instruction as base address execution of the instruction which loads pc with eic ivr address 0xffff fc18h for the particular interrupt service routine starting of execution of interrupt service routine 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 35/401 in STR720 implementation, the 10 internal wake-up lines are associated with the input of serial communication modules and also with other relevant internal events, as defined in table 15 . in this way, if properly programmed, the system can be woken up by the detection of activity on any serial bus or when the externa l clk restarts. for example, wake-up line 15 can be used to restore STR720 system when only the real time clock is left running. note wake-up line 6 is associated to any change of pll lock condition detected by rccu unit but, unlike all others, this wake-up line cannot be used to restore system from stop mode. it can be used as an interrupt extension line only. note wake-up line 7, associated to clk cl ock, will be always set its corresponding pending bit as long as the external clock is present. 5.3 dma controller (dmac) the dma controller provides access to 2 data streams inside STR720 system. since peripherals are memory mapped, data transfers from/to peripherals are managed like memory/memory data transfers. each data stream can be associated to one particular peripheral, which triggers a dma request starting the data transfer between the corresponding buffers defined in the stream descriptor. data stream 3 of dma controller can alternatively be used as a memory/memory data transfer triggered by a software dma reques t, independently from any peripheral activity. in case data stream 3 is also associated to a peripheral request, the two modes can be selected by software. the dma controller supports circular buffer management avoiding the generation of interrupts when the controller reach the end of the source buffer. when a stream is configured in circular buffer mode and the end of buffer is reached, dma controller reloads the start address and continues the transfer until software notifies the end of operations. the priority between different dma triggering sources is defined by hardware, source 0 being the highest priority request and source 3 being the lowest one. the mapping of dma requests table 15. wake-up line sources wake-up line # wake-up line source 6 rccu: change of pll lock condition ( see note below ). 7 clk clock line 8 port2.0: uart1 receive data input (rxd1) 9 port2.2: uart2 receive data input (rxd2) 10 port2.6: bspi1. slave mode. input serial clock (sck1). 11 port2.9: bspi2. slave mode. input serial clock (sck2). 12 port2.11: can module receive pin (canrx). 13 reserved. 14 usb wake-up event: generated while exiting from suspend mode. 15 rtc related event: alarm interrupt. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 36/401 implemented in STR720 system is detailed in table 16 . where multiple sources are available for a stream triggering event, the selection is performed by specific configuration bits located in sgcr3 register. note that atapi can be programmed so to transfer its data to/from memory using the memory-to-memory transfer mode, so there is no need to generate a specific request to the dma controller. the dma controller treats bytes in memory as being in little endian format: the lowest numbered byte in a word is considered the word least significant byte and the highest numbered byte the most significant. 5.4 dram controller (dramc) the STR720 device provides an sdram which supports four external banks containing sdram memories, all banks being of the same dram type. each bank can be enabled/ disabled through configuration registers and its size can vary between 64 kbytes and 32 mbytes. this allows the controller to ad dress from 64 kbytes (1 bank of 64 kbytes) up to 128 mbytes (four banks of 32 mbytes). due to pad number limitation, the maximum addressable range of 128 mbytes (32 mbytes each bank) can be reached only when 32 bit wide memories are used and column address is at least 9 bit long. accesses to the sdram memory are done using an ahb interface, while a dedicated apb interface enables the cpu to configure various parameters of sdramc accesses to the external memory as word and column size, data latency, setup time, idle time, bank enabling, refresh period. when arm720 cache is enabled, all accesses to sdram memory are performed as bursts of 4 transfers on ahb bus and in order to achieve the highest performance level, sdram interface must be aware of this peculiar access mode. unfortunately a limitation in arm720 core and sdram interface requires this specific configuration to be enforced explicitly by software. this configuration selection is performed by using cache_config bit of sgcr1 register, which can configure STR720 to work in ?burst-access? mode and it should be used whenever cache is enabled, so to have optimal performance from the system. see section 10.5: programming considerations on page 114 about sdram configuration, and section 24.3: s-gcr block description on page 352 for further details and limitations about the usage of sdram ?burst-access? mode. table 16. dma request mapping stream dma triggering source 0 reserved. 1 reserved. 2 bspi1 receive data request 3 memory-to-memory / bspi1 transmit data request / adc 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 37/401 5.5 external memory interface the external memory interface (emi) controls the data flow from ahb bus to an external memory components - both rom, sram and pcmcia interface and it can access up to 8 mbytes of memory space, possibly partitioned in 4 different memory banks. the ahb interface manages 32 bit data that can be then packed/unpacked before being send through a 16 bit data bus. the emi will automatically unpack the data and reformat it to the right part of the bus for write access. for read access, it will buffer the access to build the complete 32-bit data to be send to the ahb. the length of time required to properly transfer data to external memory components is controllable by programming of internal regis ters dedicated to each external memory space. in case the response time of the external device is not constant, a specific alternate function is provided on p4.0 used as an external ready signal, whose transition flags the end of current access. this external ready functionality can be enabled by programming the internal emi registers which also contain flag bits to inform the controller if a particular memory space is accessible or not. these internal registers are accessed via an apb interface to the emi block. the external memory interface shares a 46-bit port (port 7) with the ide interface pins so that the two interfaces cannot be used at the same time. the address bus starts from bit 0 (p7.16) and ends on bit 21 (p7.37) always representing the 16-bit word location accessed by the emi block. the selection between emi and ide pins can be done by setting the corresponding bit in sgcr1 register. beside this limitation, also the number of accessible memory banks is limited to 2: bank 0 will be always accessib le while bank 1 can be used only through a specific i/o programming since its chip select line is shared with another gpio pad (p4.4 = cs1). memory banks cs2 and cs3 are never accessible. 5.6 atapi ide interface ata 4 industry standard eide controller. the controller allows interfacing to devices such as hard disk drives or cd rom to the STR720 system being capable of transferring data either under cpu control or using the dma controller ?memory-to-memory? transfer mode, thus being able to spare cpu time even if pio modes are configured. the ide controller supports the following features: primary-only channel, supporting up to two ide devices. support for cd-rom and tape peripherals. independently programmable timing for each device. programmable posted writes and read-prefetch. software selectable endianness for data read from cdrom / tape peripheral. support for i/o channel ready. support for pio modes 0, 2, 3 and 4. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 38/401 5.7 reset and clock control unit (rccu) reset and clock control unit (rccu) is responsible of the control and distribution of the reset and the clocks signals of STR720. 5.7.1 clock management all possible operating modes (including low power ones) are managed by this peripheral by selecting the system clock source and prescaling it so to adapt its frequency to actual system requirements. a conceptual block diagram of rccu clock management structure is reported in figure 5 on page 38 as the diagram reports, different clock freq uencies can be used for the main system composed by the ahb and the s-apb subsystems. as an example, when clk clock is driven by a 16 mhz signal, the following values are possible, for main system clock: clk: 16 mhz clk divided by 2 clk divided by 32 or by 64 clk multiplied by pll (see run mode section) clk_af source: 32 khz oscillator output. a programmable prescaler derives a-apb subsys tem clock from main clock signal, while independent and dedicated prescalers are implemented in order to generate the atapi clock. all serial interfaces (can, bspi, uart) have configurable internal prescalers in order to generate the correct baud rates. each peripheral inside STR720 system can be figure 5. rccu simplified block diagram 1/2 clk clk2 clk_af pll clock multiplier unit /divider a-apb clock ahb / s-apb clock 1/2, 1/4 1/32 atapi clock oscin (32 khz) div2 pll_byp slow idle stop 1/8, 1/16 1/2, 1/3 (atapi_clk) (ahb_clk) (apb_clk) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 39/401 independently stopped, freezing its clock inp ut signal, by proper configuration registers located in the a-apb bridge, in gcr registers an d in a specific clock gating control block. if application software requires it, rccu block can issue an interrupt, through the wiu block, upon any change of pll lock condition, so to take proper action when system clock frequency is different from what is set in rccu configuration. for a detailed description of STR720 operating modes, see chapter 25: power reduction modes on page 364 . note the ahb and s-apb blocks are driven by the same clock si gnal (ahb_clk) . 5.7.2 reset management the reset manager resets the mcu when one of the following events occurs: ? a hardware reset, initiated by a low level on the reset pin; ? a software reset, forced setting a control bit inside the rccu ? a watchdog end of count condition (when enabled) the event causing the last reset is flagged in the clkflag register: the corresponding bit is set. a hardware initiated reset will leave all these bits reset. the hardware reset overrides all other conditions and forces the system to the reset state. during the reset phase, the internal registers are set to their reset values, where these are defined, and the i/o pins configuration is restored to the condition reported in section 5.18: general purpose i/o ports on page 44 and section 5.19: dedicated pins on page 45 . reset from pad is asynchronous: when it is driven low for a duration longer than the on-chip rc filter width (between 50 ns and 500 ns), a reset cycle is initiated (see chapter 26: system reset on page 370 ). the on-chip watchdog timer generates a reset condition if the watchdog mode is enabled and if the programmed period elapses without the specific code written to the appropriate register (see chapter 20: watchdog timer (wdg) on page 303 ). when the reset pin goes high again, the on-chip rc filter width plus 768 clk plus 8 ahb_clk cycles are counted before exiting the reset state (plus possibly up to four additional clk period, depending on the delay between the rising edge of the reset pin and the first rising edge of clk). as an example it corresponds to an interval between 48.25 s and 48.5 s with a 16 mhz input clock. at the end of the reset phase, the program counter will be set to the location specified in the reset vector located in the 0000 0000h location of memory. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 40/401 figure 6. reset general timing when a reset is asserted, rccu registers will be preset in the following state: reference clock (clk clock), with no sub-divisi on, will be used as system clock and fed in input to the pll; pll will be switched off and bypassed with its multiplication factor preset to 1; most of peripheral clocks will be stopped (see table 83: peripheral clock and reset gating on page 366 ) it is up to the STR720 boot code to properly program the rccu registers so as to use the pll, to set different division factors for apb_clk, to enable or disable the peripheral clocks according to application requirements. 5.8 real time clock (rtc) the real time clock is a 48 bits counter with a resolution of one period of the 32768 hz input clock. the counter is fed by the output clock of a 32768 hz crystal oscillator. the rtc and the oscillator are supplied by a dedicated 1.8 v stand-by power supply allowing the possibility to switch off all the device keeping the counter running. the counter is reset by a dedicated in pin which is supplied by 1.8 v too. the system reset does not have any effect on the rtc. rstin external pin clk ahb_clk ... 768 cycles 8 cycles cpu + periph reset cpu run periph. ck 50 ns 500 ns rstf (after filter) internal signal 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 41/401 the rtc generates a configurable periodic tick (see table 13, ?irq interrupt vector summary,? on page 32 and table 15, ?wake-up line sources,? on page 35 ) and a programmable alarm. readable/writable registers contain the time elapsed since clock start, measured as 30.52 s ticks on a 48 bit counter. the counter overflow is not handled being higher than 200 years. 5.9 ahb-apb bridges in order to reduce the power consumption of the overall core, ahb and a-apb are clocked with different frequencies: ahb with an high frequency to have high transfer performance, a-apb with a scaled down frequency in or der to reduce power consumption. the ahb-apb asynchronous bridge provides a resynchronization mechanism in order to enable master of the ahb bus to access the apb peripherals. for information on the apb bridges mapping, please refer to section 6.3: apb bridges mapping on page 48 . since the ratio between ahb and a-apb could be also 1/16, more than 32 ahb-cycles could be necessary to access a peripheral. moreover, the ahb-apb asynchronous bridge also controls the clock and reset signals of the peripherals connected to a-apb subsystem. the peripheral clock gating (pcg) registers allow to clock off independently any of the peripherals connected to the bridge. for peripherals that do have both an ahb and apb interface but that do not support two independent clock domains, as external memory interface (emi) and dma controller (dmac), a synchronous apb bridge is also im plemented (s-apb). this bridge is also used to connect those apb peripherals having specific bandwidth requirements, in order to avoid the synchronization overhead present in the asynchronous apb bridge. 5.10 clock gating control (cgc) the clock gating control block (cgc) is a ba nk of registers which can be used to activate clock and reset signals for most ahb and s-apb peripheral. in this way only the peripherals actually required by the application need to be clocked, while all the other ones can be kept frozen or under reset so to reduce syste m power consumption. this block acts as a complement to the similar feature implemente d by the a-apb bridge on its peripherals. for most of the peripherals connected to ahb or s-apb subsystems there are three bits inside cgc block: reset on/off control, normal clock on/off control and debug clock on/off; an identical situation exists for a-apb peripheral s which use a similar structure found in a-apb bridge. the list of controlled peripherals can be found in table 83: peripheral clock and reset gating on page 366 where also their reset status can be found. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 42/401 5.11 universal asynchronous receiver/transmitter (uart) STR720 provides 2 universal asynchronous receiver transmitter peripherals (uart) to interface to other microcontrollers, microproce ssors or external peripherals through serial communication. both uarts support full duplex asynchronous communication with external peripherals. data frames can be either 8-bit long (8 data bits or 7 data bits plus an automatically generated parity bit) or 9-bit long (9 data bits or 8 data bits plus an automatically generated parity bit or 8 data bits plus a wake up bit, useful for communication in multiprocessor systems). parity, framing, and overrun error detection can be automatically added to increase the reliability of data transfers. an internal 16-bit baud rate generator is available: the clock for both transmit and receive channels can be obtained dividing the input clock by any divisor value from 1 to 2 16 -1. in order to reduce the number of interrupt to the arm7, two internal fifo?s (16 words of 9 bits each) can be enabled via software, one for transmitted data and one for received data. 5.12 buffered serial peripheral interface (bspi) STR720 provides two buffered serial peripheral interfaces (bspi). the bspi implements an industry standard serial synchronous full dupl ex 4-pin interface, fully compliant with motorola spi protocol. the bspi can be used to communic ate with peripheral devices or it can be used for inter-processor communications in a multiple-master environment. the buffered spi can be configured to operate either in slave or in master mode, even if slave mode is subject to some limitations since slave select lines are shared with external interrupt 1 and 2 lines on p3.9 and p3.10 pads. two internal fifo?s (16 words of 16 bits each) are available, one on the receive channel and one on the transmit channel. the bspi can be programmed to operate with words 8 and 16 bit long. the bspi serial clock frequency can be programmed dividing the input clock by an even value in the range starting from 6 to 254. 5.13 controller area network interface (can) two independent can interfaces are implemented on STR720. the controller area network serial bus is compliant to the can protocol version 2.0 part a (messages with 11 bit identifiers) and b (messages with 29 bit identifiers). 5.14 universal serial bus interface (usb) STR720 provides a full speed usb slave interface, compliant with revision 1.1 of the usb standard, giving a peak transfer rate of 12 mbits/s. this interface shares its data lines with pins p2.14 and p2.15, while its clock source is taken from an external clock line, shared with p2.10, which must be set to 48 mhz (50% duty cycle) when the usb is required. STR720 system features built-in usb transceivers wh ich requires two series resistors of 27 ? 5%, one for each data line, to adapt the output impedance according to usb standard specifications. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 43/401 eight endpoints are available; each may be so ftware-configured to be control/interrupt/bulk/ isochronous. double-buffering is supported for bulk and isochronous transfers. crc generation/checking, nrzi encoding/decoding, bit-stuffing and packet filtering are handled by hardware; interrupt is generated at the end of each packet correctly sent/received, or on transmission errors. packets are stored in an internal buffer memory implemented as a single port 512 x 16 bit ram. usb suspend/resume are fully supported, allowing to stop the system clocks while keeping the wake-up capability and be compliant with usb current consumption specifications for bus powered devices. 5.15 watchdog timer (wdg) the watchdog timer represents one of the fail-safe mechanisms which have been implemented to prevent the controller from malfunctioning. it is able to generate a system reset upon expiration of a programmed period of time. the watchdog timer can be enabled by software. when rstin pin is released, the watchdog timer is not enabled, and it must be activated by software: once enabled, it can no longer be disabled by software. a prescaler allows to widely program the wdg overflow period whose length depends upon the selected wdg clock usin g ee bit of wdtcr register: if apb clock is selected, writing ee to ?0?, the period can range between 66 ns and 0.5 s (with apb clock at 30 mhz), otherwise if low frequency clock (4 khz derived from the 32 khz rtc clock) is selected, writing ee to ?1?, the period can be extended between 500 s to about 4200 s independently from system clock frequency. to prevent a system reset the application code shall write, with a particular sequence, the watchdog timer control register at regular intervals. at the end of a successful write operation the watchdog timer restarts to count from the preset value. in order to prevent a system reset, the user has to write the sequence a55a, 5aa5 in the wdtkr register of wdg peripheral. the watch dog timer can also be used as a fr ee-running timer, providing an interruption request when counting down counter reaches 0. 5.16 extended function timer (eft) the STR720 system includes 2 extended functi on timers (eft). each eft consists of a 16-bit counter driven by a programmable prescaler. they may be used for a variety of purposes, including pulse length measurement of up to two input signals (input capture) or generation of up to two output waveforms (output compare and pwm). pulse lengths and waveform periods can be modulated from a very wide range using the timer prescaler. not all their alternate function i/o features are available: only module eft1 external clock input function and one eft2 output compare i/o line can be used. regardless of the number 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 44/401 of available alternate function i/os, the number of interrupt events each eft block can generate is the same and it is indicated in section 5.1.1: irq interrupt vector table on page 28 . eft1 external clock source can be selected by software (in place of system clock) to obtain time bases independent from the system cloc k frequency (usually dependent on the selected system configuration mode) or to count external events. 5.17 ?? analog to digital converter (adc) for analog signal measurement, a 11.5-bit enob resolution a/d converter (adc) with 4 multiplexed input channels. it returns the conversion result on 16 bits with a frequency of up to 950 hz each channel. it is a second-order qu ad-channel sigma-delta converter specifically suited for low conversion rate application (512 times oversampling rate). the typical sinad is 71 db. the adc supports two different conversion modes. in the standard auto scan continuous mode, the analog levels on each channel are sequentially and repeatedly sampled and converted. alternatively, the single channel conversion mode, can be used where the analog level on a specified channel is repeatedly sampled and converted into a digital result without software intervention. each channel has its own result data register where the value obtained from the last completed conversion is stored. in both modes it is possible to associate a dma transfer to the end of conversion interrupt without interrupting the arm720t for the data transfer. only one interrupt source is implemented, called ?end of conversion? which is activated each time a conversion sweep is completed and the result is written on the data result registers. 5.18 general purpose i/o ports the general purpose io (gpio) ports are programmable by software in several conditions: input, output, alternate function, open drain, push-pull, bidirectional weak and high impedance. three general purpose i/o ports are available on STR720 system: p2, composed of 16 bits, p3, composed of 13 bits, and p4, composed of 5 bits only. although all their registers are described as 16-bit wide, the actual number of available pins corresponds to what is stated above and in chapter 4: pin data on page 14 . during and just after the reset no alternate function is active: in particular each port bit is configured in input mode (pc0=1, pc1=0, pc2=0). the output driver is in high impedance while the input section is active (see chapter 23: general purpose i/o ports on page 343 ). being each gpio pin configured in input during reset phase, the io pins are released to high impedance condition. to avoid power consumption the user has to drive the ios to stable 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 45/401 levels. after the reset phase each pin can be reconfigured by software according to the application requirements. the input section of p2.13 is implementing a ttl schmitt trigger device, while all other ports are plain input buffer without hysteresis. summarizing, hereinafter the reset values of all port configuration and data registers are reported. 5.19 dedicated pins the status under and after reset of the dedicated ports and pins is hereafter reported. table 17. gpios reset configuration 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 port 2 i-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-t port 3 i-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-ti-t n/a n/a n/a port 4 i-ti-ti-ti-ti-t n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a i-t input-tristate ttl b-wd bidirectional weak pull-down table 18. port registers: reset configuration 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 port 2 pc02 1111111111111111 pc12 0000000000000000 pc22 0000000000000000 port 3 pc03 1111111111111 n/a n/a n/a pc13 0000000000000 n/a n/a n/a pc23 0000000000000 n/a n/a n/a port 4 pc04 11111 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a pc14 00000 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a pc24 00000 n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a table 19. dedicated pins reset status pin (note 1) status under reset value under reset oscin input - oscout output not oscin rstin input z rtcrst input z tclk input z trst input z tms input z 1 .com .com .com .com .com 4 .com u datasheet
STR720 - architecture overview 46/401 note1: to avoid power consumption the user has to drive the input pins to stable values. jtag input pins require special attention since they do not implement any internal resistor: external devices should be connected to guarantee proper levels and to avoid possible spurious consumption of the input logic and/or undesired malfunctioning of the jtag module. when the system is put into stop mode, all the pins maintains the status previously programmed while entering in standby mode all pins are restored to their reset state. 5.20 miscellanea registers the miscellanea registers module gathers all the registers that describe the current configuration of STR720 system. they can be accessed through the apb interface and allow a software configuration of some of the main features of the device. the complete list of configurable features can be found in chapter 24: miscellanea registers (gcr - cgc - ahb_err) on page 351 . the most relevant features which can be configured are given below. boot re-mapping (brm) specifies where to find the boot program code. by default, it maps the boot-rom or emi area to address 0x0000_0000 after reset. dma stream selection bit (st3_sel) configure which peripherals will have access to dma request line 3. port7 access selection (p7as) which enabl es to specify if port7 is used for emi or atapi-ide interface. address of last ahb transaction which resulted in a error response (useful during application debug). tdi input z tdo output tristate z port1[0:3] analog input - port1[6:7] high impedance z port6[0:31] input z port6[32:45] output 0 port6[47] output 0 port6[48] output 1 port6[49:59] output 1 port6[53:59] output 1 port7[0:15] input z port7[16:37] output 0 port7[38:43] output 1 port7[44:45] input z table 19. dedicated pins reset status pin (note 1) status under reset value under reset 1 .com .com .com .com .com 4 .com u datasheet
STR720 - memory organization 47/401 6 memory organization the memory space of the STR720 device is configured in a von neumann architecture. code memory, data memory, registers and i/o ports are organized within the same linear address space of 4 gbytes. the entire memory space is sub-divided in 8 main blocks (512 mbytes each), selected by the most significant bits of the ahb address bus. there are three external blocks in the STR720 memory map: the sdram area, the atapi-ide area and the emi area, all using little endian format. in the following sub-sections the relevant memory areas are briefly described. 6.1 program memory STR720 implements a 16 kbytes program ram block, located in the address range from 0x6000_0000 to 0x6000_3fff and organized as a 4k of 32-bit wide memory. immediately after system reset, program memory is accessible only at the above mentioned address range within block 3, allowing its initialization during the boot procedure when the code is fetched from emi area (external-boot mode). at the end of boot sequence a specific gcr register is written to modify the memory map (?boot re-map? operation). after the ?boot re-map? operation, program memory will be available also from address 0x0000_0000 (block 0) to allow application code execution. program memory can be used for both code (instructions) and data (constants, tables, etc.) storage. code fetches are always made on even byte addresses. word data accesses can be made to even or odd byte addresses. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - memory organization 48/401 6.2 memory map 6.3 apb bridges mapping apb bridges allow the connection between the high performance ahb bus, where arm720, dma, memory block and memory interfaces are located, to the peripherals residing on the apb bus. two separated apb subsystems have been implemented on STR720 device: asynchronous apb subsystem and synchronous apb subsystem. they are briefly described in the following sections, along with the related peripheral address mapping. 6.3.1 asynchronous apb sub-system (a-apb) in order to reduce the power consumption of the overall device, the asynchronous apb sub-system, in short a-apb, can be clocked at a frequency different from the one used for arm720t core. a specific asynchronous ah b-apb bridge provides a re-synchronization mechanism in order to enable th e master of ahb bus to access the apb peripherals although residing on a different clock domain. 0x0000_0000 emi emi 0x4000_0000 4 gbytes block 0 block 1 block 2 block 3 block 4 block 5 atapi-ide block 6 block 7 0x6000_0000 0x8000_0000 0xa000_0000 0xc000_0000 0xe000_0000 4 gbytes remap reset memory map remapped memory map non-implemented memory areas 0x2000_0000 sdram 0x2000_0fff 0x6000_3fff 0x0000_0000 emi 0x4000_0000 block 0 block 1 block 2 block 3 block 4 block 5 atapi-ide block 6 block 7 0x6000_0000 0x8000_0000 0xa000_0000 0xc000_0000 0xe000_0000 0x2000_0000 sdram 0x2000_0fff 0x0000_3fff 0xf000_0000 a-apb s-apb 0x6000_3fff 0xf000_0000 a-apb s-apb reserved reserved prog ram prog ram prog ram rom rom 1 .com .com .com .com .com 4 .com u datasheet
STR720 - memory organization 49/401 the a-apb memory space decoding is provid ed by the a-apb bridge which assigns a 4 kbytes memory area to each peripheral. table 20 reports the a-apb memory mapping. table 20. a-apb sub-system memory map peripheral name start address end address data size peripheral register map asynchronous ahb-apb bridge (a3brg) 0xe000_0000 0xe000_0fff 32 section 15.4.1 a-apb global control register (a-gcr) 0xe000_1000 0xe000_1fff 16 section 24.5.1 general purpose i/o 2 (gpio2) 0xe000_2000 0xe000_2fff 16 section 23.4.1 buffered serial port interface 1 (bspi1) 0xe000_3000 0xe000_3fff 16 section 17.4.1 buffered serial port interface 2 (bspi2) 0xe000_4000 0xe000_4fff 16 section 17.4.1 universal async. receiver/transm. 1 (uart1) 0xe000_5000 0xe000_5fff 16 section 16.4.1 universal async. receiver/transm. 2 (uart2) 0xe000_6000 0xe000_6fff 16 section 16.4.1 extended function timer 1 (eft1) 0xe000_7000 0xe000_7fff 16 section 21.4.1 extended function timer 2 (eft2) 0xe000_8000 0xe000_8fff 16 section 21.4.1 analog digital converter (adc) 0xe000_9000 0xe000_9fff 16 section 22.4.1 controller area network interface (can) 0xe000_a000 0xe000_afff 16 section 18.7.11 universal serial bus interface (usb) 0xe000_b000 0xe000_bfff 16 section 19.6.4 watch-dog (wdg) 0xe000_c000 0xe000_cfff 16 section 20.4.1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - memory organization 50/401 6.3.2 synchronous apb sub-system (s-apb) some peripherals require to be tightly coupled with arm720 core for performance reasons and some others have both ahb and apb ports, typically separating data from and control information. in both cases it is required to ha ve an apb sub-system which runs synchronously with the ahb clock frequency. a plain ahb-apb bridge is used to connect these synchronous apb peripherals to the system. the s-apb memory space decoding is provided by the s-apb bridge which assigns a 1 kbyte memory area to each peripheral. table 21 reports the s-apb memory mapping: in order to provide an effecti ve usage of eic vectorized interrupt features, s-apb sub-system is mapped on multiple address ranges: the first one starts from 0xf000_0000 and ends to 0xf000_3fff then the first replica begins, using the addresses from 0xf000_4000 to 0xf000_7fff and so on up to the last address range duplicate which extends from 0xffff_c000 to 0xffff_ffff. within this last s-apb address range image the eic registers appears starting from 0xffff_fc 00, allowing to reach ivr register at absolute address 0xffff_fc18, inside the range supported by the indirect jump instruction stored at irq vector location (0x0000_0018). table 21. s-apb sub-system memory map peripheral name start address end address data size peripheral register map dram controller (dramc) 0xf000_0000 0xf000_03ff 16 section 10.4.1 external memory interface (emi) 0xf000_0400 0xf000_07ff 16 section 11.4.1 direct memory access controller (dmac) 0xf000_0800 0xf000_0bff 16 section 9.4.1 s-apb global control register (s-gcr) 0xf000_0c00 0xf000_0fff 16 section 24.5.1 reset and clock control unit (rccu) 0xf000_1000 0xf000_13ff 16 section 13.4.1 general purpose i/o 3 (gpio3) 0xf000_1400 0xf000_17ff 16 section 23.4.1 general purpose i/o 4 (gpio4) 0xf000_1800 0xf000_1bff 16 section 23.4.1 reserved 0xf000_1c00 0xf000_1fff 32 reserved 0xf000_2000 0xf000_23ff 32 wake-up/interrupt unit (wiu) 0xf000_2400 0xf000_27ff 16 section 8.5 real time clock (rtc) 0xf000_2800 0xf000_2bff 16 section 14.4.1 clock gating control block (cgc) 0xf000_2c00 0xf000_2fff 16 section 24.5.1 ahb error decoder (aerr) 0xf000_3000 0xf000_33ff 32 section 24.5.1 reserved 0xf000_3400 0xf000_37ff - reserved 0xf000_3800 0xf000_3bff - enhanced interrupt controller (eic) 0xf000_3c00 0xf000_3fff 32 section 7.4.1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 51/401 7 enhanced interrupt controller (eic) 7.1 introduction the arm720t cpu provides two levels of interrupt, fiq (fast interrupt request) for fast, low latency interrupt handling and irq (interrupt request) for more general interrupts. hardware handling of multiple interrupt channels, interrupt priority and automatic vectorization require therefore a separate enhanced interrupt controller (eic). 7.2 main features 32 maskable interrupt channels, mapped on arm?s interrupt request pin irq 16 programmable priority levels for each interrupt channels mapped on irq hardware support for interrupt nesting (16 levels) 3 maskable interrupt channels, mapped on ar m?s interrupt request pin fiq, with neither priority nor vectorization figure 7. eic block diagram irq0 irq1 irq31 ier0-ier1 fiq0 fiq1 fir fiq control logic irq control logic fiq request irq request stack ctl (push/pop) priority stack (16 entry) cipr fiq to arm720t highest priority interrupt sir (32 entry) irqx vector ie0 ie1 ie31 ip0 ip1 ip31 ipr0-ipr1 fie[0] fie[1] fir fip[0] fip[1] irq_en icr fiq_en sirn(31:16) ivr(31:16) interrupt from line irqx ivr irq to arm720t fie[2] fip[2] fiq2 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 52/401 7.3 functional description the eic (enhanced interrupt controller) implements an interrupt structure pointing the processor at the first instruction location of the channel-specific interrupt (irq) service routine. ivr (interrupt vector register) is the eic?s 32- bit register at address offset + 18h acting as pointer. it is composed by two main fields: the upper half word (16 bit) is directly programmable, while the lower half word is the mirrored entry of a register table (named sir) indexed by the interrupt channel. the upper part is generally meant to contain jump opcode or base jump address depending on the application. the lower part supplies different jump offsets as a function of the interrupt channel. the fiq interrupt channels have not been provided with any vectoring nand/nor priority mechanism. the eic supports a fully programmable interrupt priority structure. sixteen priority levels are available to define the channel priority relationships. each channel has a 4-bit field, that defines its priority level in the range 0 - 15. the on-chip peripheral channels and the external interrupt sources can be programmed within these 16 priority levels, level 15 indicates the highest priority, whereas level 0 the lowest. if several units are located at the same priority level, an internal daisy chain, fixed for each device and depending on which interrupt input line the device is connected to, defines the priority relationship within that level. the higher is the input line index, the higher is the priority in the daisy chain. the user should keep this in mind avoiding that an interrupt, with a lower rank in the internal daisy chain, is never executed because it is at the same priority level of another interrupt channel with higher occurrence rate. example: supposing the following hardware configuration is implemented: module a: interrupt channel 2 module b: interrupt channel 6 if both the priority levels have been set to 5, and both modules generate simultaneously an interrupt request to the eic, the request from module b is served first. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 53/401 7.3.1 priority level arbitration the sipl (source interrupt priority level) fi eld in the sirs (source interrupt register) provides the priority level of each of the 32 interrupt sources. every clock cycle all the pending interrupts (stored in the ipr register) and their priorities are evaluated, and a winner channel (if any) is elected. an interrupt requesting channel, to be the winner, must: be enabled (ier - interrupt enable register) have the highest priority level related to the current interrupt requests, and higher than the current one (cipr - current interrupt priority register) have the highest position in the chain of the pending interrupts with the same sipl value the cipr provides the priority of the interrupt (irq type) currently serviced. cipr is set to 0 (lowest priority) upon reset and can be modified during program execution, updating the register with a value that must be greater than, or equal to, the initial priority of the irq currently serviced (if it isn?t, the write operation has no effect). for safe operations it?s better to disable the irq, before attempting to modify the cipr register, to avoid dangerous race conditions. the interrupt arbitration is stopped as soon as an interrupt is accepted by the processor (i.e. the ivr - interrupt vector register is read and the interrupt service routine starts), and the cipr and cicr registers are updated (see figure 8 : intx represents a generic interrupt request of priority x). one clock later, after the priority stack update, the arbitration starts once again. before exiting the interrupt service, the cpu has to clear the related interrupt pending bit in the eic, to communicate the end of interrupt; this is possible by writing a ?1? to the proper ipr bit. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 54/401 figure 8. nested interrupt request sequence example the ipr is a read/clear register, so writing a ?0? has no effect, while writing a ?1? reset the related bit. therefore refrain from using read-modify instructions to avoid corruption of the ipr status. dynamic priority level modification : the main program and routines can be specifically prioritized. since cipr is a read/write register, it is possible to modify dynamically the current priority value during program execution. this means that a critical section can have a higher priority with respect to other interrupt requests. a subsequent lowering of the priority is allowed only down to the initial level of interrupt routine. such initial priority level has been, of course, conveniently stored inside the eic hardware stack. note that it is likewise possible to even manipulate the main program execution priority. maximum depth of nesting : no more than 15 routines can be nested (one for each priority level, from 1 to 15). if an interrupt routine at level n is being serviced, no other interrupts located at level n can interrupt it. this implies a maximum number of 16 nested levels including the main program priority level. priority level 0 : interrupt requests at level 0, even if enabled, cannot be acknowledged, as their priority cannot be strictly higher than the cipr value. the pending bit in the ipr (interrupt pending register) is anyway set. such a feature comes useful in a totally interrupt polled environment. the whole interrupting process is constitu ted by the following subsequent major steps: interrupt 0 has priority level 0 interrupt 1 has priority level 1 interrupt 2 has priority level 2 interrupt 3 has priority level 3 interrupt 4 has priority level 4 interrupt 5 has priority level 5 interrupt 6 has priority level 6 interrupt 7 has priority level 7 int. 1 int. 5 int. 2 7 6 5 4 3 1 2 0 priority level main program main program cpl set to 0 cpl = 1 int. 5 cpl = 2 int. 3 cpl = 3 cpl = 5 int. 3 cpl = 3 int. 4 cpl = 4 int. 5 cpl = 5 int. 7 cpl = 5 int. 2 cpl = 2 cpl = 0 int. 2 int. 5 int. 3 int. 4 int. 7 int. 1 int. 5 re-enable interrupt re-enable interrupt re-enable interrupt re-enable interrupt re-enable interrupt re-enable interrupt 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 55/401 every clock cycle the ipr (interrupt pendi ng register) is updated and the pending interrupts are arbitrated to finally activate the irq/fiq request to the cpu. once the interrupt request has been accepted by the cpu, the program execution jumps at the first instruction of the related interrupt channel software routine (see section 7.5 for more details). the enhanced interrupt controller will automatically: reject/accept an interrupt request according to the channel enable bit (ier - interrupt enable register). compare all interrupt requests (pending or new) with the current priority interrupt level. if the priority of the interrupt requests is higher than the current priority, an interrupt irq is asserted. the register 0x18 is loaded with the corresponding address vector. when an interrupt request is accepted, the previous interrupt priority and channel id (content of cipr and cicr registers) are saved by the eic in the eic?s hardware stack. the current priority register (cipr) and the current channel register (cicr) are automatically updated with the accepted interrupt priority and channel id. when the pending bit in the ipr is cleared, the end of interrupt condition is detected, and the eic restores in the cipr and the cicr the previous interrupt priority and channel id saved in the hardware stack. the eic allows to mask all the interrupt sources by resetting the enable bits in the icr (inter- rupt control register). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 56/401 7.4 register description reading from the ?reserved? field in any register will return ?0? as result. attempt to write in the same field has no effect. interrupt control register (icr) address offset: 00h reset value: 0000 0000h bit 31:2 = reserved. bit 1= fiq_en: global fiq output enable bit this bit enables fiq output request to the cpu. 1: enhanced interrupt controller fiq output request to cpu is enabled 0: enhanced interrupt controller fiq output request to cpu is disabled, even if the eic logic has detected valid and enabled fast interrupt requests at its inputs bit 0 = irq_en: global irq output enable bit this bit enables irq output request to the cpu. 1: enhanced interrupt controller irq output request to cpu is enabled 0: enhanced interrupt controller irq output requ est to cpu is disabled, even if the eic logic has detected valid and enabled interrupt requests at its inputs the icr register is an enable register at the eic irq/fiq outputs level: it has no influence on the eic internal logic behaviour. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved fiq_en irq_en -rwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 57/401 current interrupt channel register (cicr) address offset: 04h reset value: 0000 0000h the cic register reports the number of the inte rrupt channel currently serviced. there are 32 possible channel ids (0 to 31), so the significan t register bits are only five (4 down to 0). after reset, the cic value is set to ?0? and is updated by the eic logic only after the processor has started servicing a valid irq interrupt request. to make this happen, some eic registers must be set as in the following:  icr irq_en =1  ier not all 0 (at least one interrupt channel must be enabled)  among the interrupt channels enabled by the ier registers, at least one must have the sipl field, of the related sir register, not set to 0, because the eic generates a processor interrupt request (asserting the nirq line) only if it detects an enabled interrupt request whose priority value is bigger than the cipr (current interrupt priority register) value. when the nirq line is set, the processor will r ead the eic ivr (interrupt vector register), and this read operation will advise the eic logic that the isr (interrupt service routine) has been initiated and the cicr register can be properly updated. the cicr value can?t be modified by the cpu (read only register). bit 31:5 = reserved. bit 4:0 = cic[4:0]: current interrupt channel . number of the interrupt whose service routine is currently in execution phase. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved cic[4:0] -r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 58/401 current interrupt priority register (cipr) address offset: 08h reset value: 0000 0000h the cip register reports the priority value of the interrupt currently serviced. there are 16 possible priority values (0 to 15), so the signif icant register bits are only four (3 down to 0). after reset, the cip value is set to ?0? and is updated by the eic logic only after the processor has started servicing a valid irq interrupt request. to make this happen, some eic registers must be set as in the following:  icr irq_en =1 (to have the nirq signal set)  ier not all 0 (at least one interrupt channel must be enabled)  among the interrupt channels enabled by the ier register, at least one must have the sipl field, of the related sir register, not set to 0, because the eic generates a processor interrupt request (asserting the irq line) only if it detects an enabled interrupt request whose priority value is bigger than the cipr (current interrupt priority register) value. when the irq line is set, the processor will read the eic ivr (interrupt vector register), and this read operation will advise the eic logic that the isr (interrupt service routine) has been initiated and the cipr register can be properly updated. the cipr value can be modified by the processor, to promote a running isr to a higher level: the eic logic will allow a write to the cip field of any value bigger, or equal, than the priority value associated to the interrupt channel currently serviced. e.g.: suppose the irq signal is set because of an enabled interrupt request on channel #4, whose priority value is 7 (i.e. sipl of sir7 is 7); after the processor read of ivr register, the eic will load the cip field with 7. until the interrupt service procedure will be completed, writes of values 7 up to 15 will be allowed, while attempts to modify the cip content with priority lower than 7 will have no effect. bit 31:4 = reserved. bit 3:0 = cip[3:0]: current interrupt priority . priority value of the interrupt whose servic e routine is currently in execution phase. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved cip[3:0] -rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 59/401 interrupt vector register (ivr) address offset: 18h reset value: 0000 0000h the ivr is the eic register the processor has to read after detecting the nirq signal assertion. the ivr read operation tells the eic logic that the interrupt service routine (isr), related to the pending request, has been initiated. this means that:  the irq signal can be de-asserted  the cipr and cicr can be updated  no interrupt requests, whose priority is lower, or equal, than the current one can be processed bit 31:16 = ivr(31:16) : interrupt vector (high portion). its content does not depend on the interrupt to be serviced, but has to be programmed by the user (see note) at initialization time and it?s common to all the interrupt channels. it is read/ write. bit 15:0 = iv(15:0) : interrupt vector (low portion). its content depends on the interrupt to be serviced (i.e. the one, in the enabled bunch, with the highest priority), and it?s a copy of the siv (source interrupt vector) value of the sir (source interrupt register) related to the channel to be serviced. it is read only. note the eic logic does not care about the ivr content: from the controller point of view it?s a simple concatenation of two 16-bit fields  ivr = ivr(31:16) & sirn(31:16) what has to be written both in the ivr(31:16) and in all the sirn(31:16) is mostly implementation dependent, but two main settings can be recognized:  ivr(31:0) contains a 32 bit address 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ivr[31:16] rw 1514131211109 87654321 0 ivr[15:0] r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 60/401  ivr(31:0) contains an instruction in the first case (address), ivr(31:16) will have to be loaded with the higher part of the address pointing to the memory location where the interrupt service routines begin; the single sirn(31:16) will have to contain the lower 16 bi ts (offset) of the memory address related to the channel specific isr. if required and supported by the system/processor configuration, it can also be convenient to initialize ivr(31:16) and sirn(31:16) to provide an instruction opcode (typically a jump) on ivr register read. in this situation, ivr(31:16) has to contain the higher part of the instruction to be passed, while sirn(31:16) will be loaded with the channel depending parameters (usually jump offset). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 61/401 fast interrupt register (fir) address offset: 1ch reset value: 0000 0000h in order for the controller to react to the 3 fast -interrupt (fiq) channels the enable bits from 2 down to 0 must be set to 1. the field 5 down to 3 keeps the information on the interrupt request of the specific channel. bit 31:6 = reserved . bit 5 = fip[2]: channel 2 fast interrupt pending bit bit 4 = fip[1]: channel 1 fast interrupt pending bit bit 3 = fip[0]: channel 0 fast interrupt pending bit these bits are set by hardware by a fast interrupt request on the corresponding channel. these bits are cleared only by software, i.e. wr iting a ?0? has no effect, whereas writing a ?1? clears the bit (forces it to ?0?). 1: fast interrupt pending 0: no fast interrupt pending bit 2 = fie[2]: fiq channel 2 interrupt enable bit bit 1 = fie[1]: fiq channel 1 interrupt enable bit bit 0 = fie[0]: fiq channel 0 interrupt enable bit in order to have the controller responding to a request on a specific channel, the corresponding bit in the fir register must be set to 1. 1: fast interrupt request issued on the specific channel is enabled 0: fast interrupt request issued on the specific channel is disabled 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved fip[2:0] fie[2:0] -rwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 62/401 interrupt enable register 0 (ier0) address offset: 20h reset value: 0000 0000h bit 31 = ier[31]: channel 31 interrupt enable bit bit 30 = ier[30]: channel 30 interrupt enable bit ... bit 1 = ier[1]: channel 1 interrupt enable bit bit 0 = ier[0]: channel 0 interrupt enable bit the ier0 is a 32 bit register: it provides an enable bit for each of the 32 eic interrupt input channels. in order to enable the interrupt response to a specific interrupt input channel the corresponding bit in the ier0 register must be set to ?1?. a ?0? value makes the eic mask the related interrupt channel and the interrupt pending bit, in the ipr register, is never set. 1: input channel enabled 0: input channel disabled 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ier[31:16] rw 1514131211109 87654321 0 ier[15:0] rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 63/401 interrupt pending register 0 (ipr0) address offset: 40h reset value: 0000 0000h bit 31= ipr[31]: channel 31 interrupt pending bit bit 30 = ipr[30]: channel 30 interrupt pending bit ... bit 1 = ipr[1]: channel 1 interrupt pending bit bit 0 = ipr[0]: channel 0 interrupt pending bit the ipr0 is a 32 bit register: it provides a pen ding bit for each of the 32 eic interrupt input channels. this is where actually the information about the channel interrupt status is kept: if the corresponding bit in the enable register ier0 has been set, the ipr0 bit set high (active) means that the related channel has asserted an interrupt request that has not been serviced yet. the bits are read/clear, i.e. writing a ?0? has no effect, whereas writing a ?1? clears the bit (forces it to ?0?). 1: interrupt pending 0: no interrupt pending note before exiting the isr (interrupt service routine), the software must be sure to have cleared the eic ipr0 bit related to the executed routine: this bit clear will be read by the eic logic as end of interrupt (eoi) sequence, and will allow the interrupt stack pop and new interrupts processing . 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ipr[31:16] rc 1514131211109 87654321 0 ipr[15:0] rc 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 64/401 remark: the interrupt pending bits must be handled with care because the eic state machine, and its internal priority hardware stack, could be forc ed to a not recoverable condition if unexpected pending bit clear operations are performed. example: 1. suppose that one or more interrupt channels are enabled, with a priority higher than zero; as soon as an interrupt request arises, the eic fsm processes the new input and asserts the nirq signal. if, before reading the ivr (0x18) register, for any reason, the processor clears the pending bits, the nirq signal will remain asserted the same, even if no more interrupts are pending. the only way to reset the nirq line logi c is to read the ivr (0x18) register. 2. suppose that one or more interrupt channels are enabled, with a priority higher than zero; as soon as an interrupt request arises, the eic fsm processes the new input and asserts the nirq signal. if, after reading the ivr (0x18) register, for any reason, the processor clears the pending bit related to the serviced channel, before completing the interrupt ser- vice routine, the eic logic will detect an end of interrupt command, will send a pop request to the priority stack and a new interrupt, even of lower priority, will be processed. to close an interrupt handling section end of interrupt (eoi), the interrupt pending clear operation must be performed, at the end of the related interrupt service routine, on the pending bit related to the serviced channel; on the other hand, as soon as the pending bit of the serviced channel is cleared (even by mistake) by the software, the eoi sequence is entered by the eic logic. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 65/401 source interrupt registers - channel n (sirn) address offset: 60h to dch reset value: 0000 0000h there are 32 different sirn registers, as many as the input interrupt channels are. bit 31:16 = siv[31:16]: source interrupt vector for interrupt channel n (n = 0... 31). this field contains the interrupt channel depending part of the interrupt vector, that will be provided to the processor when the interrupt vector register (address 0x18h) is read. depending on what the processor expects (32 bi t address or instruction, see ivr description), the siv will have to be loaded with the interr upt channel isr address offset or with the lower part (including the jump offset) of the first isr instruction. bit 15:4: reserved . bit 3:0 = sipl[3:0]: source interrupt priority level for interrupt channel n (n = 0... 31). these 4 bits allow to associate the interrupt channel to a priority value between 0 and 15. the reset value is 0. note to be processed by the eic priority logic, an interrupt channel must have a priority level higher than the current interrupt priority (cip); the lowest value cip can have is 0, so all the interrupt sources that have a priority level equal to 0 will never generate an irq request, even if properly enabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 siv[31:16] rw 1514131211109 87654321 0 reserved sipl[3:0] -rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 66/401 7.4.1 register map refer to table 21 on page 50 for the base address. table 22. eic register map addr. offset register name 313029282726252423222120191817161514131211109876543210 0 icr reserved fi q_ en ir q_ en 4 cicr reserved cic[4:0] 8 cipr reserved cip[3:0] 18 ivr jump instruction opcode or jump base address jump offset 1c fir reserved fip [2:0] fie [1:0] 20 ier0 ier[31:0] 40 ipr0 ipr[31:0] 60 sir0 siv0[31:16] reserved sipl0[3:0] 64 sir1 siv1[31:16] reserved sipl1[3:0] 68 sir2 siv2[31:16] reserved sipl2[3:0] 6c sir3 siv3[31:16] reserved sipl3[3:0] 70 sir4 siv4[31:16] reserved sipl4[3:0] 74 sir5 siv5[31:16] reserved sipl5[3:0] 78 sir6 siv6[31:16] reserved sipl6[3:0] 7c sir7 siv7[31:16] reserved sipl7[3:0] 80 sir8 siv8[31:16] reserved sipl8[3:0] 84 sir9 siv9[31:16] reserved sipl9[3:0] 88 sir10 siv10[31:16] reserved sipl10[3:0] 8c sir11 siv11[31:16] reserved sipl11[3:0] 90 sir12 siv12[31:16] reserved sipl12[3:0] 94 sir13 siv13[31:16] reserved sipl13[3:0] 98 sir14 siv14[31:16] reserved sipl14[3:0] 9c sir15 siv15[31:16] reserved sipl15[3:0] a0 sir16 siv16[31:16] reserved sipl16[3:0] a4 sir17 siv17[31:16] reserved sipl17[3:0] a8 sir18 siv18[31:16] reserved sipl18[3:0] ac sir19 siv19[31:16] reserved sipl19[3:0] b0 sir20 siv20[31:16] reserved sipl20[3:0] b4 sir21 siv21[31:16] reserved sipl21[3:0] b8 sir22 siv22[31:16] reserved sipl22[3:0] bc sir23 siv23[31:16] reserved sipl23[3:0] c0 sir24 siv24[31:16] reserved sipl24[3:0] c4 sir25 siv25[31:16] reserved sipl25[3:0] c8 sir26 siv26[31:16] reserved sipl26[3:0] cc sir27 siv27[31:16] reserved sipl27[3:0] d0 sir28 siv28[31:16] reserved sipl28[3:0] d4 sir29 siv29[31:16] reserved sipl29[3:0] d8 sir30 siv30[31:16] reserved sipl30[3:0] dc sir31 siv31[31:16] reserved sipl31[3:0] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 67/401 7.5 programming considerations here are a few guideline steps on how to program the eic?s registers in order to get the controller up and running quickly. in the following, it is assumed to deal with standard interrupts and that the user wants, for example, to detect an interrupt on channel #22, in which the priority has been assigned to be 5. first of all, it is necessary to assign the priority and the jump address data related to the interrupt channel #22. therefore: set in field sipl of sir22 the binary ?0101?, i.e. priority of 5 (it must be not 0 to have an irq to be generated). two registers are involved to supply the channel interrupt vector data to the eic controller (ivr[31:16] and sir22[31:16]: write in sir22[31:16], i.e. in the upper part of the sir register related to channel #22, the memory address offset (or the jump offset) where the interrupt service routine, related to interrupt channel #7, starts. insert the base jump address (or the jump opcode) in the most significant half of the ivr register, i.e. ivr[31:16]. finally, response to the interrupt must be enabled both at the global level and at the single interrupt channel level. to do so these steps shall be followed: set the irq_en bit of icr to 1 set bit # 22 of ier0 to 1 as far as the fiq interrupts are concerned, since those interrupts do not have any vectorization nor priority, only the first two steps above are involved. supposing the user wants to enable fiq channel #1: set the fiq_en bit of icr to 1. set bit #1 of fie in fir register to 1. 7.6 application note every interrupt service routine (isr) should be composed by the following blocks of code. a header routine to enter isr. it must be: 1) stmfd sp!,{r5,lr} the workspace r5 plus the current return address lr_irq is pushed into the system stack. 2) mrs r5,spsr save the spsr into r5 3) stmfd sp!,{r5} save r5 4) msr cpsr_c,#0x1f reenable irq, go into system mode 5) stmfd sp!,{lr} save lr_sys for the system mode 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 68/401 note r5 is a generic register among those availa ble, namely r0 up to r12. since there is no way to save spsr directly into the arm?s stack, the operation is executed in two steps using r5 as transition help register. the isr body routines . a footer routine to exit isr. it must be: 1) ldmfd sp!,{lr} restore lr_sys for the system mode 2) msr cpsr_c,#0xd2 disable irq, move to irq mode 3) clear pending bit in eic (using the proper iprx) 4) ldmfd sp!,{r5} restore r5 5) msr spsr,r5 restore status register spsr 6) ldmfd sp!,{r5,lr} restore status lr_irq and workspace 7) subs pc,lr,#4 return from irq and interrupt reenabled in the following two paragraphs some comments on the code lines introduced above and some hints useful when realizing subroutines to be invoked by an isr are reported. 7.6.1 avoiding lr_sys and r5 registers content loss a first example refers to a lr_sys content lo ss problem: it is assumed that an isr without instruction 5) in the header routine (and consequently without instruction 1) in the footer routine) has just started; the following happens:  instruction 4) is executed (so system mode is entered)  a subroutine is called with a bl instruct ion and lr_sys now contains the return address a: the first subroutine instruction should store register lr_sys into the stack (the address of this instruction is called b)  a higher priority interrupt starts before previous operation could be executed  new isr stores address b into lr_irq and enters system mode  a new subroutine is called with a bl instruction: lr_sys is loaded with the new return address c (this overwrites the previous value a!) which is now stored into the stack.  the highest priority isr ends and address b is restored: now lr_sys value can be put into the stack but its value has changed to address c (instead of a). the work-around to avoid such a dangerous situation is to insert line 5) at the end of header routine and consequently line 1) at the beginning of footer routine. similar reasons could lead register r5 to be corrupted. to fix this problem, lines 3) in header and 4) in footer should be added. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - enhanced interrupt controller (eic) 69/401 7.6.2 hints about subrou tines used inside isrs a case in which a subroutine is called by an isr is hereafter considered. supposing that such a kind of procedure starts with an instruction like: stmfd sp!, { ... , lr } probably it will end with: ldmfd sp!, { ... , lr } mov pc, lr if a higher priority irq occurs between the last two instructions, and the new isr calls in turn another subroutine, lr content will be lost: so, when the last irq ends, the previously interrupted subroutine will not return to the correct address. to avoid this, the previous two instructions shall be replaced with the unique instruction: ldmfd sp!, { ... , pc } which automatically moves stored link register directly into the program counter, making the subroutine correctly return. 7.7 interrupt latency as soon as an interrupt request is generated (ei ther from external interrupt source or from an on-chip peripheral), the request itself mu st go through three different stages before the interrupt handler routine can start. the interrupt latency can be seen as the sum of three different contributions: latency due to the synchronisation of the input stage. this logic can be present (e.g. synchronization stage on external interrupts input lines) or not (e.g. on-chip interrupt request), depending on the interrupt source. eithe r zero or two clock cycles delay are related to this stage. latency due to the eic itself. two clock cycles are related to this stage. latency due to the arm720t release 3 interrupt handling logic (refer to the documentation available on www.arm.com). table 23. interrupt latency (in clock cycles) synch. stage eic stage min max fiq 02 2 irq 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 70/401 8 wake-up interr upt unit (wiu) 8.1 introduction the wake-up/interrupt management unit supports up of 16 external wake-up/interrupt lines. these 16 wake-up pins (usually alternate function of general purpose i/o lines) can be programmed as external interrupt lines or as wake-up lines, capable of restoring the normal operations from those low power modes where system clocks is stopped. in STR720 implementation, the 16 interrupt li nes are associated to the different irq channels in the following way: 4 external wake-up lines all connected to the irq0 channel of the interrupt controller. these wake-up lines have dedicated input ports. 1 external wake-up line directly mapped to a dedicated channel of the interrupt controller (irq1). this wake-up line has a dedicated input port. 10 internal wake-up lines also connected to the irq2 channel of the interrupt controller module. the ?internal? lines are mapped on some significant STR720 signals. the mapping of wake-up/interrupt events on available wiu lines can be found in section 5.2: wake-up/interrupt management unit (wiu) on page 34 , where also possible limitation of usage can be found. for each wake-up/interrupt line a pending bit is available, so a 16-bit register contains the interrupt pending bits of the 16 external lines (wupr). interrupt pending bits are set by hardware or software on occurrence of the trigger event and are reset by software. a 16-bit register (wumr) is used to mask the interrupt or wake-up requests coming from the 16 wake-up/interrupt lines: resetting the bits of this mask register prevents the interrupt or wake-up requests, generated on the corresponding lines. in order to give more flexibility to the user for the application, a 16-bit register (wutr) allows to program the triggering on rising or falling edge of the external wake-up pins. 8.2 main features  supports 16 external wake-up or interrupt lines.  wake-up lines can be used to wake-up the system from stopped clock conditions.  programmable selection of wake-up or interrupt.  programmable wake-up/interrupt trigger edge polarity.  all wake-up lines maskable. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 71/401 8.3 functional description figure 9. wake-up/interrupt lines management unit block diagram to rccu - stop mode control wutr triggering level pending request mask register wkup[15:0] set wuctrl sw setting wkup-int iint_en stop to interrupt note: reset signal on stop bit is stronger than the set signal. reset register register wupr wumr controller ext_int[15:0] to interrupt controller wui_int 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 72/401 8.3.1 interrupt mode selection. to configure the 16 lines as interrupt sources, use the following procedure:  configure the mask bits of the 16 wake-up lines (wumr);  configure the triggering edge register of the wake-up lines (wutr);  set properly the enable and mask bits co rresponding to the line of interrupt controller tied to wake-up unit: so an interrupt coming from one of the 16 lines can be correctly acknowledged;  reset the wkup-int bit in the wuctrl register to disable wake-up mode (default value is 0);  set the int_en bit in the wuctrl register to enable the 16 wake-up lines as external interrupt source lines. 8.3.2 wake-up mode selection to configure the 16 lines as wake-u p sources, use the following procedure:  set the mask bits of the 16 wake-up lines (wumr).  configure the triggering edge register of the wake-up lines (wutr).  set the enable and the mask bits corresponding to the line of interrupt controller tied to wake-up unit (as for interrupt mode selection), only if an interrupt routine is to be executed after a wake-up event. otherwise, if the wake-up event only restarts the execution of the code from where it was stopped, the interrupt channel shall be masked.  set the wkup-int bit in the wuctrl register to select wake-up mode.  set the int_en bit in the wuctrl register to enable the 16 wake-up lines as external interrupt source lines. this is not mandatory if the wake-up event does not require an interrupt response.  write the sequence 1,0,1 to the stop bit of wuctrl. this is the stop bit setting sequence. pay attention that the three write operations are effective even though not executed in a strict sequence (intermediate instructions are allowed, except for write instructions to the registers of wake-up). if the sequence is not completed within 64 clock periods (system clock), a timeout expires and reset the sequence. in this case the software shall re-enter the sequence (1, 0, 1). to reset the sequence it is sufficient to write twice a logic ?0? to the stop bit of wuctrl register (corresponding anyway to a bad sequence). to detect if stop mode was entered or not, immediately after the last stop bit setting of the sequence, poll the stop bit itself (wuctrl register). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 73/401 8.3.3 stop mode entering conditions assuming the device is in run mode, during the stop bit setting sequence the following case may occur: case 1: a wake-up event on the external wake-up lines occurs during the stop bit setting sequence there are two possible cases: 1 interrupt requests to the cpu are disabled: in this case the device will not enter stop mode, no interrupt service routine will be executed and the program execution continues from the instruction following the stop bit setting sequence. the status of stop bit will be again: stop = 0 the application can determine why the device did not enter stop mode by polling the pending bits of the external lines (at least one must be at 1). 2 interrupt requests to cpu are enabled: in this case the device will not enter stop mode and the interrupt service routine will be executed. the status of stop bit will be again: stop = 0 the interrupt service routine can determine why the device did not enter stop mode by polling the pending bits of external lines (at least one must be at 1). case 2: wrong stop bit setting sequence this can happen if an interrupt request is acknowledged during the stop bit setting sequence. in this case polling on stop bit (wuctrl register) will give: stop = 0 this means that device did not enter stop mode due to a bad stop bit setting sequence: the user shall retry the entire sequence. case 3: correct stop bit setting sequenc e in this case the device enters stop mode. the wkup-int bit can be used by an interrupt routine to detect and to distinguish events coming from interrupt mode or from wake-up mode, allowing the code to execute different procedures. to exit stop mode, it is sufficient that one of the 16 wake-up lines (not masked) generates an event: the clock restarts after the delay needed for the oscillator to restart. note: after exiting from stop mode, the software can successfully reset the pending bits (edge sensitive), even though the corresponding wake-up line is still active (high or low, depending on the trigger event register programming); the user must poll the external pin status to detect and distinguish a short event from a long one (for example a different key pushing time). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 74/401 8.4 register description wake-up control register (wuctrl) address offset: 00h reset value: 0000h bit 15:3 = reserved. these bits must be always written to 0. bit 2 = stop: stop bit. to enter stop mode, write the sequence 1,0,1 to this bit with three write operations . when a correct sequence is recognized, the stop bit is set and rccu puts the device in stop mode (see section 13: reset and clock control unit (rccu) on page 138 ). if the setting sequence isn?t recognized within 64 clock periods, a timeout counter expires and reset the sequence state machine, so the device doesn?t enter in stop mode and the stop bit is reset by hardware. the software sequence succeeds only if the following conditions are true:  the wkup-int bit is 1,  all unmasked pending bits are reset,  at least one mask bit is equal to 1 (at least one external wake-up line is not masked). otherwise the device cannot enter stop mode, and the program continues the execution of the code: the stop bit remains cleared. the bit is reset by hardware if, during stop mode, a wake-up interrupt comes from any of the unmasked wake-up lines. otherwise the stop bit is at 1 in the following cases ( see ?wake-up mode selection? on page 72. for details):  after the first write instruction of the sequence (a 1 is written to the stop bit)  at the end of a successful sequence (i.e. after the third write instruction of the sequence) warning : if interrupt requests are acknowledged during the sequence, the system will not enter stop mode (since the sequence is not completed): at the end of the interrupt service routine, it is suggested to reset the sequence state machine. to reset the sequence it is necessary to write twice a logic ?0? to the stop bit of wuctrl register (corresponding anyway to a bad sequence); on the contrary the incomplete sequence is waiting for the completion and only the timeout counter will reset the state machine. the user must re-enter the sequence to set the stop bit. warning : whenever a stop request is issued to the system, a few clock cycles are needed to enter stop mode. hence the execution of the instruction following the stop bit setting 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved stop int_ en wkup int -rwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 75/401 sequence might start before entering stop mode (consider the arm7 three-stage pipeline). in order to avoid to execute any valid instruction after a correct stop bit setting sequence and before entering the stop mode, it is mandatory to execute a dummy set of few instructions after the stop bit setting sequence. in particular at least six dummy instructions (e.g. mov r1, r1 ) shall be added after the third valid writing operation in stop bit. again, if exiting from stop mode an interrupt routine shall be serviced, another set of dummy instructions shall be added, to take into account of the latency period: this is evaluated in at least other three dummy instructions. this to consider that when stop mode entered, the pipeline content is frozen as well, and when the system restarts the first executed instruction was fetched and decoded before entering the stop mode itself. bit 1 = int_en: interrupt channel enable. this bit is set and cleared by software. 0: global mask for the 16 interrupt lines 1: the 16 external wake-up lines enabled as interrupt sources warning: in order to avoid spurious interrupt requests on the wake-up unit associated channel in the interrupt controller, due to change of interrupt source, it is suggested to reset the mask bit inside the interrupt controller before programming int_en bit as needed. bit 0 = wkup-int: wake-up interrupt. this bit is set and cleared by software. 0: the 16 external wake-up lines can be used to generate interrupt requests 1: the 16 external wake-up lines to work as wakeup sources for exiting from stop mode 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 76/401 wake-up mask register (wumr) address offset: 04h reset value: 0000h bit 15:0 = wum[15:0] : wake-up mask bits if wumx is set, an interrupt and/or a wake-up event (depending on int_en and wkup-int bits) are generated if the corresponding wupx pen ding bit is set. more precisely, if wumx=1 and wupx=1 then:  if int_en=1 and wkup-int=1 then an interrupt and a wake-up event are generated.  if int_en=1 and wkup-int=0 only an interrupt is generated.  if int_en=0 and wkup-int=1 only a wake-up event is generated.  if int_en=0 and wkup-int=0 neither interrupts nor wake-up events are generated. if wumx is reset, no wake-up events can be generated. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 wum15 wum14 wum13 wum12 wum11 wum10 wum9 wum8 wum7 wum6 wum5 wum4 wum3 wum2 wum1 wum0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 77/401 wake-up trigger register (wutr) address offset: 08h reset value: 0000h bit 15:0 = wut[15:0] : wake-up trigger polarity bits the wutx bits can be set and cleared by software to select the triggering edge. 0: the corresponding wupx pending bit will be set upon the falling edge of the input wake-up line. 1: the corresponding wupx pending bit will be set upon the rising edge of the input wake-up line. warning 1 as the external wake-up lines are edge triggered, no glitches must be generated on these lines. 2 if either a rising or a falling edge on external wake-up lines occurs during writing of wutr register, the pending bit will not be set. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 wut15 wut14 wut13 wut12 wut11 wut10 wut9 wut8 wut7 wut6 wut5 wut4 wut3 wut2 wut1 wut0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 78/401 wake-up pending register (wupr) address offset: 0ch reset value: 0000h bit 15:0 = wup[15:0] : wake-up pending bits the wupx bits are read/clear, they are set by hardware on occurrence of the trigger event. they can be reset by software writing a ?1?; writing a ?0? is ignored. 0: no wake-up trigger event occurred 1: wake-up trigger event occurred 8.5 register map refer to table 21 on page 50 for the base address. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 wup15 wup14 wup13 wup12 wup11 wup10 wup9 wu p8 wup7 wup6 wup5 wup4 wup3 wup2 wup1 wup0 rc rc rc rc rc rc rc rc rc rc rc rc rc rc rc rc table 24. wiu register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 wuctrl reserved stop int -en wkup -int 4 wumr wumr[15:0] 8 wutr wutr[15:0] c wupr wupr[15:0] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 79/401 8.6 programming considerations the following paragraphs give some guidelines for the design of the application program. 8.6.1 procedure for entering/exiting stop mode 1 program the polarity of the trigger event of external wake-up lines by writing register wutr. 2 check that at least one mask bit (register wumr) is equal to 1 (at least one external wake-up line is not masked). 3 reset at least the unmasked pending bits: this allows to generate a rising edge on the interrupt channel wui_int when the trigger event occurs (an interrupt is recognized when a rising edge occurs). 4 select the interrupt source of the channel (see description of int_en bit in the wuctrl register) and set the wkup-int bit. note if clock line is chosen as wake-up event, it should be considered that as long as clock source is active the corresponding pending bit will be seen at ?1?. note the change of pll lock condition cannot be used as wake-up event. selecting this input as the only wake-up source will stuck the system so as only a reset event can restore normal operations. 5 to generate an interrupt on the associated channel, set the related enable, mask and priority bits in the interrupt controller. 6 reset the stop bit in register wuctrl. 7 to enter stop mode, write the sequence 1, 0, 1 on the stop bit in the wuctrl register with three write operations. to reset the sequence it is sufficient to write twice a logic ?0? to the stop bit of wuctrl register (corresponding anyway to a bad sequence). if the sequence is not completed within 64 clock periods (system clock), a timeout expires and reset the sequence. in this case the software shall re-enter the sequence (1, 0,1). 8 the code to be executed just after the stop sequence must check the stop bit status to determine if the device entered stop mode or not ( see ?wake-up mode selection? on page 72. for details). if the device did not enter in stop mode it is necessary to re-loop the procedure from the beginning, otherwise the procedure continues from next point (see also section 25.4 on page 368 ). 9 poll the wake-up pending bits to determine which wake-up line caused the exit from stop mode. 10 clear the wake-up pending bit that was set. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - wake-up interrupt unit (wiu) 80/401 8.6.2 simultaneous setting of pending bits it is possible that several simultaneous wake-up event set different pending bits. in order to accept subsequent events on external wake-up/interrupt lines, once the first interrupt routine has been executed, it is necessary to cl ear at least one pending bit (the corresponding pending bit in wuprx register): this operation allows to generate a rising edge on the internal line (if there is at least one more pending bit set and not masked) and so to set the interrupt controller pending bit again. a further interrupt on the same channel of the interrupt controller will be serviced depending on the status of its mask bit. two possible situations may arise: 1 the user chooses to reset all pending bits: no further interrupt requests will be generated on channel. in this case the user has to:  reset the interrupt controller mask bit (to avoid generating a spurious interrupt request during the next reset operation on the wupr register)  reset wupr register. 2 the user chooses to keep at least one pending bit active: at least one additional interrupt request will be generated on the same interrupt controller channel. in this case the user has to reset the desired pending bits. this operation will generate a rising edge on the interrupt controller channel and the corresponding pending bit will be set again. an interrupt on this channel will be serviced depending on the status of corresponding mask bit. 8.6.3 dealing with level-active signals as interrupt lines it must be noticed that using signals generated for level sensitive interrupt lines through the wiu which supports edge-sensitive inputs only, has the consequence of requiring a special handling during the interrupt response routine in order to avoid missing some events. actually it is better to clear the wiu pending bit as first action, so to be able to detect any subsequent edge of the level-sensitive line which could be otherwise skipped if another event occurs while still processing a previously issued one, leaving the wiu line insensitive to any further event occurring on that line. this situation can happen with external interrupt lines, for example, and it is peculiar of lock/unlock events detection. as an example the safest sequence to be followed in the case of a lock/unlock event is reported below: 1 clear wiu pending bit corresponding to the used line (wupr bit 6). 2 clear eic pending bit corresponding to wiu (ipr0 bit 2, if used). 3 clear both rccu pending bits, once the nature of the interrupting event has been detected and taken proper care of (lock_i/ulock_i bits of clkflag). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 81/401 9 dma controller (dmac) 9.1 introduction the dma controller provides access to 2 data streams inside STR720 system. since peripherals are memory mapped, data transfers from/to peripherals are managed like memory/memory data transfers. each data stream can be associated to one particular peripheral, which triggers a dma request starting the data transfer between the corresponding buffers defined in the stream descriptor. data stream 3 of dma controller can alternatively be used as a memory/memory data transfer triggered by a software dma reques t, independently from any peripheral activity. in case data stream 3 is also associated to a peripheral request, the two modes can be selected by software. the dma controller supports circular buffer management avoiding the generation of interrupts when the controller reach the end of the source buffer. when a stream is configured in circular buffer mode and the end of buffer is reached, dma controller reloads the start address and continues the transfer until software notifies the end of operations. the priority between different dma triggering sources is defined by hardware, source 2 being the highest priority request and source 3 being the lowest one. 9.2 main features 2 independently configurable streams. independent source and destination word size, supporting packing and unpacking. 16 word deep fifo. support programmable burst size (1, 4, 8, 16 words). support circular buffer management. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 82/401 9.3 functional description the dma controller is a single channel dma controller capable of servicing up to 2 data streams. to reduce the gate count only one fifo has been implemented which is shared among the 2 data streams via the use of priority selection logic as outlined in table 25 on page 82 . dma request3 is multiplexed with 2 internal request lines which are selected when a memory to memory transfer is required. the dmac block diagram is shown in figure 10 the dma controller can be used for a memory to memory transfer, a peripheral to memory transfer or a memory to peripheral transfer. a dma data transfer consists of a sequence of dma data burst transfers. there are two types of burst transfers, the first one is from the source address to the dma controller and the second one is from the dma controller to the destination address. each data burst transfer is characterized by the burst length (1, 4, 8, or 16 words) and by the word width (1 byte, 2 bytes or 4 bytes). the dma data transfer is complete when the programmed total number of bytes has been transferred from the source addres s to the destination address (terminal count register going to zero). the control logic is used to arbiter between the data streams. it selects the request from the highest priority active data stream, passing the data from the chosen stream to and from the fifo as required. each stream has a set of data stream registers which are used by the control logic to determine source and destinat ion addresses and the amount and format of data to be transferred. they also provide various other control and status information. the dma data stream registers are all 16 bit wide and are accessed via the apb bus. the control logic can read all of these registers and can write some of them. there is a single dedicated interrupt line from the dma controller to the eic. it is driven by 4 internal interrupt flags (two per data stream) which are ored together. they work as follows: once a transfer for a specific stream is complete (this condition being detected by its terminal count register going to zero) the interrupt flag for the data stream is set. the interrupt logic then generates an interrupt to the eic telling it that a request for one of the data streams has been completed. at the same time this data stream is disabled (i.e. the dma controller clears the enable bit of its control register). the status register must be read to determine which data stream caused the interrupt to be raised. the dma controller can now safely reconfigure this data stream (if required) for future transfers. a data stream can be re-enabled via a write to the enable bit of the corresponding control register. table 25. dma request priority dma request priority external2 3 external3 - internal0/1 4 (lowest) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 83/401 the dma fifo block consists of a 16 32-bit words deep fifo plus data pack and data unpack units. the purpose of the fifo block is to accommodate bus latency and burst length, and to perform any packing or unpacking operations on the data that may be necessary to accommodate different data-out/data-in width ratios. dma request 3 is multiplexed with 2 internal request signals which can be used for a memory to memory data transfer. to allow their use, the ?mem2mem? bit in the control register must be figure 10. dma controller block diagram interrupt logic ahb bus fifo apb slave interface control logic ahb master interface dma requests 2 3 interrupt request to eic data stream 2 registers data stream 3 registers apb bus 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 84/401 set. this tells the dma controller that data stream 3 is now configured for an internal, rather than an external, transfer request. an internal data transfer consists of two phases: phase 0 (where internal request 0 is asserted) is used for the memory to fifo data transfer and phase 1 (where internal request 1 is asserted) is used for the fifo to memory data transfer. an internal transfer will begin once the ?mem2mem? bit in the control register is set and data stream 3 is enabled, provided there are no pending requests for any of the other data streams, which all have higher priority. if there are pending requests, then these will be serviced first. when no other requests are pending, phase 0 will start as soon as the channel fifo can accept the next data burst from the source address. the data packet size is defined in the data stream configuration registers. phase 1 is asserted if the channel fifo contains enough data for a next data burst to be sent to the destination address. phase 1 will be also started in order to flush the fifo contents if any of the following conditions occur:  if the terminal count reaches zero this indicates that the fifo has received the total number of bytes to be transferred to the destination address. since this number may be not a integer multiple of the selected burst size, bytes remaining in the fifo after terminal count reaches zero must be flushed to the destination address.  if stream 3 is disabled (via a write to the enable bit of the control register for this data stream). 9.3.1 circular mode operations in circular buffer mode, the dma controller reloads the start address when the word counter (terminal count register) reaches the end of count and continues the transfer until application software sets the last bit, writing into dmalubuff register the buffer location where the last data to be transferred is located. the stream co nfigured in circular mode is controlled by a circular flag in dmactrl register (?0?=nor mal mode, ?1?=circular mode), a last flag in dmalast register (?0?=infinite mode, ?1?=last buffer sweep), and a register dmalubuff (read and write). regarding the usage of circular buffer mode when circular buffer is the source of transfer, application software should operate in the following way: 1. set dma stream configuration registers writing circular bit to?1? and last bit to ?0?. 2. proceed feeding the circular buffer using an index to keep trace of last buffer location used. 3. when the end of transfer condition occurs, write dmalubuff with the value of the index and set last bit to ?1?. 4. the dma interrupt line will be activated as soon as dmalubuff location has been cor- rectly transferred. in case circular buffer is the destination of transfer, application should proceed in a similar way: 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 85/401 1. set dma stream configuration registers writing circular bit to?1? and last bit to ?0?. 2. proceed fetching the circular buffer using an index to keep trace of last buffer location used. 3. when the end of transfer condition occurs, stop dma operation writing dma_en to ?0?. 4. the last buffer location to be used will be indicated by destcurrent register pair. circular buffer mode has the following limitations:  when buffer size is not a multiple of the configured burst size. this is due to the fact that fifo is always flushed when the end of buffer is reached, and the resulting runt burst would not be followed by a transfer moving the remaining locations, located at the beginning of circular buffer, to complete the programmed burst size.  dmalubuff value, when used, must always be aligned to a buffer location which is a multiple of the configured burst size and its distance from the current value of tc (buffer location currently under use) must always be greater than a full burst. this is to prevent setting of last used buffer location to a place where dma is already passed or it is about to pass during the current transfer completion, since dma controller keeps operating in parallel to cpu program execution.  when memory to memory data transfer is configured on stream 3. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 86/401 9.4 register description the dma registers are accessed via the apb bus an d the register data path is 16 bit wide. source base address low x (dmasourcelox) (x=2,3) address offset: 80h - c0h reset value: 0000h dmasourcelox contains the low base address for stream x source dma buffer. bit 15:0 = dmasourcelox[15:0] source base address high x (dmasourcehix) (x=2,3) address offset: 84h - c4h reset value: 0000h dmasourcehix contains the high base address for stream x source dma transfer. bit 15:0 = dmasourcehix[15:0] destination base address low x (dmadestlox) (x=2,3) address offset: 88h - c8h reset value: 0000h dmadestlox contains the low base address for stream x destination dma buffer. bit 15:0 = dmadestlox[15:0] 1514131211109 87654321 0 dmasourcelox rw 1514131211109 87654321 0 dmasourcehix rw 1514131211109 87654321 0 dmadestlox rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 87/401 destination base address high x (dmadesthix) (x=2,3) address offset: 8ch - cch reset value: 0000h dmadesthix contains the high base address for stream x destination dma buffer. bit 15:0 = dmadesthix[15:0] maximum count register x (dmamaxx) (x=2,3) address offset: 90h - d0h reset value: 0000h this register is programmed with stream x maximum data unit count, defining the buffer size. the data unit is equal to the dma data with (byt e, half-word or word) configured for the source side, if dir bit of dmactrlx register is 0, or for the destination side, if dir bit of dmactrlx register is 1. upon enabling dma controller, the content of the maximum count register is loaded in the terminal count register. bit 15:0 = dmamax0[15:0] 1514131211109 87654321 0 dmadesthix rw 1514131211109 87654321 0 dmamaxx rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 88/401 control register 2 (dmactrl2) address offset: 94h reset value: 0000h dmactrl2 register is used to configure stream 2 operations. bit 0 = enable: dma enable 0: dma disable 1: dma enable bit 1 = soinc: increment current source register this bit is used to enable the current source register after each source to dma data transfer. 0: current source register unchanged 1: current source register incremented bit 2 = deinc: increment current destination register this bit is used to enable the current destination register after each dma to destination data transfer. 0: current destination register unchanged 1: current destination register incremented bit 4:3 = sosize: source to dma data width these bits are used to select the data width for source to dma data transfer. 00: 1 byte 01: 1 half-word 10: 1 word 11: reserved bit 6:5 = soburst: dma peripheral burst size these bits are used to define the number of words in the peripheral burst. when the peripheral is the source (dir = 0), sosize words are read in to the fifo before writing fifo contents to destination. when the peripheral is the destination (dir = 1), the dma interface will automatically read the correct number of source words to compile an soburst of the desize data. 00: single 01: 4 incrementing 10: 8 incrementing 11: 16 incrementing 15141312 11109 87654321 0 reserved dir reserved circular desize soburst sosize deinc soinc enable - rw - rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 89/401 bit 8:7 = desize: dma to destination data width these bits are used to select the data width for dma to destination data transfer. 00: 1 byte 01: 1 half-word 10: 1 word 11: reserved bit 9 = circular: circular mode this bit is used to enable dma to operates in the circular buffer mode. 0: normal buffer mode 1: circular buffer mode bit 12:10 = reserved. they must be always written to ?0?. bit 13 = dir: direction transfer this bit defines which field between desize an d sosize is used to compute burst and terminal count word unit; since the side of dma transfer requiring a burst is usually the peripheral one this bit can be considered indicating the direction of the transfer, specifying if the peripheral is acting as source or destination. 0: sosize defines the word unit for burst and terminal count (peripheral is the source). 1: desize defines the word unit for burst and terminal count (peripheral is the destination). bit 15:14 = reserved. they must be always written to ?0?. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 90/401 control register 3 (dmactrl3) address offset: d4h reset value: 0000h dmactrl3 register is used to configure stream 3 operations. bit 0 = enable: dma enable 0: dma disable 1: dma enable bit 1 = soinc: increment current source register this bit is used to enable the current source register after each source to dma data transfer. 0: current source register unchanged 1: current source register incremented bit 2 = deinc: increment current destination register this bit is used to enable the current destination register after each dma to destination data transfer. 0: current destination register unchanged 1: current destination register incremented bit 4:3 = sosize: source to dma data width these bits are used to select the data width for source to dma data transfer. 00: 1 byte 01: 1 half-word 10: 1 word 11: reserved bit 6:5 = soburst: dma peripheral burst size these bits are used to define the number of words in the peripheral burst. when the peripheral is the source (dir = 0), sosize words are read in to the fifo before writing fifo contents to destination. when the peripheral is the destination (dir = 1), the dma interface will automatically read the correct number of source words to compile an soburst of the desize data. 00: single 01: 4 incrementing 10: 8 incrementing 11: 16 incrementing 15141312 11109 87654321 0 reserved dir reserved mem2mem res. circular desize soburst sosize deinc soinc enable -rw-rw-rwrw rw rwrwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 91/401 bit 8:7 = desize: dma to destination data width these bits are used to select the data width for dma to destination data transfer. 00: 1 byte 01: 1 half-word 10: 1 word 11: reserved bit 9 = circular: circular mode this bit is used to enable dma to operates in the circular buffer mode. 0: normal buffer mode 1: circular buffer mode bit 10 = reserved. it must be always written to ?0?. bit 11 = mem2mem: selects memory to memory transfer this configure stream 3 to operate a memory to memory transfer. when mem2mem is set, the dma will disregard the dma request connected to stream 3, and transfer data from source to destination as fast as possible until maxcnt expires. 0: stream3 not configured for mem to mem transfer 1: stream3 configured for mem to mem transfer when the stream 3 is configured as a memory-memory transfer, soburst relates to the source side burst length, regardless of the value written in dir bit (see below). bit 12 = reserved. it must be always written to ?0?. bit 13 = dir: direction transfer this bit defines which field between desize an d sosize is used to compute burst and terminal count word unit; since the side of dma transfer requiring a burst is usually the peripheral one this bit can be considered indicating the direction of the transfer, specifying if the peripheral is acting as source or destination. the value written in this bit is ignored when the channel is configured to perform a memory-to-memory transfer (mem2mem bit written to ?1?). 0: sosize defines the word unit for burst and terminal count (peripheral is the source). 1: desize defines the word unit for burst and terminal count (peripheral is the destination). bit 15:14 = reserved. they must be always written to ?0?. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 92/401 current source address high x (dmasocurrhix) (x=2,3) address offset: 98h - d8h reset value: 0000h dmasocurrhix holds the current value of the high source address pointer related to stream x. this register is read only. bit 15:0 = dmasocurrhix[15:0] current source addres s low x (dmasocurrlox) (x=2,3) address offset: 9ch - dch reset value: 0000h dmasocurrlox register holds the current val ue of the low source address pointer related to stream x. this register is read only. bit 15:0 = dmasocurrlox[15:0] the value in the registers (dmasocurrlo and dmasocurrhi) is used as an ahb address in a source to dma data transfer over the ahb bus. if the soinc bit in the control register is set to ?1?, the value in the current source registers will be incremented as data are transferred from a source to the dma. the value will be incremented at the end of the address phase of the ahb bus transfer by the transferred size value. if soinc bit is ?0?, the current source register will hold a same value during the whole dma data transfer. 1514131211109 87654321 0 dmasocurrhix r 1514131211109 87654321 0 dmasocurrlox r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 93/401 current destination address high x (dmadecurrhix) (x=2,3) address offset: a0h - e0h reset value: 0000h dmadecurrhix holds the current value of the high destination address pointer related to stream x. this register is read only. bit 15:0 = dmadecurrhix[15:0] current destination address low x (dmadecurrlox) (x=2,3) address offset: 24h - 64h - a4h - e4h reset value: 0000h dmadecurrlox holds the current value of the low destination address pointer related to stream x. this register is read only. bit 15:0 = dmadecurrlox[15:0] the value in the registers (dmadecurrlo and dmadecurrhi) is used as an ahb address in a dma to destination data transfer over the ahb bus. if the deinc bit in the control register is set to ?1?, the value in the current destination registers will be incremented as data are transferred from dma to destination. the value will be incremented at the end of the address phase of the ahb bus transfer by the transferred size value. if deinc bit is ?0?, the current destination register will hold a same value during the whole dma data transfer. 1514131211109 87654321 0 dmadecurrhix r 1514131211109 87654321 0 dmadecurrlox r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 94/401 terminal counter register x (dmatcntx) (x=2,3) address offset: a8h - e8h reset value: 0000h dmatcntx contains the number of data units remaining in the current dma transfer. the data unit is equal to the dma data with (byte, half-word or word) configured for the source side, if dir bit of dmactrlx register is 0, or for the dest ination side, if dir bit of dmactrlx register is 1. the register value is decremented every time data is transferred to the dma fifo. when the terminal count reaches zero, the fifo content is transferred to the destination and the dma transfer is finished. this is a read only register. bit 15:0 = dmatcntx[15:0] note dmatcntx register can be used also in circular buffer mode, with the exception of the last buffer sweep. once last flag is set, the value of dmatcntx register becomes not meaningful and should be ignored. last used buffer location x (dmalubuffx) (x=2,3) address offset: ach - ech reset value: 0000h dmalubuffx is used in circular buffer mode during last buffer sweep, and it contains the circular buffer position where the last data to be used by stream x is located. the first buffer location is indicated writing 0x0000 into this register, the second with 0x0001 and so on, up to the last location which is indicated setting thi s register with (dmamaxx - 1). for a description of this register usage, see also circular mode operations on page 84 bit 15:0 = dmalubuffx[15:0] 1514131211109 87654321 0 dmatcntx r 1514131211109 87654321 0 dmalubuff rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 95/401 interrupt mask register (dmamask) address offset: f0h reset value: 0000h the dma mask register is user to select the status flag that can generate an interrupt. bits 1:0 = reserved. they must always be written to 0. bit 2 = sim2: stream 2 interrupt mask this bit controls the generation of dma interrupts triggered by stream 2 transfer end events. 1: stream 2 transfer end interrupt is enabled 0: stream 2 transfer end interrupt is masked bit 3 = sim3: stream 3 interrupt mask this bit controls the generation of dma interrupts triggered by stream 3 transfer end events. 1: stream 3 transfer end interrupt is enabled 0: stream 3 transfer end interrupt is masked bits 5:4 = reserved. they must always be written to 0. bit 6 = sem2: stream 2 error mask this bit controls the generation of dma interrupts triggered by stream 2 transfer errors events. 1: stream 2 transfer error interrupt is enabled 0: stream 2 transfer error interrupt is masked bit 7 = sem3: stream 3 error mask this bit controls the generation of dma interrupts triggered by stream 3 transfer errors events. 1: stream 3 transfer error interrupt is enabled 0: stream 3 transfer error interrupt is masked bit 15:8 = reserved. they must be always written to ?0? 1514131211109 87654321 0 reserved sem3 sem2 res. res. sim3 sim2 res. res. - rwrwrwrwrwrwrw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 96/401 interrupt clear register (dmaclr) address offset: f4h reset value: 0000h the dma clear register is used to clear the status flags. this is a write-only register and it will return 0000h every time it is read. bits 1:0 = reserved. they must always be written to 0. bit 2 = sic2: stream 2 interrupt clear this bit allows clearing the pending interrupt flag corresponding to stream 2 transfer end event. 1: clear int2 flag in dmastatus register 0: no effect bit 3 = sic3: stream 3 interrupt clear this bit allows clearing the pending interrupt flag corresponding to stream 3 transfer end event. 1: clear int3 flag in dmastatus register 0: no effect bits 5:4 = reserved. they must always be written to 0. bit 6 = sec2: stream 2 error clear this bit allows clearing the pending interrupt flag corresponding to stream 2 transfer error event. 1: clear err2 flag in dmastatus register 0: no effect bit 7 = sec3: stream 3 error clear this bit allows clearing the pending interrupt flag corresponding to stream 3 transfer error event. 1: clear err3 flag in dmastatus register 0: no effect bit 15:8 = reserved. they must be always written to ?0? 1514131211109 87654321 0 reserved sec3 sec2 res. res. sic3 sic2 rese. res. - wwwwwww w 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 97/401 interrupt status register (dmastatus) address offset: f8h reset value: 0000h dmastatus provides status information regarding the dma controller. this is a read-only register. bits 1:0 = reserved. they must always be written to 0. bit 2 = int2: data stream 2 interrupt flag when a transfer end event occurs on stream 2, this bit will be set to ?1? and if sim2 bit of dmamask has also set to ?1? by software then a dma interrupt request will be generated. this flag is cleared by writing ?1? in sic2 bit of dmaclear register. bit 3 = int3: data stream 3 interrupt flag when a transfer end event occurs on stream 3, this bit will be set to ?1? and if sim3 bit of dmamask has also set to ?1? by software then a dma interrupt request will be generated. this flag is cleared by writing ?1? in sic3 bit of dmaclear register. bits 5:4 = reserved. they must always be written to 0. bit 6 = err2: data stream 2 error flag when a transfer error event occurs on stream 2, this bit will be set to ?1? and if sem2 bit of dmamask has also set to ?1? by software then a dma interrupt request will be generated. this flag is cleared by writing ?1? in sec2 bit of dmaclear register. bit 7 = err3: data stream 3 error flag when a transfer error event occurs on stream 3, this bit will be set to ?1? and if sem3 bit of dmamask has also set to ?1? by software then a dma interrupt request will be generated. this flag is cleared by writing ?1? in sec3 bit of dmaclear register. bits 9:8 = reserved. they must always be written to 0. bit 10 = act2: data stream 2 status 1: data stream 2 is active. 0: data stream 2 is not active bit 11 = act3: data stream 3 status 1: data stream 3 is active. 0: data stream 3 is not active bit 15:12 = reserved. they must be always written to ?0? 1514131211109 87654321 0 reserved act3 act2 res. res.d err3 err2 res. res. int3 int2 res. res. - rrr rrrrrrrr r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 98/401 last flag register (dmalast) address offset: fch reset value: 0000h dmalast controls the activation of last buffer sweep mode for the streams configured in circular buffer mode. see also circular mode operations on page 84 . bits 1:0 = reserved. they must always be written to 0. bit 2 = last2: last buffer sweep stream 2 this bit is used to notify dma that last circular buffer sweep started. if this bit is set while stream 2 is configured in circular mode, the corresponding data stream interrupt flag will be set when dma uses the circular buffer location contained in dmalubuff2 register. 0: continuous circular buffer mode 1: last circular buffer sweep started. bit 3 = last3: last buffer sweep stream 3 this bit is used to notify dma that last circular buffer sweep started. if this bit is set while stream 3 is configured in circular mode, the corresponding data stream interrupt flag will be set when dma uses the circular buffer location contained in dmalubuff3 register. 0: continuous circular buffer mode 1: last circular buffer sweep started. bit 15:4 = reserved. they must be always written to ?0? 1514131211109 87654321 0 reserved last3 last2 res. res. -rwrwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 99/401 9.4.1 register map the following table summarizes the registers implemented in the dma macrocell table 26. dma register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 80 dma sourcelo2 dmasolo2 84 dma sourcehi2 dmasohi2 88 dma destlo2 dmadelo2 8c dma desthi2 dmadehi2 90 dmamax2 dmamax2 94 dmactrl2 reserved dir reserved circular desize soburst sosize deinc soinc enable 98 dma socurrhi2 dmasocurrhi2 9c dma socurrlo2 dmasocurrlo2 a0 dma decurrhi2 dmadecurrhi2 a4 dma decurrlo2 dmadecurrlo2 a8 dmatcnt2 dmatcnt2 ac dma lubuff2 dmalubuff2 b0 - reserved c0 dma sourcelo3 dmasolo3 c4 dma sourcehi3 dmasohi3 c8 dma destlo3 dmadelo3 cc dma desthi3 dmadehi3 d0 dmamax3 dmamax3 d4 dmactrl3 reserved dir res. mem2 mem res circular desize soburst sosize deinc soinc enable d8 dma socurrhi3 dmasocurrhi3 dc dma socurrlo3 dmasocurrlo3 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dma controller (dmac) 100/401 refer to table 21 on page 50 for the base address. e0 dma decurrhi3 dmadecurrhi3 e4 dma decurrlo3 dmadecurrlo3 e8 dmatcnt3 dmatcnt3 ec dma lubuff3 dmalubuff3 f0 dmamask reserved sem3 sem2 res. res. sim3 sim2 res. res. f4 dmaclr reserved sec3 sec2 res. res. sic3 sic2 res. res. f8 dma status reserved act3 act2 res. res. err3 err2 res. res. int3 int2 res. res. fc dma last reserved last3 last2 res. res. table 26. dma register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 101/401 10 dram controller (dramc) 10.1 introduction the dram controller block is an ahb slave used to provide an interface between the system bus and external memory devices. the memory clock frequency is the same as the system bus clock frequency. the controller supports four external banks, containing either sdram or edo memories; all banks must be of the same memory type. each bank can be independently configured and enabled/disabled by means of internal configuration registers. all the internal registers are accessed via an advanced peri pheral bus interface (apb) to the dram controller. a refresh timer is provided to issue refresh commands to the memory; such refresh counter uses the clk input signal prescaled by 16 in order to trigger the refresh events. 10.2 main features 8, 16 or 32 bits for the memory data bus width. 4 external memory banks. it is possible to use less than four banks, but banks must be contiguous. each bank can span from 64 kbytes up to 32 mbytes in 64 kbytes increments. 128 mbytes of total addressable external memo ry space, when all banks have the maximum size. little endian operations supported. 10.3 functional description 10.3.1 ahb interface the dram controller is a configurable peripheral devoted to manage an external memory component. the ahb interface decomposes the system bus transfers into memory accesses supported by the selected memory bank and performs the data transfers to/from the external chip. at the end of each access it will execute dram precharge, i.e. the sdram banks are not kept open. it supports up to 4 memory banks, where a bank is one single memory chip or more chips that share the same addresses and chip select. if a disabled memory bank is accessed, the controller will return the error response, otherwise it will return the okay response. external memory transfers are configurable to be 8,16 or 32-bit wide. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 102/401 memory address remapping the ahb interface remaps ahb address into dram row and column addresses; the 8, 9 and 10 bits wide column addresses are supported. table 27 shows how ahb address bits are mapped to mia bits as row or column address. note that in the ?column? line bit 10 is always zero, while ba means: the same bit value used in ?row? line. (this because bits [15:10] are ne ver considered when used as column address). the dram controller reads the 27 less signi ficant bits of the ahb address bus; they are decomposed into: byte lanes miblsout[3:0], that are used to select which byte to read/write if the dram data bus is larger than the data to read/write (for instance, when writing one byte into a dram with a 32 bits data bus). they are decoded from haddr[1:0] taking into account ahb data width and dram data width. column address, as specified in table 27 , line ?column?. 8, 9 or 10 bits are really used by the memory. row address, the remaining ahb address bits excluded the last two ones, haddr[26:25]. chip selects micsout[3:0], to select one of four external bank to use. this is determined by the value of haddr[26:16] and the size of each external bank. table 27. dram address bits versus ahb address bits memory data width address column address width memory interface address bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 8 bits column ba ba ba ba ba 0 9876543210 row 9 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 10 x 24 23 22 212019181716151413121110 16 bits column ba ba ba ba ba 0 10987654321 row 8 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 9 x 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 10 x x 24 23 22 21 20 19 18 17 16 15 14 13 12 11 32 bits column ba ba ba ba ba 0 111098765432 row 8 x 24 23 22 212019181716151413121110 9 x x 24 23 222120191817161514131211 10 x x x 24 23 22 21 20 19 18 17 16 15 14 13 12 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 103/401 10.3.2 apb interface the apb interface contains the dram controlle r registers and is us ed only to access these registers. the length of time required to properly transf er data from/to external memory is controlled by an internal bank configuration register which is dedicated to each bank. the data fields of this register determine the number of memory clock cycles used to access that bank; the access time also depends on the bus width and the latency of the selected device. a flag bit in the memory configuration register (one register for all banks) informs the controller if a particular bank is accessible or not. to allow the STR720 to directly configure the sdram devices, the sdram configuration registers are provided. when they are written vi a the system bus, the dram controller will drive memory bus output signals with the values from the sdram configuration registers. this means that the content of the selected register will be outputted on the memory bus and the corresponding memory bank chip select will be asserted, for one clock period. 10.3.3 refresh timer a refresh timer is provided to issue refresh commands to sdram and edo devices. refresh commands are issued to all banks simultaneously. when a refresh is requested, the dramc waits for any active memory transfer to complete before activating the refresh. any system bus memory transfers started while the refresh is in progress are stalled by the controller. the refresh counter uses an enable signal, synchronous with the rising edge of the system clock, which is generated by prescaling clk input signal by 16. this signal is used to ensure that the refresh counter operates at the same frequency regardless of the current system clock configuration depending on pll and rccu settings. if the pwrsave bit in the memory configuration register is set to ?1? , the refresh logic will set external memories in the power save self-refresh mode (as long as the bit remain high). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 104/401 10.4 register description the following paragraphs give detailed descript ions and operations of each of the bits in the dramc registers. bank 1 configuration register (mb1config) address offset: 00h reset value: 0000h the bank 1 configuration register (mb1config) is a 16-bit read/write control register used to configure specific parameters of external region 1 (bank 1). the mb1config control bits are described below. bit 15:12 reserved (should be written as zero and ignored on read ). bit 11:10 devwid[1:0] : device width . this field defines the data width of the external memory device 0. = 0b00. byte (8 bit) = 0b01. half word (16 bit) = 0b10. word (32 bit) = 0b11. reserved. bit 9:8 datalat[1:0] : data latency . this field defines the number of memory clock cycles between the start of a memory read access and the first valid data. this parameter is usually indicated in sdram datasheets as cas latency. the datalat value is valid between 0 and 3. bit 7:5 setuptime[2:0] : setup time. this field defines the number of memory clock cycles the memory drivers spends in a wait state before accessing the external memory. this parameter is usually indicated in sdram datasheets as ras-cas delay. the setuptime value is valid between 0 and 7. note setuptime field should be set using the ras-cas delay value found on sdram datasheet minus 1. as an example to get a ras-cas delay of 2 clock cycles, setuptime should be configured to 1. bit 4:2 idletime[2:0] : idle time . this field defines the minimum time the memory driver must spend in the idle state following memory accesses (the va lue defines the number of memory clock cycles). this parameter is usually indicated in sdram datasheets as precharge delay. the idletime value is valid between 0 and 7. 1514131211109876543210 reserved devwid[1:0] datalat[1:0] setup time[2:0] idletime[2:0] sdramcol[1:0] rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 105/401 bit 1:0 sdramcol[1:0] : sdram column width this field specifies the width of the sdram column address . = 0b00. 8 bits = 0b01. 9 bits = 0b10. 10 bits = 0b11. reserved. bank 2 configuration register (mb2config) address offset: 04h reset value: 0000h the bank 2 configuration register (mb2config) is a 16-bit read/write control register used to configure specific parameters of external region 2 (bank 2). the mb2config control bits are the same as mb1config register. bank 3 configuration register (mb3config) address offset: 08h reset value: 0000h the bank 3 configuration register (mb3config) is a 16-bit read/write control register used to configure specific parameters of external region 3 (bank 3). the mb3config control bits are the same as mb1config register. 1514131211109876543210 reserved devwid[1:0] datalat[1:0] setup time[2:0] idletime[2:0] sdramcol[1:0] rw rw rw rw rw 1514131211109876543210 reserved devwid[1:0] datalat[1:0] setup time[2:0] idletime[2:0] sdramcol[1:0] rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 106/401 bank 4 configuration register (mb4config) address offset: 0ch reset value: 0000h the bank 4 configuration register (mb4config) is a 16-bit read/write control register used to configure specific parameters of external region 4 (bank 4). the mb4config control bits are the same as mb1config register. bank 1 sdram configuration register low (sdram1configlo) address offset: 10h reset value: 0000h the bank 1 sdram configuration register lo w (sdram1configlo) is a 16-bit write only control register used to configure the s dram device of external region 1 (bank 1). the sdram1configlo control bits are described below. bit 15:14 reserved (should be written as zero ). bit 13:0 miab[13:0] : memory interface address bus. this field defines the data to be written in the sdram internal configuration register by directly driving the sdram address bus lines. they will be asserted on the sdram address bus with the value written in sdram1configlo register for one clock period. 1514131211109876543210 reserved devwid[1:0] datalat[1:0] setup time[2:0] idletime[2:0] sdramcol[1:0] rw rw rw rw rw 1514131211109 87654321 0 reserved miab wo 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 107/401 bank 1 sdram configuration register high (sdram1confighi) address offset: 14h reset value: 0000h the bank 1 sdram configuration register hi gh (sdram1confighi) is a 16-bit write only control register used to configure the sdram device of external region 1 (bank 1). the sdram1confighi control bits are described below. bit 15:3 reserved (should be written as zero). bit 2 miwe : memory interface write enable. this bit allows to control directly the value on the sdram write enable line. when it is written to ?1? the corresponding memory pin will be asserted to ?0? for one clock period. this is a write-ony bit. bit 1 miaa : memory interface access active (ncas). this bit allows to control directly the value on the sdram column address strobe line. when it is written to ?1? the corresponding memory pin will be asserted to ?0? for one clock period. this is a write-ony bit. bit 0 misa : memory interface setup active (nras). this bit allows to control directly the value on the sdram row address strobe line. when it is written to ?1? the corresponding memory pin will be asserted to ?0? for one clock period. this is a write-ony bit. bank 2 sdram configuration register low (sdram2configlo) address offset: 18h reset value: 0000h the bank 2 sdram configuration register lo w (sdram2configlo) is a 16-bit write only control register used to configure the s dram device of external region 2 (bank 2). the sdram2configlo control bits are the same as sdram1configlo register. 1514131211109 87654321 0 reserved miwe miaa misa wo wo wo 1514131211109 87654321 0 reserved miab wo 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 108/401 bank 2 sdram configuration register high (sdram2confighi) address offset: 1ch reset value: 0000h the bank 2 sdram configuration register hi gh (sdram2confighi) is a 16-bit write only control register used to configure the s dram device of external region 2 (bank 2). the sdram2confighi control bits are th e same as sdram1confighi register. bank 3 sdram configuration register low (sdram3configlo) address offset: 20h reset value: 0000h the bank 3 sdram configuration register lo w (sdram3configlo) is a 16-bit write only control register used to configure the s dram device of external region 3 (bank 3). the sdram3configlo control bits are the same as sdram1configlo register. bank 3 sdram configuration register high (sdram3confighi) address offset: 24h reset value: 0000h the bank 3 sdram configuration register hi gh (sdram3confighi) is a 16-bit write only control register used to configure the s dram device of external region 3 (bank 3). the sdram3confighi control bits are th e same as sdram1confighi register. 1514131211109 87654321 0 reserved miwe miaa misa wo wo wo 1514131211109 87654321 0 reserved miab wo 1514131211109 87654321 0 reserved miwe miaa misa wo wo wo 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 109/401 bank 4 sdram configuration register low (sdram4configlo) address offset: 28h reset value: 0000h the bank 4 sdram configuration register lo w (sdram4configlo) is a 16-bit write only control register used to configure the s dram device of external region 4 (bank 4). the sdram4configlo control bits are the same as sdram1configlo register. bank 4 sdram configuration register high (sdram4confighi) address offset: 2ch reset value: 0000h the bank 4 sdram configuration register hi gh (sdram4confighi) is a 16-bit write only control register used to configure the s dram device of external region 4 (bank 4). the sdram4confighi control bits are th e same as sdram1confighi register. 1514131211109 87654321 0 reserved miab wo 1514131211109 87654321 0 reserved miwe miaa misa wo wo wo 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 110/401 memory configuration register (memconfig) address offset: 30h reset value: 0000h the memory configuration register (memconfig) is a 16-bit read/write control register used to configure parameters that are the same for all banks. the memconfig control bits are described below. bit 15:14 reserved (should be written as zero and ignored on read ). bit 13 pwrsave : power save mode . this bit selects whether to enter the power save self-refresh mode. = 1. the next refresh cycle will set the memory devices in the self-refresh mode. = 0. next refresh cycle the memories will exit the self-refresh mode. bit 12 type : memory type . this bit selects the type of the external memory. = 1. sdram. = 0. edo. bit 11 b4en : bank 4 enable. this bit enables bank 4 of memory. = 1. bank enabled. = 0. bank disabled. bit 10 b3en : bank 3 enable. this bit enables bank 3 of memory. = 1. bank enabled. = 0. bank disabled. bit 9 b2en : bank 2 enable. this bit enables bank 2 of memory. = 1. bank enabled. = 0. bank disabled. bit 8 b1en : bank 1 enable. this bit enables bank 1 of memory. = 1. bank enabled. = 0. bank disabled. bit 7:0 refr[7:0] : refresh period . this field is used to determine the refresh period. the refresh period can be set in 1514131211109876543210 reserved pwrsave type b4en b3en b2en b1en refr[7:0] rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 111/401 steps of 16 times the clk period (t clk ). the refr value is valid between 0 and 255. for an example of the correspondence between refr setting and refresh period see table 28 refresh period .. size of bank 1 register (bank1size) address offset: 34h reset value: 0000h the size of bank 1 register (bank1size) is a 16-bit read/write control register used to specify the size of external region 1 (bank 1). the bank1size control bits are described below. bit 15:9 reserved (should be written as zero and ignored on read ). bit 8:0 size[8:0] : bank size . this field defines the size of the external memory device 1 in 64 kbytes steps.the size value is valid between 0 and 511, where (size+1) represents the size of the bank in 64kbytes steps. see also table 29 . table 28. refresh period refr refresh period refresh period with f clk = 48 mhz 00000000 refresh is disabled refresh is disabled 00000001 16 * t clk 333.33 ns 00000010 32 * t clk 666.66 ns 00000011 48 * t clk 1 s ... 11111111 4080 * t clk 85 s 1514131211109876543210 reserved size[8:0] rw table 29. size field and the corresponding actual size size field bank actual size 0.0000.0000 1 x 64kbytes = 64kbytes 0.0000.0001 2 x 64kbytes = 128kbytes 0.0000.0010 3 x 64kbytes = 192kbytes ... 0.0000.1111 16 x 64kbytes = 1mbytes 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 112/401 size of bank 2 register (bank2size) address offset: 38h reset value: 0000h the size of bank 2 register (bank2size) is a 16-bit read/write control register used to specify the size of external region 2 (bank 2). the bank2size control bits are the same as bank1size register. size of bank 3 register (bank3size) address offset: 3ch reset value: 0000h the size of bank 3 register (bank3size) is a 16-bit read/write control register used to specify the size of external region 3 (bank 3). the bank3size control bits are the same as bank1size register. ... 0.0001.1111 32 x 64kbytes = 2mbytes ... 0.0011.1111 64 x 64kbytes = 4mbytes ... 0.0111.1111 128 x 64kbytes = 8mbytes ... 0.1111.1111 256 x 64kbytes = 16mbytes ... 1.1111.1111 512 x 64kbytes = 32mbytes 1514131211109876543210 reserved size[8:0] rw 1514131211109876543210 reserved size[8:0] rw table 29. size field and the corresponding actual size size field bank actual size 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 113/401 size of bank 4 register (bank4size) address offset: 40h reset value: 0000h the size of bank 4 register (bank4size) is a 16-bit read/write control register used to specify the size of external region 4 (bank 4). the bank4size control bits are the same as bank1size register. 10.4.1 register map in the table 30 an overview of the dramc registers is reported. refer to table 21 on page 50 for the base address. 1514131211109876543210 reserved size[8:0] rw table 30. dramc register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 mb1config reserved devwid[1:0] datalat[1:0] setuptime[2:0} idletime[2:0] sdram- col[1:0] 4 mb2config reserved devwid[1:0] datalat[1:0] setuptime[2:0} idletime[2:0] sdram- col[1:0] 8 mb3config reserved devwid[1:0] datalat[1:0] setuptime[2:0} idletime[2:0] sdram- col[1:0] c mb4config reserved devwid[1:0] datalat[1:0] setuptime[2:0} idletime[2:0] sdram- col[1:0] 10 sdram1configlo reserved miab 14 sdram1confighi reserved miwe miaa misa 18 sdram2configlo reserved miab 1c sdram2confighi reserved miwe miaa misa 20 sdram3configlo reserved miab 24 sdram3confighi reserved miwe miaa misa 28 sdramc4onfiglo reserved miab 2c sdram4confighi reserved miwe miaa misa 30 memconfig reserved pwr- save type b3en b2en b1en b0en refr[7:0] 34 bank1size reserved size[8:0} 38 bank2size reserved size[8:0} 3c bank3size reserved size[8:0} 40 bank4size reserved size[8:0} 1 .com .com .com .com .com 4 .com u datasheet
STR720 - dram controller (dramc) 114/401 10.5 programming considerations dramc programming and usage is accomplished via the internal registers described in previous paragraphs. at reset time all the controller registers will be reset to 0. it is up to the user the correct programming of the four bank size registers an d bank enable bits in the memconfig register, in order to properly describe the physical devices connected to the dram controller. note that banks are contiguous, even if it is possible to use less than four banks: if an ahb transfer is accessing a disabled bank, the dram controller will return the error response to the ahb master (arm720t cpu or dma controller). after power-up the cpu must configure each sdram device, i.e. perform the precharge-refresh-mode register set procedure as specified in the sdram device data sheet. this is accomplished with the correct values in the 8 sdramxconfiglo,hi registers. a write access to the high registers will start the sdram configuration cycle, during which the value written to the register will be asserted on the memory bus for one clock period. when arm720t caches are enabled, all accesses to sdram memory are performed as bursts of 4 transfers and in order to achieve the highest performance level, sdram interface must be aware of this particular access mode . unfortunately a limitation in arm720t core and sdram interface requires this specific conf iguration to be enforced explicitly by software. this configuration selection is performed by using cache_config bit of sgcr1 register, which can configure STR720 to work in ?burst-access? mode and it should be used whenever cache is enabled, so to have optimal performance from the system. in ?burst-access? mode all transfers issued by arm720t core are identified as 16-byte fixed length burst, possibly early terminated when th e actual burst length is shorter than 16, as it normally happens on cache line refills. in this way any sequence of transfers generated by a cached arm720t core fetching its code from a cached region can be legally completed by sdram interface, including multiple register load/store sequences. when arm720t is used with its cache disabled or it is fetching its code from a non-cacheable sdram region, this bit should remain cleared, so to avoid incurring in a system hang, when long sequences of internal instructions genera tes a sequence of consecutive accesses longer than a 16-byte burst. in case system hangs for this particular configuration mistake, application program execution can be restored only with a system reset. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 115/401 11 external memory interface (emi) 11.1 introduction the external memory interface is a configur able interface designed to control the data flow from an internal advanced high-performance bus (ahb) to external memory components as rom and sram. the total external memory space of 8 mbyte can be subdivided in 2 regions, corresponding to the 2 available chip select signals (cs0..cs1). external memory transfers are always 16 bit wide, the width of the transfers from the ahb bus to the emi peripheral, in accordance with to the ahb specifications, are controlled by the hsize signal (8,16 or 32-bit). note that the external address bus always refers to 16-bit locati on addresses, thus bit position 0 on this bus corresponds to bit 1 on the internal ahb address bus. the length of time required to properly transfer data from/to external memory region is controlled by programming of internal registers dedicated to each external memory space which determines the number of wait states used to access that region. read/write cycle termination can be also configured to be controlled by the ?external ready? signal (eready). each internal register also contains a flag bit which informs the controller if a particular memory space is accessible or not. all the internal configuration registers are acce ssed via an advanced peripheral bus interface (apb) to the emi block. 11.2 main features 8 mbyte of total addressable external memory space. up to 2 external regions/chip selects (banks). bank 0 can span from 64 kbytes up to 8 mbytes in 64 kbytes increments. bank 1 can span from 64 kbytes up to 8 mbytes in 64 kbytes increments. up to 7 configurable wait states for each external memory region. read/write cycle termination via ?externa l ready? (eready) signal (configurable). note only chip select 0 signal is always available on STR720 device, cs1 being shared with different alternate functions or general purpose i/os. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 116/401 11.3 functional description the external memory interface is a configurable peripheral aimed to ease the connection of external memory components. emi memory map is detailed in table 31 . each memory address region (bank), with the exception of bank 0, has a configurable base address (with a granularity of 2k in the 8m total address space) and a configurable size. for bank 1 base address is selected via a dedicated 16-bit re gister (bbase1) that defines the upper 16 bits of the range over which the relevant chip select will be active. for bank 1 the user has the freedom of independently choosing bank start address and bank size. since the physical address going to the external memory (eadd[22:1]) is simply obtained by dropping bits from 31 to 23 of the ahb address, it may happen that the lowest address of the bank does not map to the lowest address of the external memory. this does not mean that the one-to-one correspondence between an address and a physical location in the memory is lost: it means only that lowest address of the bank (as defined by bbase) will map somewhere in the middle of the memory and that, after reaching the top of the physical memory, the address will wrap around to zero. in the special case in which the bank start address is programmed to be a multiple of the bank length, the usual result of having the lowest address of the bank mapped to the lowest address of the external memory is obtained. therefore, to get this usual mapping, a 64 kbyte memory should be only mapped at 64k boundaries, a 128 kbyte memory should be only mapped at 128k boundaries and so on. it is up to the user the consistent programming of the ?base? and ?length? registers. 11.3.1 emi programmable timings each memory bank of the emi can have a programmable number of wait states (up to 7) added to any read or write cycle: this is accomplished via the c_length bitfield of the bconx register (x=0,..,1). this c_setup programing will translate in di fferent cycle lengths, depending on the read or write type of operation and depending on the bank on which the operation is performed. for write cycles which translate in a single external bus operation (e.g. a 16-bit write), the total length (measured in emi internal clock units) that a single access will require (equal to the length over which the chip select will be active) will depend on the memory bank the cycle is executed on. it can be calculated through the formula: setup write enable time hold cs length (write, bank 0/1) = 0 + (c_length+1) + 1 table 31. emi address map bank start address description size bus width 0b_0 bank 0 (cs0) 64k - 8m 16 0b_bbase1[11:0] | 000_0000_0000 bank 1 (cs1) 64k - 8m 16 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 117/401 this means that for memory banks 0 and 1 setup and hold times (measured in emi internal clock units) are fixed. table 32 resumes the write cycle timing configurations. for read cycles which translate in a single external bus operation (e.g. a 16-bit read), the total length (measured in emi internal clock units) that a single access will require (equal to the length over which the chip select will be active) will also depend on the memory bank the cycle is executed on. its total length can be calculated through the formula: setup read enable time hold cs length (read, bank 0/1) = 0 + (c_length+2) + 0 this means that for memory banks 0 and 1 setup and hold times (measured in emi internal clock units) are fixed to zero. table 33 resumes the read cycle timing configurations. 32-bit read or write cycles are translated in 2 external bus cycles so the total external bus cycle duration can be obtained through the following formula total cs length (read/write bank x) = (length of the single cyle)*(2). however it must be noticed that in case of a 32-bit read cycle, resulting in two external bus accesses, the sampling points used to read data in are not placed symmetrically in the two halves of the access, as it is illustrated by the following formulas: sampling point from valid address low word sampling point (read, bank 0/1) = c_length+2 high word sampling point (read, bank 0/1 = c_length+1 for a timing diagram example see also section 11.3.3: read access examples on page 118 . table 32. emi write timings parameter field bank 0,1 setup time n.a. 0 we time c_length ?000?:?111?=1:8 ahb_clk hold time n.a. 1 cs length 2:9 ahb_clk table 33. emi read timings parameter field bank 0,1 setup time n.a. 0 re time c_length ?000?:?111?=2:9 ahb_clk hold time n.a. 0 cs length 2:9 ahb_clk 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 118/401 11.3.2 write access examples in the figure 11 shown below, a 16-bit write is being performed. the external bus width is also 16 bits. as can be seen from the diagram, all 2 external write strobes are asserted for the duration of the write cycle. this is a one-cyc le write and takes 5 ahb_clk cycles to complete (c_length = 3). the 1 lsb of the external add ress is not modified since it is a 16-bit external bus. 11.3.3 read access examples the diagram in figure 12 shows a basic read operation. in the case of a read only 1 external read strobe is required (erdn). in this example, a 32-bit read is being performed on the ahb but since the external bus size is 16 bits, it is necessary for the emi peripheral to perform 2 successive read operations. the results from the 1st read operation are latched figure 11. 16-bit write cycle ahb_clk c_length[2:0] ecs0n ewr0n ewr1n eadd[21:0] edata[15:0] erdn (output) ahb address[22:1] 0x3 access length (3 wait states) data 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 119/401 internally in the emi block (in this case - ?daad? - i.e 16 lsbs of edata) so that the correct data (i.e ?6ff6daad?) is output on the ahb data bus (?hrdata?). for the 1st read operation, eadd[1] is assigned ?0?, for the second this is changed in ?1?. since c_length = 1, total length of access is 6 ahb_clk cycles, first word is sampled 3 ahb_clk cycles after chip select activation and second word is sample 2 ahb_clk cycles after valid address (see formulas in section 11.3.1: emi programmable timings on page 116 ). in this example the minimum time for a read cycle is 2 ahb_clk cycles. note it must be noted that when a 32-bit acce ss cycle is requested, ecsxn line remains active low across the two 16-bit cycles automatically generated by emi where only bit 0 of eadd bus changes. as a consequence emi should be used in this configuration only with external memory devices that do not latch the address bus on the ecsxn falling edge, but instead change their output bus data directly following the address bus change while ecsxn is kept low. this capability is often referred to as ?array data reading? in memory device datasheets. figure 12. 32-bit read cycle on 16-bit memory bus ahb_clk c_length[2:0] ecs0n ewr0n ewr1n eadd[21:1] edata[15:0] erdn (input) ahb address[22:2] 0x0 daad h total access length (1 wait states,) 6ff6 h 0x0 0x1 eadd[0] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 120/401 11.4 register description the following paragraphs give detailed descript ions and operations of each of the bits in the emi registers. bank 0 configuration register (bcon0) address offset: 00h reset value: 7f3dh the bank 0 configuration register (bcon0) is a 16-bit read/write control registers used to configure the operation of external region 0 (bank 0). the bcon0 control bits are described below. bit 15 reserved. this bit must be always written to ?0?. bit 14:8 b_length[6:0] : bank 0 length . the b_length field selects the extension of the address region 0 in 64 kbyte increments. the following figures are expressed in bytes. = 0x00. 64k = 0x01. 128k = 0x02. 192k = 0x03. 256k ... = 0x7f. 8192k (8m) bit 7 eren : external ready enable . this bit selects whether read/write cycle termination is controlled by the ?eready? input signal. = 0. read/write cycle termination is not controlled by ?eready? signal. = 1. read/write cycle termination is controlled by ?eready? signal. bit 6 isyn0 : internal synchronization bank 0. this bit selects whether the eready signals, if used, has to be internally synchronized or not. = 0. no internal synchronization. it provides the fastest bus cycles but requires setup and hold times to be met with respect to the emi internal clock. = 1. internal synchronization. less restrictive, but requires additional wait states caused by the internal synchronization. 1514131211109 87654321 0 res. b_length[6:0] eren isyn0 be c_length[2:0] res. res. - rw rwrwrw rw - - 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 121/401 bit 5 be : bank 0 enable . be bit enables bank 0 of memory. = 1. bank enabled. = 0. bank disabled. bit 4:2 c_length[2:0] : cycle length . the c_length field selects the number of wait states that will be inserted in any read/write cycle performed in memory bank 0. the total cs length of any read or write cycle will be equal to c_length+2 periods of the emi internal clock. = 0x0. 0 wait states. = 0x1. 1 wait state. = 0x2. 2 wait states. = 0x3. 3 wait states. .... = 0x7. 7 wait states. bit 1 reserved. this bit must be always written to ?0?. bit 0 reserved. this bit must be always written to ?1?. note when asynchronous ready operation is configured (eren = 1 and isyn0 = 0) the number of wait states configured in c_length field must be greater than 4. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 122/401 bank 1 configuration register (bcon1) address offset: 04h reset value: 0001h note according to i/o configuration, memory bank 1 could not be accessible. in that case this register must be considered reserved and it must be always written to 0001h. the bank 1 configuration register (bcon1) is a 16-bit read/write control registers used to configure the operation of external region 1 (bank 1). the bcon1 control bits are described below: bit 15 reserved. this bit must be always written to ?0?. bit 14:8 b_length[6:0] : bank 1 length . the b_length field selects the extension of the address region 1 in 64 kbyte increments. the following figures are expressed in bytes. = 0x00. 64k = 0x01. 128k = 0x02. 192k = 0x03. 256k ... = 0x7f. 8192k (8m) bit 7 eren : external ready enable . this bit selects whether read/write cycle termination is controlled by the ?eready? input signal. = 0. read/write cycle termination is not controlled by ?eready? signal. = 1. read/write cycle termination is controlled by ?eready? signal. bit 6 isyn1 : internal synchronization bank 1. this bit selects whether the eready signals, if used, has to be internally synchronized or not. = 0. no internal synchronization. it provides the fastest bus cycles but requires setup and hold times to be met with respect to the emi internal clock. = 1. internal synchronization. less restrictive, but requires additional wait states caused by the internal synchronization. bit 5 be : bank 1 enable . be bit enables bank 1 of memory. = 1. bank enabled. = 0. bank disabled. 1514131211109 87654321 0 res. b_length[6:0] eren isyn1 be c_length[2:0] res. res. - rw rwrwrw rw - - 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 123/401 bit 4:2 c_length[2:0] : cycle length . the c_length field selects the number of wait states that will be inserted in any read/write cycle performed in memory bank 1. the total cs length of any read or write cycle will be equal to c_length+2 periods of the emi internal clock. = 0x0. 0 wait states. = 0x1. 1 wait state. = 0x2. 2 wait states. = 0x3. 3 wait states. .... = 0x7. 7 wait states. bit 1 reserved. this bit must be always written to ?0?. bit 0 reserved. this bit must be always written to ?1?. note when asynchronous ready operation is configured (eren = 1 and isyn0 = 0) the number of wait states configured in c_length field must be greater than 4. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 124/401 bank 1 base address register (bbase1) address offset: 10h reset value: 0000h note according to i/o configuration, memory bank 1 could not be accessible. in that case this register must be considered reserved and it must be always written to 0000h. the bank 1 base address register (bbase1) is a 16 bit read/write register. it defines the location of the bank 1 memory region accordingly to the expression: start address = 0b_bbase1[11:0] | 000_0000_0000, where bits 22 down to 11 of the address are determined by the content of the bbase1 register and remaining bits 10 down to 0 are set to zero. this allows the configuration of the bank start address with a granularity of 2 11 (2k) bytes in the total emi addressable space of 2 23 (8m) bytes. bit 15:12 reserved. these bits must be always written to ?0?. bit 11:0 bbase1[11:0] . bank 1 start address register . the 12 bits of the register are the 12 msb bits of the region start address. 11.4.1 register map in the table 34 an overview of the emi registers is reported. refer to table 21 on page 50 for the base address. 1514131211109 87654321 0 reserved b_base1[11:0] -rw table 34. emi register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 bcon0 res. b_length[6:0] eren isyn0 be c_length[2:0] res. res1 4 bcon1 res. b_length[6:0] eren isyn1 be c_length[2:0] res. res1 8 - reserved (always write 0001h) c - reserved (always write 0001h) 10 bbase1 reserved b_base1[11:0] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - external memory interface (emi) 125/401 11.5 programming considerations emi programming and usage is accomplished via the configuration, status and data registers described in previous paragraphs. at reset time all the emi registers will be re set to 0x0001 or 0x0000 with the exception of the bank 0 configuration register (bcon0) which, out of reset, will be in the following condition: bcon0[15:8]: bank length (b_length0) = 0x7f (8m bytes). bcon0[7]: external ready enable (eren) = 0. external ready not used. bcon0[6]: internal synchronization (isyn0) = 0. no internal synchronization of eready. bcon0[5]: bank enable (be) = 1. bank 0 is enabled. bcon[4:2]: cycle length (c_length) = 0x7. maximum number of wait states (7). a special care must be taken on bit 0 of each bconx register, which must be always written at ?1? to assure a correct functionality of the emi cell. this is true also for the reserved locations at the offset 08h and 0ch respectively. the eren ( external ready enable ) bit in bbcon registers should be set only if the device connected externally does have an access time that is variable. if set, only at the end of the programmed number of wait states, the status of the eready signal will be checked: if it is low a further wait state will be inserted and the process will continue until eready is sampled high. if eren is cleared, the status of eready will be ignored an the read/write cycles will always be completed in the programmed number of wait states. since the usage of eready implies the sampling of an external signal, the user has two options, selected by the status of the isyn bit. if isyn=0, this provides the fastest bus cycle but requires that setup and hold times are met with respect to internal peripheral clock. if isyn=1, eready is internally synchronized by addi tional logic, but this will cause additional wait states determined by the internal synchroniza tion process. when isyn is 0, eready is not internally resampled so to be sure that it is correctly detected by emi logic, the number of configured wait states cannot be lower than 4. the start address and extension of both addres s regions can be configured via configuration registers. however is up to the user to program them consistently, avoiding overlapping in areas where more than one chip select could be active. a simple mechanism is anyway implemented to avoid possible damages to the external components deriving from this (unwanted) condition: a priority does exist such that no more than one chip select can be active at any time. the priority scheme is as follows: cs0 (highest priority) cs1 (lowest priority) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 126/401 12 atapi-ide interface 12.1 introduction the atapi-ide controller allows the STR720 to i nterface to up to 2 devices such as hard disk or cd-rom drives. communication over the ide bus is performed in pio mode only. ide communication in dma or udma modes is not supported. the STR720 initiates communication with the ide device by writing ide commands directly in the ide registers. to save cpu time, the STR720 dma controller may be used in ?memory-to-memory? transfer mode to access the ide registers. 12.2 main features the atapi-ide controller supports the following features:  primary-only channel, supporting up to two ide devices  support for cd-rom and tape peripherals  independently programmable timing for each device  programmable posted writes and read-prefetch  software selectable endianness for data read from cdrom / tape peripheral  support for i/o channel ready  support for pio modes 0, 2, 3 and 4  variable ide:ahb clock ratio 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 127/401 12.3 functional description the atapi-ide interface allows the application to communicate with an external atapi-ide device via pbi. the 82371-type ide is connected to the ahb bus as a slave. operation of the interface is independent of the ahb_clk:pbi ratio, typical ratios will be 2:1 or 3:1. figure 13. atapi-ide interf ace overview block diagram ahb wait states are inserted until the atapi-ide interface has responded to the transaction. the number of wait states will vary depending on the clock ratio and on the stage of the pbi cycle in which the ahb transaction is initiated. typical values will be 3 or 4 wait states for a ratio of 2:1, and 5 or 6 wait states for a divide ratio of 3:1. the above assumes that the pbi does not insert any wait states. for each cycle the pbi de-asserts the rdy signal, the ahb will have additional wait states equivalent to the divide ratio inserted. i.e. 2 for 2:1, 3 for 3:1 etc. ahb idd[0:15] ida[0:2] idiorn idiown ics0n ics1n iordy atapi ide device irq15 to eic 82371 atapi ide irq ide configuration register block ide command register block atapiclk (from rccu) pbi clk clock gating bit peripheral under reset bit (a3brg_pur0 register) (a3brg_pcg0 register) STR720 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 128/401 12.4 programming considerations this section gives a brief overview of the interaction between the atapi-ide controller and the STR720. 12.4.1 initialization due to the fact that this atapi-ide interface is synchronously reset, all its output signals will remain undefined until a valid clock signal is supplied, regardless of the state of its reset input. as a consequence, when initializing the system to use the atapi-ide interface, the following procedure should be followed: 1. remove ide specific reset (controlled by the a3brg_pur0 register). 2. enable ahb clock to the atapi ide interface (using the a3brg_pcg0 register). 3. enable ide related interrupt, if required (irq 15). refer to the enhanced interrupt con- troller chapter). 4. configure the i/o port registers 5. configure port 7 for ide via the p7as bit in the miscellanea global configuration register 6. set up ide controller by programming its configuration registers located from offset 100h to 144h. refer to section 12.5.2.1 . 12.4.2 basic read transfer 1. when a read access to the external ide device is required, the related ide command registers should be programmed accordingly, fo r example by writing the physical address of the device location to be accessed (sector, cylinder, head) and starting the ide device seek operation. 2. the ide device flags any relevant event on its side by a rising edge on the interrupt line (p7.45 pin). this will generate an irq15 interrupt request to the core if the corresponding interrupt mask bit is enabled. refer to the eic register description. 3. in the interrupt service routine the applic ation checks the ide status register to deter- mine which event triggered the interrupt request. 4. if the access to the requested location id e reported as successful, the data can be fetched through the ide data register. if dma is used, the application then requests the dma controller to perform a ?mem- ory-to-memory? transfer from the ide data re gister (offset 010h) to the buffer in system memory where data is to be stored. 5. the end of transfer will be flagged by the dma interrupt, notifying that the programmed number of words has been stored in the memory buffer. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 129/401 12.5 register map the register map is split into two sections. one for ide command registers and the other for ide configuration registers. bit 8 of the location address is used to decode which bank of registers is being accessed, as it is indicated by the address offset reported in the following tables. all addresses specified for the two register blocks are expressed as offsets with respect to the atapi-ide register base address located at 0xc000_0000. 12.5.1.1 ide command register access although the ide command registers are mapped on byte locations in the STR720 memory map they do not behave in the same way as other memory location s. accessing a register causes the ide interface to fetch the selected register from the external ide device. the ide command registers are accessed individually. th is means that it is not possible to access more than one register with a single instruction, even using a 16 or 32- bit instruction. a word access to cylinder low, will not access cylinder high etc. the ide data register is different from the other registers in the command register block. although the data register is mapped on a single byte location, it can be accessed using 16 or 32-bit instructions. a 32-word access results in two 16-bit accesses to the ide devi ce to complete the word on the ahb bus. a half word access results in one access to th e device returning 16 bits of data. 12.5.1 ide command block register set addr. offset register name 76543210 000h- 00fh reserved primary ide port command/data 010h data data (rw) 011h error/features error (r) / features (w) 012h sector count sector count (rw) 013h sector number sector number lba [7:0] (rw) 014h cylinder low cylinder low lba [15:8] (rw) 015h cylinder high cylinder high lba [23:16] (rw) 016h device head device / head lba [27:24] (rw) 017h status/ command status (r) / command (w) 018h - 025h reserved primary ide port control/status 026h alternate sta- tus/ device control alternate status (r) / device control (w) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 130/401 12.5.2 ide configuration register set note access to the ide control registers is not supported. these registers are used to control access to the master interface of the on-chip ide controller, which is not supported by this interface. note the master latency timer, bus master interface address, ultra dma control and ultra dma timing registers in the ide configuration block should not be used. these are omitted from the memory map abov e, flagging their location as reserved. addr. offset register name 76543210 100h venid (vendor id) manufacturer?s identification number (r) 101h 102h devid (device id) device identification number (r) 103h 104h xcmd (command) reserved atapi enable (rw) 105h reserved 106h xsts (status) reserved 107h reserved master target abort status (mtas) (rc) receive target abort (rta) (rc) signaled target abort status (stas) (rc) devsel timing status (devts) (r) reserved 108h revid (revision id) revision identification number (r) 109h (ccp) class code programming class code programming (r) 10ah ccc (class code) sub class 7:0 (r) 10bh base class 15:8 (r) 10ch reserved 10dh 10eh htype (header type) defines format of configuration registers as type 0 and single function (r) 10fh - 13eh reserved 140h pidetim (primary ide timing) drive 1 timing select (tim1) (rw) drive 1 enable prefetch and posting (pp1en) (rw) drive 1 enable iordy sampling (rdy1en) (rw) drive 1 fast timing bank select (ftb1) (rw) drive 0 timing select (tim0) (rw) drive 0 enable prefetch and posting (pp0en) (rw) drive 0 enable iordy sampling (rdy0en) (rw) drive 0 fast timing bank select (ftb0) (rw) 141h ide decode en- abled (dcden) (rw) slave ide tim- ing enable (sten) (rw ) iordy sample point (ispp) (rw) reserved recovery time (rctp) (rw) 142h reserved 143h 144h slidetim (slave ide timing) reserved primary drive 1 iordy sample point (isps) (rw) primary drive 1 recovery time (rcts) (rw) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 131/401 12.5.2.1 ide configuration register descriptions vendor id (venid) address offset: 100h reset value: 8086h bits 15:0 = manufacturer?s identification number device id (devid) address offset: 102h reset value: 7111h bits 15:0 = device identification number command (xcmd) address offset: 104h reset value: 00h bit 0 = atapi enable. this must remain set to ?1? bits 15:1 = reserved. must be kept at reset value. 1514131211109876543210 manufacturer?s identification number [15:0] r 1514131211109876543210 device identification number [15:0] r 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved atapi enable -rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 132/401 status (xsts) address offset: 106h reset value: bits 8:0 = reserved. must be kept at reset value. bits 10:9 = devts : devsel timing status. 01 indicates medium speed timing. bit 11 = stas : signaled target abort status. set when the atapi-ide interface signals a transaction abort (abort signal) bit 12 = rta : receive target abort. set when the atapi-ide interface receives a target abort (mtabort signal). bit 13 = mtas : master abort status . set when the atapi-ide interface generates a master abort. bits 15:14 = reserved. must be kept at reset value. note bits 13, 12 and 11 are read and clear (rc). the bit may be read, the read having no effect on the register value. writing ?0? to the bit has no effect; writing ?1? will clear the bit. revision id (revid) address offset: 108h reset value: 01h bits 7:0 = revision identification number 1514131211109876543210 reserved mas rta stas devsel timing status reserved -rcrcrc r - 76543210 revision identification number r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 133/401 class code programming (ccp) address offset: 109h reset value: 80h bits 7:0 = class code programming class code (ccc) address offset: 10ah reset value: 0101h bits 7:0 = class code: sub class. bits 15:8 = class code: base class. header type (htype) address offset: 10eh reset value: 0h bits 7:0 = configuration registers format. defines the format of configuration registers as type 0 and single-function. 76543210 class code programming r 1514131211109876543210 base class [15:8] sub class [7:0] rr 76543210 configuration registers format r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 134/401 primary ide timing (pidetim) address offset: 140h reset value: 00h bit 0 = ftb0 : drive 0 fast timing bank select. 0: use 16-bit compatible timings to the data port for drive 0 1: use timing for drive 0 defined by bit 3 (tim0) bit 1 = rdy0en : drive 0 iordy sampling enable 0: disable iordy sampling for drive 0 1: enable iordy sampling for drive 0 bit 2 = pp0en : drive 0 prefetch and posting enable 0: disable prefetch and posting for drive 0 1: enable prefetch and posting for drive 0 bit 3 = tim0 : drive 0 timing select 0: pio transfers use fast timing for drive 0 1: pio transfers use mode 0 compatible timing for drive 0 bit 4 = ftb1 : drive 1 fast timing bank select. 0: use 16-bit compatible timings to the data port for drive 1 1: use timing for drive 1 defined by bit 7 (tim1) bit 5 = rdy1en : drive 1 iordy sampling enable 0: disable iordy sampling for drive 1 1: enable iordy sampling for drive 1 bit 6 = pp1en : drive 1 prefetch and posting enable 0: disable prefetch and posting for drive 1 1: enable prefetch and posting for drive 1 bit 7 = tim1: drive 1 timing select 0: pio transfers use fast timing for drive 1 1: pio transfers use mode 0 compatible timing for drive 1 bits 9:8 = rctp : recovery time. defines the minimum number of clock periods inactive between successive cycles: 00=4, 01=3,10=2, 11=1 bits 11:10 = reserved. must be kept at reset value. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 dcden sten ispp reserved rctp tim1 pp1en rdy1en ftb1 tim0 pp0en rdy0en ftb0 rwrw rw - rw rwrwrwrwrwrwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 135/401 bits 13:12 = ispp : iordy sample point. defines how many clock periods before iordry is sampled, 00=5, 01=4, 10=3, 11=2 bit 14 = sten : slave ide timing enable 0: disable slave ide timing. rctp and i spp configurations apply to both drives 0/1 1: enable slave ide timing. rctp and ispp conf igurations apply to just drive 0. to configure drive 1 rctp and ispp settings, use the slidetim register. bit 15 = dcden : ide decode enable 0: disable ide decode 1: enable ide decode slave ide timing (slidetim) address offset: 144h reset value: 00h bits 1:0 = rcts : primary drive 1 recovery time. defines the minimum number of clock periods nird/niwr are inactive between successive cycles: 00=4, 01=3, 10=2, 11=1. note that bit 14 (sten) of pidetim must be set to 1 for these settings to take effect. bits 3:2 = isps : primary drive 1 iordy sample point. defines how many clock periods after nird/niwr is asserted on the ide before iordy is sampled: 00=5, 01=4, 10=3, 11=2. note that bit 14 (sten) of pidetim must be set to 1 for these settings to take effect. bits 7:4 = reserved. must be kept at reset value. 76543210 reserved isps rcts -rwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 136/401 12.6 timing 12.6.1 ide pio read/write cycles figure 14. pio read cycle figure 15. pio write cycle tdsr tdhr tas tisp ida[2:0] ics0n, ics1n idi0rn iordy trs atapi_clk tah idd tas tdsw tdhw tisp ics0n, ics1n idd idi0wn iordy trs tah atapi_clk ida[2:0] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - atapi-ide interface 137/401 table 35. timing descriptions for pio read/write cycles symbol description min max unit trct minimum period between successive idi0rn / idi0wn strobes 114t atapi_clk tdsr data setup to end of idi0rn 10 ns tdhr data hold after idi0rn 5 tdsw data setup to end of idi0wn 3 t atapi_clk tdhw data hold after idi0wn 1 tas address setup to start of idi0rn / idi0wn 24 tah address hold from end of idi0rn / idi0wn 2 tisp idi0rn / idi0wn strobe width 311 trs iordy sample active to idi0rn / idi0wn end 12 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 138/401 13 reset and clock control unit (rccu) 13.1 introduction reset and clock control unit (rccu) is responsible of the control and distribution of the reset and the clock signals of the STR720. 13.2 main features three reset inputs: watchdog reset, hardware reset and software reset two clock inputs: clk and clk_af three clock outputs: ahb clock (ahb_clk ), apb clock (apb_clk) and atapi clock (atapi_clk) pll control including:  pll operation mode (poff output) and multiplication/division (mx and dx output) control  pll reference (pllrefclk) clock selectable between clk and clk/2 four clock domains:  ahb clock can be: clk clock, clk clock divided by 2, 32, 64 clk (or clk/2) clock multiplied by the pll external low frequency clock (clk_af, when available)  apb clock can be: ahb clock divided by 2, 4, 8, 16  atapi clock can be: ahb clock divided by 2 ahb clock divided by 3  pllckref can be: clk clock clk clock divided by 2 four different operating modes: run mode idle mode slow mode stop mode low frequency clock (clk_af) selection for low power consumption modes. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 139/401 13.3 functional description the reset and clock control unit fully manages all the aspects related to reset assertion, reset release, clock generation and configuration. theapb clock domain is fully as ynchronous with respect to the other clock domains. there is a fixed timing relationship between ahb clock domain and atapi clock domain (atapi clock is aligned on ahb falling edge) thus simplifying the logic interface between these 2 domains. 13.3.1 reset management the reset manager generates a reset when one of the following events occurs: a hardware reset, initiated by a low level on the reset pin a software reset, forced setting a control bit inside the rccu a watchdog reset hw reset and watchdog reset are asynchronous: as soon as one of these reset inputs is driven low, a reset cycle is initiated (see figure 16 on page 139 ). when the reset input goes high again or a software reset is asserted, 768 clk plus 8 ahb_clk cycles are counted before exiting the reset state. (this signal is not used in STR720 device) figure 16. reset timing reset ahb_clk ... 768 cycles 8 cycles apb_clk atapi_clk reset internal clk 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 140/401 when reset internal is deasserted, the rccu enters run mode of operation (see below). the event causing the last reset is flagged in the clkflag register: the corresponding bit is set. a hardware initiated reset will leave all th ese bits reset. the hardware reset overrides all other conditions and forces the system to the reset state. during the reset phase, the internal registers are set to their reset values, where these are defined. note on STR720 device, hardware reset pin has to be kept low for a duration longer than the on-chip rc filter width (between 50 ns and 500 ns) in order to start the reset sequence described above. 13.3.2 pll management after reset the pll is not enabled and it must be turned on and enabled by the software. the clk signal drives a programmable divide-by-two circuit. if the div2 control bit in clk_ flag register is set, pllrefclk, is equal to clk divided by two; if div2 is reset, pllrefclk is identical to clk. the divide- by- two circuit ensures also a 50% duty cycle signal. when the pll is active, it multiplies pllrefclk by a factor depending on the status of the mx[5:0] bits in pllconf register. the multiplied clock is then divided, inside the pll, by a factor determined by the status of the dx[1:0] bits in pllconf register; the pll contains a frequency comparator between pllrefclk and the pll clock output that verifies if the pll clock has stabilized (locked status). the bit lock in pllconf register becomes 1 when this condition occurs and maintains this value as long as the pll is locked, going back to 0 if for some reason (noise on input clock line, switch off of pll, stop and restart of pllrefclk and so on) looses the programmed frequency in which it was locked. it is possible to select the pll clock as system clock only when the lock bit is ?1? (the selection is done by clearing pllbyp bit). pll lock status changing is monitored by two different interrupt pending bits:  lock_i monitors pll lock (0 to 1 transition of lock bit)  ulock_i monitors pll unlock (1 to 0 transition of lock bit) system clock switching activity is monitored by div2_f, pllbyp_f, idle_f, slow_f flags inside clkflag register. in order to activate pll to generate system clock, the following procedure is recommended: 1. set multiplication/division factors in pllcon f register, while pll is still switched off. 2. switch on pll by resetting plloff bit in pllconf register. 3. wait for lock bit in pll conf register to become ?1? (or use related interrupt event). 4. switch system clock to pll output, by resetting pllbyp bit in pllconf register. alternatively, if exact system clock frequency is not required during system set-up phase, pllbyp bit can be reset also immediately after resetting plloff bit in pllconf register (but not in the same instruction). in this way system clock is switched immediately to pll output, even if it has not yet settled to its final value. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 141/401 if lock bit return to?0? and autobyp_en bit is set to ?1?, the system clock switches back to pllrefclk disregarding pllbyp bit value. otherwise (i.e. autobyp_en = ?0?) the software has to handle the system clock switching, by monitoring pll lock and by writing a proper bit in clkctl register. autobyp feature can be used to avoid polling lock bit (or enabling the related interrupt) during system start-up phase to automatically switch to pll clock once lock condition has been achieved. note care must be taken in using autobyp feature during normal system operation, since the sudden change of system clock frequency can lead to serial interfaces problem. it is recommended to use this feature with particular care and keeping lock related interrupts active, so to be notified about the clock change event. when pll block needs to be switched off, for example to reduce current consumption upon entering a power save mode, a special sequence is required to avoid blocking the system: 1. set pllbyp bit at ?1? in pllconf register, so to switch back system clock to pllref- clk. 2. wait for pllbyp_f bit in clkflag register to be read back as ?1?, to confirm that system clock switch is completed. 3. set plloff bit at ?1? in pllconf register to safely switch off pll block. in case plloff is set to ?1? without observ ing the sequence above, system clock stops being generated and the device hangs up to the next hardware reset event. whenever pll multiplication/division factor needs to be changed, a switch-off/switch-on cycle must be performed, following the procedures detailed in the paragraphs above. warning a wrong clock selection may cause the system to stop indefinitely. in this case the only way to start again is a hardware reset. 13.3.3 mode of operation four modes of operation are provided 13.3.3.1 run mode run mode is entered when software reset or a hardware reset input is asserted (low) or a watchdog/external reset event occurs, and the entire system asynchronously enter the reset state. rccu reset exit status is the following: pll is off, bypassed and mx = ?000111? and dx = ?11? clk is selected as ahb clock clk/16 is selected as apb clock clk/2 is selected as atapi clock 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 142/401 13.3.3.2 idle mode if slow bit in clkctl register is ?0?, then a low frequency internal clock, (pllrefclk/32), could be used, setting idle bit to ?1?, as source clock for ahb clock and apb, atapi prescalers reference clock. idle mode c an be used when a low power consumption is needed, but no clk_af is available as external low frequency clock source . 13.3.3.3 slow mode when active (slow bit = ?1?) the external clk_af low frequency clock source is selected as system clock. (refer also to idle mode) 13.3.3.4 stop mode a stop mode is provided, where all clocks are stopped, while power supply is maintained to the whole chip. stop mode is entered only if stop_en bit inside mskctl register has been written to ?1?. in this case stop input driven active (high) causes the rccu to stretch all system clocks. normal operation may be resumed by an external event, connected to stop input (refer to wiu specification). after wake-up, operations resume from previous state without any loss of information. warning : all low power modes are completely under software control via the proper configuration of the rccu registers . figure 17. clock control unit programming 1/2 clk clk_af pll clock multiplier unit /divider apb_clk ahb_clk 1/2, 1/4 1/32 atapi_clk clk_af (32 khz) div2 pllbyp slow idle nstop 1/8, 1/16 1/2, 1/3 stop_en pllclkref 1 0 1 1 1 0 0 0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 143/401 13.4 register description pll configuration register (pllconf) address offset: 00h reset value: 03c7h this register is write protected and can be unlocked using reg_prot bit in sysprot register. bit 15 = lock : pll locked in this bit is read only. 0: the pll is not locked or turned off and cannot be selected as system clock source 1: the pll is locked bit 14 = autobyp_en : auto-bypass enable this bit enables the auto-bypass mode. in auto-bypass mode when the lock bit return to ?0? the system clock switches back to pllclkref even if the pllbyp bit is ?0?. 0: auto-bypass mode off 1: auto-bypass mode on bit 13:10 = reserved. give ?0? when read and must be written to ?0?. bit 9 = plloff: pll switch off 0: pll is switched on 1: pll is switched off bit 8 = pllbyp: pll bypass bit (see also autobyp_en bit) 0: pll provides the system clock 1: pll is bypassed and pllclkref is used as system clock note if pllbyp changes from ?1? to ?0?, but plloff bit is ?1?, no clock switch occurs since pll is switched on again and a stable clock is available, but pll may be not yet locked. bit 7:6 = dx[1:0]: pll output clock divider factor. this bit field selects the divider factor used on the pll output clock. refer to table 36 for pll divider setting. 1514131211109 87654321 0 lock autob yp_en reserved plloff pllbyp dx[1:0] mx[5:0] r rw - rw rw rw rw rw rw rw rw rw rw table 36. pll divider settings dx1 dx0 ck 0 0 pllclkref/1 0 1 pllclkref/2 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 144/401 bit 5:0 = mx[5:0]: pll multiplication factor. this bit field selects the multiplier factor used to generate pll output clock from its input reference clock. refer to table 37 for multiplier settings warning not all clock selections are possible and setting the system clock to any unsupported frequency may cause the system to malfunction. in this case the only way to start again is a hardware reset. for the allowed values, refer to section 25 on page 364 . 1 0 pllclkref/4 1 1 pllclkref/8 table 37. pll multiplication factors mx5 mx4 mx3 mx2 mx1 mx0 multiply factor 0 to 7 n/a 000111 8 001000 9 001001 10 ... ... ... ... ... ... ... 001111 16 010000 17 ... ... ... ... ... ... ... 011111 32 100000 33 ... ... ... ... ... ... ... 111111 64 table 36. pll divider settings 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 145/401 dividers configuration register (divconf) address offset: 04h reset value: 001fh this register is write protected and can be unlocked using reg_prot bit in sysprot register. bit 15:5 = reserved. give ?0? when read and must be written to ?0?. bit 4:3 = reserved . bit 2 = atapi_sel : atapi clock select 0: select ahb_clk/2 as atapi clock 1: select ahb_clk/3 as atapi clock bit 1:0 = apb_div[1:0] : apb output clock divider factor. this bit field configures the a-apb clock generation. refer to table 38 for a-apb divider settings . 1514131211109 87654321 0 reserved reserved atapi_ sel apb_div[1:0] -rwrwrwrwrw table 38. apb divider settings apb_div1 apb_div0 apb_ck 0 0 ahb_clk/2 0 1 ahb_clk/4 1 0 ahb_clk/8 1 1 ahb_clk/16 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 146/401 clock flag register (clkflag) address offset: 08h reset value: 0020h after hardware reset reset value: 0021h after software reset reset value: 0022h after watchdog reset bit 15 = lock_i : lock changing interrupt bit this bit indicates a 0 to 1 transition on the pll lock signal. only rccu block can set it to ?1? when pll reaches the lock condition. application software writing ?1? on this bit will clear its value; writing ?0? has no effect. 0: no lock interrupt request is provided 1: lock interrupt request is active bit 14 = ulock_i : un lock changing interrupt bit this bit indicates a 1 to 0 transition on the pll lock signal. only rccu block can set it to ?1? when pll loses the lock condition. application software writing ?1? on this bit will clear its value; writing ?0? has no effect. 0: no unlock interrupt request is provided 1: unlock interrupt request is active bit 13:7 = reserved. give ?0? when read and must be written to ?0?. bit 6 = div2_f : div2 mux status flag this bit is read only. it indicates the actual status of the pllclkref clock 0: indicates that pllclkref is clk 1: indicates that pllclkref is clk/2 bit 5 = pllbyp_f : pll mux status flag this bit is read only. it indicates that the pllclk clock is actually selected. 0: indicates that pllclk is selected 1: indicates that pllclk is not selected bit 4 = idle_f : idle mux status flag this bit is read only. it indicates that the idle clock (pllclkref/32) is actually selected. 0: indicates that idle clock is not selected 1: indicates that idle clock is selected bit 3 = slow_f : slow mux status flag this bit is read only. it indicates that the clk_af clock is actually selected. 0: indicates that clk_af clock is not selected 1: indicates that clk_af clock is selected 1514131211109 87654321 0 lock_i ulock _i reserved div2_f pllby p_f idle_f slow_ f res. wdgr st_f swrst _f rcrc - rrrr-r r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 147/401 bit 2 = reserved. give ?0? when read and must be written to ?0?. bit 1 = wdgrst_f : watchdog reset status flag this bit is read only. 0: no watchdog reset occurred. 1: watchdog reset occurred. bit 0 = swrst_f : software reset status flag this bit is read only. 0: no software reset occurred. 1: software reset occurred. clock control register (clkctl) address offset: 0ch reset value: 0000h this register is write protected and can be unlocked using reg_prot bit in sysprot register. bit 15:4 = reserved. give ?0? when read and must be written to ?0?. bit 3 = swrst : software reset bit 0: no software reset occurs. 1: software reset occurs. bit 2 = div2 : div2 select 0: select clk as pllclkref 1: select clk/2 as pllclkref bit 1 = idle : idle mode select bit 0: idle mode not selected 1: select idle mode bit 0 = slow : slow mode select bit 0: slow mode not selected 1: select slow mode 1514131211109 87654321 0 reserved swrs t div2 idle slow -rwrwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 148/401 mask control register (mskctl) address offset: 10h reset value: 0000h bit 15 = lock_i_en : lock interrupt masking bit 0: no interrupt requests on pll lock are provided by rccu 1: the rccu can request a lock interrupt bit 14 = ulock_i_en : un lock interrupt masking bit 0: no interrupt requests on pll unlock are provided by rccu 1: the rccu can request a unlock interrupt bit 13:1 = reserved. give ?0? when read and must be written to ?0?. bit 0 = stop_en : stop mode enable bit 0: stop mode is not enabled. 1: stop mode enabled. system protection register (sysprot) address offset: 14h reset value: 0000h bit 15:1 = reserved. give ?0? when read and must be written to ?0?. bit 0 = reg_prot : register write protection bit this bit is set and cleared by software. it is cleared by hardware after every write access to pllconf, divconf and clkctl registers. this bit enables the pllconf, divconf and clkctl registers writing. 0: write access to pllconf, divconf and clkctl registers is disabled 1: write access to pllconf, divconf and clkctl registers is enabled 1514131211109 87654321 0 lock_i _en ulock _i_en reserved stop_ en rw rw - rw 1514131211109 87654321 0 reserved reg_p rot -rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - reset and clock control unit (rccu) 149/401 13.4.1 register map refer to table 21 on page 50 for the base address. table 39. rccu register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00 pllconf lock autob yp_en reserved pllof f pllb- yp dx[1:0] mx[5:0] 04 divconf reserved reserved atapi_ sel apb_div[1:0] 08 clkflag lock_ i ulock _i reserved div2_f pllby p_f idle_f slow _f res. wdgr st_f swrs t_f 0c clkctl reserved swrs t div2 idle slow 10 mskctl lock_ i_en ulock _i_en reserved stop_ en 14 sysprot reserved reg_p rot 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 150/401 14 real time clock (rtc) 14.1 introduction the rtc provides a set of continuously runnin g counters which can be used, with suitable software, to provide a clock-calendar function. the counters values can be written to set the current time/date of the system. the rtc includes an apb slave interface, to provide access by word to internal 48-bit registers. this interface is properly disco nnected by the apb bus when the main power supply is removed. 14.2 main features 48-bit programmable counter for long term measurement external clock input, clk_af, defining rtc tick s (must be at least 4 times slower than apb clock) driven by two different sources:  32 khz crystal oscillator connected to oscin and oscout  external clock generator connected to oscin separate power supply 2 dedicated maskable interrupt lines:  alarm interrupt, to generate a software programmable alarm interrupt (up to 1 s)  periodic interrupt, to generate a software programmable periodic interrupt (up to 32 s) 14.3 functional description 14.3.1 overview the rtc consists of two main units (see figure 18 on page 151 ), the first one (s-apb interface) is used to interface with the apb bu s. this unit also contains a set of 16-bit registers, synchronous to the s-apb clock and ac cessible from the apb bus in read or write mode (for more details refer to register description section). the apb interface is clocked by s-apb clock in order to interface with apb bus. the other unit (rtc core) consists of three programmable registers. the first is made of a 48-bit programmable counter that may be initialized to the current system time. the system time is incremented at clk_af rate and compared with a programmable date (stored in the second 48-bit register, rtca) in order to generate an alarm via an interrupt (alarm), if enabled in the rtccr control register. the third register is the 20-bit rtcp register that is 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 151/401 loaded with the value of the desired period to create a periodic interrupt of a programmable value. figure 18. rtc simplified block diagram rtc_perit 48-bit programmable rtccnt = clk_af s-apb interface s-apb bus perint alarm rtccr rtc_alarmit rtca rtc core rtcrst rtcp counter 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 152/401 14.3.2 reset procedure all system registers are asynchronously reset by either an external reset event (rstin device input pin, forced low) or an internal reset event (wdg or software reset), except rtca, rtcp, rtccnt registers. to reset them, the rtcrst device input pin has to be forced low: rtca, rtcp and rtccnt regi sters are reset to ffff_ffff_ffffh, 0_8000h and 0000_0000_0000h respectively. 14.3.3 free-running mode after reset the peripheral will enter in free-running mode. in this operating mode the rtc programmable counter starts counting. interrupt flags are activated too but, since interrupt signals are masked, there is no interrupt generation. interrupt signals must be enabled by setting the appropriate bits in rtccr register. in order to avoid spurious interrupt generation it is recommended to clear old interrupt requests before enabling them. 14.3.4 configuration mode to write to the rtccnt, rtcp and rtca registers, the peripheral must enter configuration mode. this is obtained writing cnf bit at ?1?. in addition, the writing operation is only enabled if the previous writing operation is finished. to enable software to detect this situation the status bit rtoff is provided in the rtccr control register to indicate that an update of the registers is in progress. a new value must not be written to the rtc counters until the status bit val ue is ?0? since as long as rtoff bit is ?0? all attempts to write any rtc register will fail. a special case of configuration mode is enter ed also as soon as rtccr register is written with cnf at ?0?. in this case rtoff becomes ?0? i mmediately and it remains as such for 1 or 2 clk_af cycles, preventing any subsequent modification until its normal state is restored. during this special configuration mode, only rtccr contents are updated, while rtccnt, rtcp and rtca registers remain unaffected. 14.4 register description the rtc registers can only be accessed by wo rd. the reserved bits can not be written and they are always read at ?0?, unless otherwise specified. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 153/401 rtccr: rtc control register address offset: 00h reset value: 0020h the functions of the rtc are controlled by this control register. it is not possible to write this register while the peripheral is completing a previous write operation (flagged by rtoff=0 (see ?configuration mode? on page 152 ). bit 15:11 = reserved. these bits must always be written to ?0?. bit 10 = peren : periodic interrupt enable 0: periodic interrupt is masked. 1: periodic interrupt is enabled. bit 9 = aen : alarm interrupt enable 0: alarm interrupt is masked. 1: alarm interrupt is enabled. bit 8 = reserved. this bits must always be written to ?0?. the above listed bits are used to mask interr upt requests. note that at reset all interrupts are disabled, so it is possible to write the rtc regi sters so that no interrupt requests are pending after initialization. bits 7:6 = reserved. these bits must always be written to ?0?. bit 5 = rtoff : rtc operation off with this bit rtc reports the status of the la st write operation performed on its registers, indicating if it has been completed or not. if its value is ?0? then it is not possible to write any rtc register. this bit can only be read by software. 0: last write operation on rtc registers is still active. 1: last write operation on rtc registers terminated. note a read operation on rtc registers with rtoff=0 returns anyway their current value. bit 4 = cnf : configuration flag this bit must be set at ?1? by software in or der to enter the configuration mode thus allowing to write new values in rtccnt, rtca, rtcp regi sters. the writing operation is really executed when the cnf bit after being set, is reset again by software. 0: exit configuration mode (start update of rtc registers). 1: enter configuration mode. bit 3 = reserved. this bits must always be written to ?0?, but it will be read back as ?1? . 1514131211109 87654321 0 reserved peren aen res. reserved rtoff cnf res. perir air res. -rwrw--rrw-rcrc- 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 154/401 bit 2 = perir : periodic interrupt request this bit stores the status of periodic interrupt request signal ( rtc_perit ) generated by the 20 bit programmable counter when the threshold set in rtcp register is reached. when this bit is at ?1?, the corresponding interrupt will be generated only if peren bit is set to ?1?. perir bit can be set at ?1? only by hardware and can be cleared only by software, while writing ?1? will left it unchanged. 0: periodic interrupt condition not met. 1: periodic interrupt request pending. bit 1 = air : alarm interrupt request this bit contains the status of periodic interrupt request signal ( rtc_alarmit ) generated by the 48 bit programmable counter when the thres hold set in rtca register is reached. when this bit is at ?1?, the corresponding interrupt will be generated only if aen bit is set to ?1?. air bit can be set at ?1? only by hardware and can be cleared only by software, while writing ?1? will left it unchanged. 0: alarm interrupt condition not met. 1: alarm interrupt request pending. note the alarm event generated during the standby mode (and so with the device kept under reset by external rstin forced low) does not set the air bit. note any alarm event generated during stop mode occurs after 1s regardless of the value programmed in the rtca register. bit 0 = reserved. this bits must always be written to ?0?, but it will be read back as ?1? . any interrupt request remains pending until the appropriate rtccr request bit is reset by software, notifying that the interrupt request has been granted. rtccnt: rtc counter registers the rtc counter has three 16 bit programmable counters; their count rate is based on the clk_af time reference. rtccnt registers keep the counting value of these counters. they are write protected by bit rtoff of rtccr re gister, write operation is allowed if rtoff value is ?1?. a write operation on any of the three registers (cnt_h, cnt_m or cnt_l) loads directly the corresponding programmable counter. when reading, the current value in the counter (system date) is returned. the counters keep on running while the external clock oscillator is working even if the system is powered down. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 155/401 rtccnt_l address offset: 04h reset value: 0000h bit 15:0 = rtccnt[15:0]: rtc counter low reading rtccnt_l register, the current value of the lower part of rtc counter register is returned. to write this register it is required to enter into configuration mode (see rtoff bit of rtccr register). rtccnt_m address offset: 08h reset value: 0000h bit 15:0 = rtccnt[31:16]: rtc counter middle reading rtccnt_m register, the current value of the middle part of rtc counter register is returned. to write this register it is required to enter into configuration mode (see rtoff bit of rtccr register). rtccnt_h address offset: 0ch reset value: 0000h bit 15:0 = rtccnt[47:32]: rtc counter high reading rtccnt_h register, the current value of the high part of rtc counter register is returned. to write this register it is required to enter into configuration mode (see rtoff bit of rtccr register). 1514131211109 8 7654321 0 rtccnt[15:0] rw 1514131211109 8 7654321 0 rtccnt[31:16] rw 1514131211109 8 7654321 0 rtccnt[47:32] rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 156/401 rtca: rtc alarm registers when the programmable counter rtccnt reaches the 48 bit value stored into rtca registers an alarm is triggered and the interrupt request rtc_alarmit is generated. this register is write protected by bit rtoff of rtccr register, write operation is allowed if rtoff value is ?1?. rtca_l address offset: 10h reset value: ffffh bit 15:0 = rtca[15:0]: rtc alarm low reading rtca_l register, the lower part of alarm time is returned. to write this register it is required to enter into configuration mode (see rtoff bit of rtccr register). rtca_m address offset: 14h reset value: ffffh bit 15:0 = rtca[31:16]: rtc alarm middle reading rtca_m register, the middle part of alarm time is returned. to write this register it is required to enter into configuration mode (see rtoff bit of rtccr register). rtca_h address offset: 18h reset value: ffffh 1514131211109 8 7654321 0 rtca[15:0] rw 1514131211109 8 7654321 0 rtca[31:16] rw 1514131211109 8 7654321 0 rtca[47:32] rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 157/401 bit 15:0 = rtca[47:32]: rtc alarm high reading rtca_h register, the high part of alarm time is returned. to write this register it is required to enter into configuration mode (see rtoff bit of rtccr register). rtcp: rtc periodic value registers these registers keep the period counting value of the rtc periodic tick. it is write protected by bit rtoff of rtccr register, write operation is allowed if rtoff value is ?1?. they are used to strobe a periodic interrupt signal, rtc_perit , each time the counter counts down from the rtcp value. when it reaches this threshold it resets itself and begins again. this signal is independent of the other system interrupts in terms of alignment. the reset value sets the register signal period to 1 second. when reading, the current value in the counter elapsing the period of the programmable tick is returned. note if the rtcp registers are loaded with the value 00000000h then the periodic interrupt will always be high until the register is loaded with a different periodic value. rtcp_l address offset: 1ch reset value: 8000h bit 15:0 = rtcp[15:0]: rtc periodic low reading rtcp_l register, the low part of current rtcp counter value is returned. to write this register it is required to enter into c onfiguration mode (see rtoff bit of rtccr register). rtcp_h address offset: 20h reset value: 0000h bit 15:4 = reserved. these bits must always be written to ?0?. bit 3:0 = rtcp[19:16]: rtc periodic high reading rtcp_h register, the high part of current rtcp counter value is returned. to write this register it is required to enter into c onfiguration mode (see rtoff bit of rtccr register). 1514131211109 8 7654321 0 rtcp[15:0] rw 1514131211109 8 7654321 0 reserved rtcp[19:16] -rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 158/401 14.4.1 register map rtc registers are mapped as 16 bit addressable registers as described in the table below: refer to table 21 on page 50 for the base address. 14.5 programming considerations rtc configuration procedure can be described by the following steps: 1. reading rtoff until its value is ?1. 2. writing cnf control bit at ?1?. 3. writing one or more rtc registers. 4. writing cnf control bit at ?0?, along with any other required rtccr change. 5. read back updated register for confirmation. the writing operation actually takes effect only when cnf bit is written back to ?0? and it needs at least 2 cycles of clk_af to be terminated. during those 2 clk_af cycles, all rtc registers are updated simultaneously, so the sequence used to write them during the configuration phase is not relevant. there are no particular constraints about the total length of configuration procedure, as the actual update of the registers happens only when cnf bit is reset to ?0?. note the configuration procedure described above should be executed by a routine located in internal ram so to avoid an y possible interaction between rtc register update and the board noise induced by external memory access, especially when the code is executed from external sdram memory. rtc register update sequence is quite sensitive to noise induced on th e clock oscillator, and unexpected reset of rtoff bit could occur if such interaction happens. in this case resetting rtc block by using rtcrst pin will restore normal rtc operations. it is important to consider that once cnf bit is reset to ?0? and the actual update begins, none of the rtc registers can be modified, rtccr included, until the update terminates (rtoff becomes ?1? again). since this period of time is quite long in terms of cpu clock periods (it is table 40. rtc register map addr. offset register name 1514131211109876543210 0 rtccr reserved gen peren aen res.. reserved rt off cnf gir perir air res.. 4 rtccnt_l cnt_l 8 rtccnt_m cnt_m c rtccnt_h cnth 10 rtca_l alarm_l 14 rtca_m alarm_m 18 rtca_h alarm_h 1c rtcp_l period_l 20 rtcp_h reserved period_h 1 .com .com .com .com .com 4 .com u datasheet
STR720 - real time clock (rtc) 159/401 at least one clk_af period, i.e. about 30 s using 32 khz crystal oscillator), it is important to consider it when rtc register update occurs within an interrupt response routine, since also interrupt pending bits, located in rtccr, can be cleared only when rtoff is ?1?. as a consequence it is recommended to clear irq pending bits before or during the same configuration procedure used to update other rtc registers. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 160/401 15 asynchronous ahb-apb bridge (a3brg) 15.1 introduction in order to reduce power consumption, it is possible to use different clock domains depending on the performances of each block. typically, the core will run with a fast clock, whereas a slower clock can be sufficient for most peripherals. nevertheless, in low power mode, the core can also be clocked by a slower clock in order just to manage with peripherals requests. the asynchronous ahb/apb bridge enables to con nect completely asynch ronous ahb with apb buses. it implements a synchronization stage that enables to re-synchronize the ahb with the apb. the ahb/apb clocks ratio could be typicall y around 1/10. as a consequence, an apb read access will need more than 20 ahb cycle to be done. 15.2 main features asynchronous ahb/apb clock domains access to up to 13 peripherals with 4 kbytes memory space each. programmable registers for: ? ahb/apb bridge status ? transaction configuration ? peripherals clock gating 15.3 functional description the asynchronous ahb/apb bridge functi onality can be illustrated by figure 19 on page 161 } 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 161/401 this ahb/apb bridge is capable of addressing 13 peripherals. each peripheral is connected through an apb slave port to the apb bus and data size can be different from one peripheral to the other. the apb memory mapping provides 4 kbytes memory space for each peripheral. the bridge is able to detect some errors while accessing to a peripheral: an out of memory condition on the apb bus, wh en the address does not refer to a valid peripheral. this could arise if the set of all peripheral?s memory spaces does not cover the whole ahb mapping space an access on the apb bus to a peripheral whose clock has been switched-off an access on the apb bus to a peripheral which is currently under reset. if one of the first 3 conditions occurs, the bridge does not start an apb transaction and reports on the ahb bus an error condition (if enabled). the type of error will be saved in the bridge status register and the address which has generated the error condition will be reported in figure 19. ahb/apb bridge block diagram ahb apb resynchronization stage error management configuration and status registers ahb slave apb master per_clock[:] per_resetn[:] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 162/401 the peripheral address error register. this should allow the user to retrieve the event which generated the error. 15.3.1 peripherals clock gating the ahb/apb bridge enables to configure the peripherals? clocks to be switched-on/off. the 32-bits peripheral clock gating registers (pcgn) enables to switch-off/on any of the 13 peripherals directly. this enables to centralize the management of all the clock on this apb bus. when a peripheral?s clock is switched-off, any access to this peripheral will return an error on the ahb bus. the bus status register will contain the error status, the peripheral address error register will provide the address who generated the error. in order to help debugging real-time application, register emu_pcgn has been introduced. the status of this register is used to force the gating of the corresponding clock line when the system enter into debug mode, based upon the following definition: 0 -> peripheral clock switched off in debug mode. 1 -> peripheral clock status depends on pcgn bit also in debug mode. 15.3.2 peripherals reset control the ahb/apb bridge has a unique reset pin that enables resetting the ahb/apb bridge as well as all peripherals. as the reset removal is aligned with ahb clock, the ahb/apb bridge provides a re-synchronization mechanism to generate the peripherals reset. the reset is asserted asynchronously and then rele ased synchronously with the apb clock. moreover, the ahb/apb bridge enables to configure the peripherals? reset in order to reset independently any of the peripherals. the 32-bits peripheral reset control registers (prcn) enables to reset any of the 13 peripherals directly. this allows to centralize the management of all the reset on this apb bus. when a peripheral is under reset, any access to this peripheral will return an error on the ahb bus. the bus status register will contain the error status, the peripheral address error register will provide the address which generated the error. 15.4 register description the ahb/apb bridge provides a set of registers to configure peripherals clock gating, access control and monitor the ahb/apb bridge status. these registers are mapped as peripheral #0 in the ahb/apb bridge mapping. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 163/401 bridge status register (bsr) address offset: 00h reset value: 0x0000_0000 this register stores the status of the ah b/apb allowing the application software to determine the reason of the last failed peripheral access which resulted in an error response to the corresponding ahb transaction. bits 31:9 = reserved. these bits should be always written to and read back as ?0?. bit 8 = pur : peripheral under reset . an access to a peripheral under reset has been attempted. bit 7 = pco : peripheral clock off . an access to a not-clocked peripheral has been attempted. bit 6:5 = reserved. these bits should be always written to and read back as ?0?. bit 4 = outm : out of memory. an access out of memory has been attempted. bits 3:1 = reserved. these bits must be always written to and read back as ?0?. bit 0 = error : error. a previous access has been aborted because it generates an error. the type of error is reported on bit 4 to 8. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved rrrrrrr rrrrrrrr r 1514131211109 87654321 0 reserved pur pco reserved outm reserved error rrrrrrrrcrc - rc - rc 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 164/401 peripherals address error register (paer) address offset: 08h reset value: 0x0000_0000 bit 31:25 = reserved. these bits must be always written to and read back as ?0?. bit 24= nrw : access type. it returns the type of access that generate the error conditions: read(0) or write(1) bit 23:0 = peripheral address . the bridge is able to detect some errors while accessing to a peripherals. if an error occurs, the bridge ends the apb transaction and repo rts on the ahb bus an error condition (if enabled). the address of slave generating the error condition is reported in the peripheral address field. depending of the size of the ahb addressing space, the msb can be filled with 0. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved nrw peripheral address (23:16) - rrrrrrrr r 1514131211109 87654321 0 peripheral address (15:0) rrrrrrr rrrrrrrr r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 165/401 peripheral clock gating register 0 (pcg0) address offset: 60h reset value: 0000 1003h bits 31:13 = reserved, always read as 0. bits 12:0 = pxxco: peripheral xx clock off with 0 xx<12 when set, the pxxco bit specifies the peripheral xx is clocked. 0 : peripheral xx is gated off. 1 : peripheral xx is clocked. note bits 0, 1 and 12 correspond to the ahb/apb bridge, the a-apb global control register and the watchdog (wdg) respectively and are forced to 1 by hardware. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved 1 p(xx)co 1 1 - r rw rw rw rw rw rw rw rw rw rw r r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 166/401 peripheral under reset register 0 (pur0) address offset: 80h reset value: 0000 1003h bits 31:13 = reserved, always read as 0. bit 12:0 = pxxur: peripheral xx under reset with 0 xx<12 when set, the pxxur bit specifies the peripheral xx is not under reset. 0 : peripheral xx reset line is active. 1 : peripheral xx reset line is not active. note bits 0, 1 and 12 correspond to the ahb/apb bridge, the a-apb global control register and the watchdog (wdg) respectively and are forced to 1 by hardware. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved 1 p(xx)co 1 1 - r rw rw rw rw rw rw rw rw rw rw r r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 167/401 emulator peripheral clock gating register 0 (emu_pcg0) address offset: a0h reset value: ffff ffffh this register configures the status of clock gating for each of the peripherals controlled by the bridge, while the application program execution is stopped due to a debug request. each peripheral can be configured to stop work ing as the user code reaches a breakpoint. bits 31:13 = reserved, always read as 0. bits 12:0 = epxxco: emulator peripheral xx clock off with 0 xx<12 0: peripheral xx clock is gated off at a debug request, regardless of the state of the corresponding pxxco bit in pcg0 register. 1: peripheral xx clock gating status is unaffected by debug requests, and it is always determined by its corresponding pxxco bit in pcg0 register. table 41 shows how the status of peripheral clock depends on pcg, emu_pcg and arm720 debug-mode: note bit epcg0[0] corresponds to the ahb/apb bridge itself and is forced to 1 by hardware. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved epxxco 1 - rwrwrwrw rwrwrwrwrwrwrwrw r table 41. clock gating pcg0 emu_pcg0 arm720 debug periph. clock 110on 111on 010off 011off 000off 001off 100on 101off 1 .com .com .com .com .com 4 .com u datasheet
STR720 - asynchronous ahb-apb bridge (a3brg) 168/401 15.4.1 register map refer to table 20 on page 49 for the base address. table 42. ahb/apb bridge register map addr. offset register name 3 1 3 0 2 9 2 8 2 7 2 6 2 5 24 23 22 21 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 0 987654321 0 00 bsr reserved pur pco reserved outm reserved error 04 reserved 08 paer reserved nrw peripheral address (23:0) 0c - 5c reserved 60 pcg0 reserved 1 pxxco 1 1 64 - 7c reserved 80 pur0 1pxxur 11 84 - 9c reserved a0 emu_pc g0 reserved epxxco 1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 169/401 16 uart 16.1 introduction the uart interface, also referred to as the as ynchronous serial controller (asc), provides serial communication between STR720 and other microcontrollers, microprocessors or external peripherals. the asc supports full-duplex asynchronous comm unication. eight or nine bit data transfer, parity generation, and the number of stop bits are programmable. parity, framing, and overrun error detection are provided to increase the reliability of data transfers. transmission and reception of data can simply be double-buffered, or 16-deep fifos may be used. for multiprocessor communications, a mechanism to distinguish the address from the data bytes is included. testing is supported by a loop-back option. a 16-bit baud rate generator provides the asc with a separate serial clock signal. 16.2 main features full-duplex asynchronous communication two internal fifos (16 words deep) for transmit and receive data 16-bit baud rate generator data frames both 8 and 9 bit long parity bit (even or odd) and stop bit multiprocessor communication support 16.3 functional description the asc supports full-duplex asynchronous communication, where both the transmitter and the receiver use the same data frame format and the same baud rate. data is transmitted on the txd pin and received on the rxd pin. 16.3.1 data frames eight-bit data frames (see figure 20 ) either consist of:  eight data bits d0-7 (by setting the mode bit field to 001);  seven data bits d0-6 plus an automatically generated parity bit (by setting the mode bit field to 011). parity may be odd or even, depending on the parityodd bit in the asccontrol register. an even parity bit will be set, if the modulo-2-sum of the seven data bits is 1. an odd parity bit will be cleared in this case.} 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 170/401 nine bit data frames (see figure 21 ) either consist of:  nine data bits d0-8 (by setting the mode bit field to 100);  eight data bits d0-7 plus an automatically generated parity bit (by setting the mode bit field to 111);  eight data bits d0-7 plus a wake-up bit (by setting the mode bit field to 101). parity may be odd or even, depending on the parityodd bit in the asccontrol register. an even parity bit will be set, if the modulo-2-sum of the eight data bits is 1. an odd parity bit will be cleared in this case. in wake-up mode, received frames are only transferred to the receive buffer register if the ninth bit (the wake-up bit) is 1. if this bit is 0, no receive interrupt request will be activated and no data will be transferred. this feature may be used to control communication in multi-processor systems. when the master processor wants to transmit a block of data to one of several slaves, it first sends out an address byte which identifies the target slave. an address byte differs from a data byte in that the additional ninth bit is a 1 for an address byte and a 0 for a data byte, so no slave will be interrupted by a data byte. an address byte will interrupt all slaves (operating in 8-bit data + wake-up bit mode), so each slave can examine the 8 least significant bits (lsbs) of the received character (the address). the addressed slave will switch to 9-bit data mode, which enables it to receive the data bytes that will be coming (with the wake-up bit cleared). the slaves that are not being addressed remain in 8-bit data + wake-up bit mode, ignoring the following data bytes. figure 20. 8-bit data frames figure 21. 9-bit data frames d0 lsb d1 d2 d3 d4 d5 d6 start bit 8th bit 1st stop bit 2nd stop bit - data bit (d7) - parity bit d0 lsb d1 d2 d3 d4 d5 d6 start bit 9th bit 1st stop bit 2nd stop bit - data bit (d8) - parity bit d7 - wake-up bit 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 171/401 16.3.2 transmission values to be transmitted are written to the transmit fifo, txfifo, by writing to asctxbuffe r. the txfifo is implemented as a 16 deep array of 9 bit vectors. if the fifos are enabled (the asccontrol(fifoenable) is set), the txfifo is considered full (ascstatus(txfull) is set) when it contains 16 characters. further writes to asctxbuffer in this situation will fail to overwrite the most recent entry in the txfifo. if the fifos are disabled, the txfifo is considered full (ascstatus(txfull) is set) when it contains 1 character, and a write to asctxbuffer in this situation will overwrite the contents. if the fifos are enabled, ascstatus(txhalfempty) is set when the txfifo contains 8 or fewer characters. if the fifos are disabled, it?s set when the txfifo is empty. writing anything to asctxreset empties the txfifo. values are shifted out of the bottom of the txfi fo into a 9-bit txshift register in order to be transmitted. if the transmitter is idle (the txshi ft register is empty) and something is written to the asctx-buffer so that the txfifo becomes non-empty, the txshift register is immediately loaded from the txfifo and transmission of th e data in the txshift register begins at the next baud rate tick. at the time the transmitter is just about to transmit the stop bits, then if the txfifo is non-empty, the txshift register will be i mmediately loaded from the txfifo, and transmission of this new data will begin as soon as the current stop bit period is over (i.e. the next start bit will be transmitted immediately following the current stop bit peri od). thus back-to-back transmission of data can take place. if instead the txfifo is empty at this point, then the txshift register will become empty. asc-status(txempty) indicates whether the txshift register is empty. after changing the fifoenable bit, it is important to reset the fifo to empty (by writing to the asctxreset register), since the state of the fifo pointer may be garbage. the loop-back option (selected by the asccontrol(loopback) bit) internally connects the output of the transmitter shift register to the input of the receiver shift register. this may be used to test serial communication routines at an early stage without having to provide an external network. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 172/401 16.3.3 reception reception is initiated by a falling edge on the data input pin (rxd) , provided that the asccontrol(run) and asccontrol(rxenable) bits are set. the rxd pin is sampled at 16 times the rate of the selected baud rate. a majority decision of the first, second and third samples of the start bit determines the effective bit value. this avoids erroneous results that may be caused by noise. if the detected value is not a 0 when the start bit is sampled, the receive circuit is reset and waits for the next falling edge transition at the rxd pin. if the start bit is valid, the receive circuit continues sampling and shifts the incoming data frame into the receive shift register. for subsequent data and parity bits, the majority decision of the seventh, eighth and ninth samples in each bit time is used to determine the effective bit value. note if reception is initiated when data input pin (rxd) is being stretched at ?0? a frame error indication is reported, since reception stage samples the initial value as a falling edge. for 0.5 stop bits, the majority decision of the third, fourth, and fifth samples during the stop bit is used to determine the effective stop bit value. for 1 and 2 stop bits, the majority decision of the seventh, eighth, and ninth samples during the stop bits is used to determine the effective stop bit values. for 1.5 stop bits, the majority decision of the fifteenth, sixteenth, and seventeenth samples during the stop bits is used to determine the effective stop bit value. the effective values received on the rxd pin are shifted into a 10-bit rxshift register. the receive fifo, rxfifo, is implemented as a 16 deep array of 10-bit vectors (each 9 down to 0). if the rxfifo is empty, ascstatus(rxbufnotempty) is set to ?0?. if the rxfifo is not empty, a read from ascrx-buffer will get the oldest entry in the rxfifo. if fifos are disabled, the rxfifo is considered full when it contains one character. ascstatus(rxhalffull) is set when the rxfifo contains more than 8 characters. writing anything to ascrxreset empties the rxfifo. as soon as the effective value of the last stop bit has been determined, the content of the rxshift register is transferred to the rxfifo (u nless we?re in wake-up mode, in which case this happens only if the wake-up bit, bit8, is a ?1?). the receive circuit then waits for the next start bit (falling edge transition) at the rxd pin. ascstatus(overrunerror) is set when the rxfifo is full and a character is loaded from the rxshift register into the rxfifo. it is cleared when the ascrxbuffer register is read. the most significant bit of each rxfifo entry (rxfifo[x][9]) records whether or not there was a frame error when that entry was received (i.e. one of the effective stop bit values was ?0?). ascstatus(frameerror) is set when at least one of the valid entries in the rxfifo has its msb set. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 173/401 if the mode is one where a parity bit is expected, then the bit rxfifo[x][8] (if 8 bit data + parity mode is selected) or the bit rxfifo[x][7] (if 7 bit data + parity mode is selected) records whether there was a parity error when that entry was received. note, it does not contain the parity bit that was received. ascstatus(parityerror) is set when at least one of the valid entries in the rxfifo has bit 8 set (if 8 bit data + parity mode is selected) or bit 7 set (if 7 bit data + parity mode is selected). after changing the fifoenable bit, it is important to reset the fifo to empty (by writing to the ascrxreset register), since the state of the fifo pointers may be garbage. reception is stopped by clearing the asccontrol(rxenable) bit. a currently received frame is completed including the generation of the receive status flags. start bits that follow this frame will not be recognized. 16.3.4 timeout mechanism the asc contains an 8-bit timeout counter. this reloads from asctimeout whenever one or more of the following is true  ascrxbuffer is read  the ascstarts to receive a character  asctimeout is written to if none of these conditions hold, the counter decrements towards 0 at every baud rate tick. ascstatus(timeoutnotempty) is ?1? exactly whenever the rxfifo is not empty and the timeout counter is zero. ascstatus(timeoutidle) is ?1? exactly whenever the rxfifo is empty and the timeout counter is zero. the effect of this is that whenever the rxfifo has got something in it, the timeout counter will decrement until something happens to the rxfifo. if nothing happens, and the timeout counter reaches zero, the ascstatus(timeoutnotempty) flag will be set. when the software has emptied the rxfifo, the timeout counter will reset and start decrementing. if no more characters arrive, when the counter reaches zero the ascstatus(timeoutidle) flag will be set. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 174/401 16.3.5 baud rate generation the baud rate generator provides a clock at 16 times the baud rate, called the oversampling clock. this clock only ticks if asccontrol(run) is set to?1?. setting this bit to 0 will immediately freeze the state of the ascs transmitter and receiver. this should only be done when the asc is idle. the baud rate and the required reload value for a given baud rate can be determined by the following formulae: baudrate = f apb / (16 * ) = f apb / (16 * baudrate) where: represents the content of the ascbaudrate register, taken as unsigned 16-bit integer, and f apb is the clock frequency of the apb sub-system to which uart block is connected. the following tables list various commonly used baud rates together with the required reload values and the deviation errors for various different apb clock frequencies.. table 43. baud rates with f apb = 16 mhz baud rate reload value (exact) reload value (integer) reload value (hex) deviation error 625k 1.6 2 0002 20% 38.4k 26.042 26 001a 0.160% 19.2k 52.083 52 0034 0.160% 9600 104.167 104 0068 0.160% 4800 208.333 208 00d0 0.160% 2400 416.667 417 01a1 0.080% 1200 833.333 833 0341 0.040% 600 1666.667 1667 0683 0.020% 300 3333.333 3333 0d05 0.010% 75 13333.333 13333 3415 0.003% table 44. baud rates with f apb = 20 mhz baud rate reload value (exact) reload value (integer) reload value (hex) deviation error 625k2 200020% 38.4k 32.552 33 0021 1.358% 19.2k 65.104 65 0041 0.160% 9600 130.208 130 0082 0.160% 4800 260.417 260 0104 0.160% 2400 520.833 521 0209 0.032% 1200 1041.667 1042 0412 0.032% 600 2083.333 2083 0823 0.016% 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 175/401 16.3.6 interrupt control the asc has a single interrupt coming out of it, called asc_interrupt . the status bits in the asc-status register determine the cause of the interrupt. asc_interrupt will go high when a status bit is 1 (high) and the corresponding bit in the ascintenable register is 1 (see figure 22 ). note: the ascstatus register is read only. the status bits can only be cleared by operating on the fifos. the rxfifo and txfifo can be reset by writing to the ascrxreset and asctxreset registers. 300 4166.667 4167 1047 0.008% 75 16666.667 16667 411b 0.002% figure 22. uart interrupt request table 44. baud rates with f apb = 20 mhz baud rate reload value (exact) reload value (integer) reload value (hex) deviation error timeoutidle timeoutidle ie timeoutnotempty timeoutnotempty ie overrunerror overrunerror ie frameerror frameerror ie parityerror parityerror ie txhalfempty txhalfempty ie txempty txempty ie rxbufnotempty rxbufnotempty ie asc_interrupt rxhalffull rxhalffull ie 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 176/401 16.3.7 using the asc interrupts when fifos are disabled when fifos are disabled, the asc provides three interrupt requests to control data exchange via the serial channel:  txhalfempty is activated when data is moved from asctxbuffer to the txshift register.  txempty is activated before the stop bit is transmitted.  rxbufnotempty is activated when the received frame is moved to ascrxbuffe r. for single transfers it is sufficient to use the transmitter interrupt (txempty) , which indicates that the previously loaded data has been transmitted, except for the stop bit. for multiple back-to-back transfers using txempty would leave just one stop bit time for the handler to respond to the interrupt and initiate another transmission. using the transmit buffer interrupt (txhalfempty) to reload transmit data allows the time to transmit a complete frame for the service routine, as asctxbuffer may be reloaded while the previous data is still being transmitted. txhalfempty is an early trigger for the reload routine, while txempty indicates the completed transmission of the data field of the frame. therefore, software using handshake should rely on txempty at the end of a data block to make sure that all data has really been transmitted. 16.3.8 using the asc interrupts when fifos are enabled to transmit a large number of characters back to back, the driver routine would write 16 characters to asctxbuffer , then every time a txhalfempty interrupt fired, it would write 8 more. when it had nothing more to send, a txempty interrupt would tell it when everything has been transmitted. when receiving, the driver could use rxbufnotempty to interrupt every time a character came in. alternatively, if data is coming in back-to-back, it could use rxhalffull to interrupt it when there was at least 8 characters in the rxfifo to read. it would have as long as it takes to receive 8 characters to respond to this interrupt before data would overrun. if less than eight character streamed in, and no more were received for at least a timeout period, the driver could be woken up by one of the two timeout interrupts, timeoutnotempty or timeoutidle . 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 177/401 16.4 register description ascbaudrate address offset: 00h reset value: 0001h the ascbaudrate register is the dual-function baud rate generator/reload register. a read from this register returns the content of the timer, writing to it updates the reload register. an auto-reload of the timer with the content of the reload register is performed each time the ascbaudrate register is written to. however, if the run bit of the asccontrol register is 0 at the time the write operation to the ascbaudrate register is performed, the timer will not be reloaded until the first cpu clock cycle after the run bit is 1. bit 15:0 = ascbaudrate write function: 16-bit reload value read function: 16-bit count value 1514131211109 87654321 0 ascbaudrate rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 178/401 asctxbuffer address offset: 04h reset value: 0000h writing to the transmit buffer register starts data transmission. bit 15:9 = reserved. write 0 bit 8 = tx[8] : transmit buffer data d8. transmit buffer data d8, or parity bit, or wake -up bit or undefined - dependent on the operating mode (the setting of the mode field in asccontrol register). note if the mode field selects an 8 bit frame then this bit should be written as 0. note if the mode field selects a frame with parity bit, then the tx[8] bit will contain the parity bit (automatically generated by the uart). a user writing at ?0? or ?1? of such a bit will have no effect on the transmitted frame. bit 7 = tx[7] : transmit buffer data d7 . transmit buffer data d7 or parity bit - dependent on the operating mode (the setting of the mode field in asccontrol register). note if the mode field selects a frame with parity bit, then the tx[7] bit will contain the parity bit (automatically generated by the uart). a user writing at ?0? or ?1? of such a bit will have no effect on the transmitted frame. bit 6:0 = tx[6:0] : transmit buffer data d(6:0) 1514131211109 87654321 0 reserved tx[8] tx[7] tx[6] tx[5] tx[4] tx[3] tx[2] tx[1] tx[0] wwwwwww wwwwwwww w 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 179/401 ascrxbuffer address offset: 08h reset value: 0000h the received data and, if provided by the selected operating mode, the received parity bit can be read from the receive buffer register. bit 15:10 = reserved . will read back 0 bit 9 = rx[9] : frame error . if set, it indicates a frame error occurred on da ta stored in rx[8:0] (i.e. one of the effective stop bit values was ?0? when the data was received). bit 8 = rx[8] : receive buffer data d8. receive buffer data d8, or parity error, or wake-up bit - dependent on the operating mode (the setting of the mode field in the asccontrol register). note if the mode field selects a 7- or 8-bit frame th en this bit is undefined. software should ignore this bit when reading 7- or 8-bit frames. bit 7 = rx[7] : receive buffer data d7. receive buffer data d7, or parity error - dependent on the operating mode (the setting of the mode field in the asccontrol register). bit 6:0 = rx[6:0] : receive buffer data d(6:0). 1514131211109 87654321 0 reserved rx[9] rx[8] rx[7] rx[6] rx[5] rx[4] rx[3] rx[2] rx[1] rx[0] rrrrrrr rrrrrrrr r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 180/401 asccontrol address offset: 0ch reset value: 0000h this register controls the operating mode of the asc and contains control bits for mode and error check selection, and status flags for error identification. note programming the mode control field (mode) to one of the reserved combinations may result in unpredictable behavior. note serial data transmission or reception is only possible when the baud rate generator run bit (run) is set to 1. when the run bit is set to 0, txd will be 1. setting the run bit to 0 will immediately freeze the state of the transmitter and receiver. this should only be done when the asc is idle. bit 15:11= reserved . write 0 will read back 0 bit 10 = fifoenable : fifo enable 0: fifo mode disabled 1: fifo mode enabled bit 9 = reserved . write 0 will read back 0 bit 8 = rxenable: receiver enable 0: receiver disabled 1: receiver enabled bit 7 = run: baudrate generator run bit 0: baud rate generator disabled (asc inactive) 1: baud rate generator enabled bit 6 = loopback: loopback mode enable 0: standard transmit/receive mode 1: loopback mode enabled note this bit may be modified only when the asc is inactive. bit 5 = parityodd: parity selection 0: even parity (parity bit set on odd number of ?1?s in data) 1: odd parity (parity bit set on even number of ?1?s in data) 1514131211109 87654321 0 reserved fifoena ble reser ved rxenabl e run loopba ck parityo dd stop bits mode rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 181/401 bit 4:3 = stop bits: number of stop bits selection these bits select the number of stop bits 00: 0.5 stop bits 01: 1 stop bit 10: 1.5 stop bits 11: 2 stop bits bit 2:0 = mode: asc mode control 000: reserved 001: 8 bit data 010: reserved 011: 7 bit data + parity 100: 9 bit data 101: 8 bit data + wake up bit 110: reserved 111: 8 bit data + parity 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 182/401 ascintenable address offset: 10h reset value 0000h the ascintenable register enables a source of interrupt. interrupts will occur when a status bit in the ascstatus register is 1, and the corresponding bit in the ascintenable register is 1. bit 15:9 = reserved . write 0, will read back 0. bit 8 = ascintenable[8]= rxhalffullie : receiver buffer half full interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 7 = ascintenable[7]=timeoutidleie : timeout idle interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 6 = ascintenable[6]=timeoutnotempty ie : timeout not empty interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 5 = ascintenable[5]=overrunerrorie : overrun error interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 4 = ascintenable[4]=frameerrorie : framing error interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 3 = ascintenable[3]=parityerrorie: parity error interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 2 = ascintenable[2]=txhalfemptyie: transmitter buffer half empty interrupt enable 0: interrupt disabled. 1: interrupt enabled. bit 1 = ascintenable[1]=txemptyie: transmitter empty interrupt enable 0: interrupt disabled. 1: interrupt enabled. 1514131211109 87654321 0 reserved ascintenable rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 183/401 bit 0 = ascintenable[0]=rxbufnotemptyie: receiver buffer not empty interrupt enable 0: interrupt disabled. 1: interrupt enabled. ascstatus address offset: 14h reset value: 0006h the ascstatus register determines the cause of an interrupt. bit 15:10 = reserved . read back 0. bit 9 = ascstatus[9]: txfull. set when the txfifo contains 16 characters . bit 8 = ascstatus[8]: rxhalffull . set when the rxfifo contains at least 8 characters. bit 7 = ascstatus[7]: timeoutidle. set when there?s a timeout and the rxfifo is empty bit 6 = ascstatus[6]: timeoutnotempty . set when there?s a timeout and the rxfifo is not empty bit 5 = ascstatus[5]: overrunerror . set when data is received and the rxfifo is full. bit 4 = ascstatus[4]: frameerror . set when the rxfifo contains something received with a frame error bit 3 = ascstatus[3]: parityerror. set when the rxfifo contains something received with a parity error bit 2 = ascstatus[2]: txhalfempty. set when txfifo at least half empty bit 1 = ascstatus[1]: txempty . set when transmit shift register is empty bit 0 = ascstatus[0]: rxbufnotempty. set when rxfifo not empty (rxfifo contains at least one entry) 1514131211109 87654321 0 reserved ascstatus rrrrrrr rrrrrrrr r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 184/401 asctimeout address offset: 1ch reset value: 0000h this register is to have a timeout system to be sure that not too much time pass between two successive received characters. bit 15:8 = reserved . write 0, will read back 0. bit 7:0 = asctimeout: timeout. timeout period in baud rate ticks. asctxreset address offset: 20h a write to this register empties the txfifo. ascrxreset address offset: 24h a write to this register empties the rxfifo. 1514131211109 87654321 0 reserved asctimeout rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1514131211109 87654321 0 reserved wwwwwww wwwwwwww w 1514131211109 87654321 0 reserved wwwwwww wwwwwwww w 1 .com .com .com .com .com 4 .com u datasheet
STR720 - uart 185/401 16.4.1 register map the following table summarizes the registers implemented in the uart macrocell. refer to table 20 on page 49 for the base address. table 45. uart peripheral register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 asc baud rate ascbaudrate 4 asc txbuffer reserved asctxbuffer 8 asc rxbuffer reserved ascrxbuffer c asc control reserved fifoen- able re- serve d rxen- able run loop- back parity- odd stop bits mode 10 asc intenable reserved ascintenable 14 asc status reserved ascstatus 1c asc timeout reserved asctimeout 20 asc txreset asctxreset 24 asc rxreset ascrxreset 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 186/401 17 buffered spi (bspi) 17.1 introduction the bspi block is a standard 4-pin seri al peripheral interface for serial control communication. it interfaces on one side to the spi bus and on the other has a standard register data and interrupt interface. the bspi contains two 16-word x 16-bit fifo?s one for receive and the other for transmit. the bspi can directly operate with words 8 and 16 bit long and can generates interrupts or dma requests separately for receive and transmit events. 17.2 main features programmable depth receive fifo. maximum 16 word receive fifo. programmable depth transmit fifo. maximum 16 word transmit fifo. master and slave modes supported. internal clock prescaler. programmable dma interface 17.3 functional description the processor views the bspi as a memory mapped peripheral, which may be used by standard polling, interrupt programming techniques or dma controlled access. memory-mapping means processor communication can be achieved using standard instructions and addressing modes. when an spi transfer occurs data is transmitted and received simultaneously. a serial clock line synchronizes shifting and sampling of the information on the two serial data lines. a slave select line allows individual selection of a slave device. the central elements in the bspi system are the 16-bit shift register and the read data buffer which is 16 words x 16-bit.a bspi-dma interface is also present to allow fo r data to be transferred to/from memory using the dma.a block diagram of the bspi is shown in figure 23 on page 187 . 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 187/401 figure 23. bspi block diagram 17.3.1 bspi pin description the bspi is a four wire, bi-directional bus. the data path is determined by the mode of operation selected. a master and a slave mode are provided together with the associated pad control signals to control pad direction. these pins are described in table 46 on page 187 . table 46. bspi pins pin name description sck the bit clock for all data transfers. when the bspi is a master the sck is output from the chip. when configured as a slave the sck is input from the external source. miso master input/slave output serial data line. mosi master output/slave input serial data line. ss slave select. the ss input pin is used to select a slave device. must be pulled low after the sck is stable and held low for the duration of the data transfer. the ss on the master must be deasserted high.this signal can be masked when in master mode-see regi ster description of csr reg3 bit 0 16 word receive (16 bits) mosi sck miso ss shift register fifo s m m s pin control logic s m bspi control logic bspclk bspcsr1 clk data bus 16 16 16 16 16 16 bspcsr2 16 16 word transmit (16 bits) fifo bspcsr3 16 dma interface 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 188/401 17.3.2 bspi operation during a bspi transfer (see figure 24 on page 188 ), data is shifted out and shifted in (transmitted and received) simultaneously. the sck line synchronizes the shifting and sampling of the information. it is an output when the bspi is configured as a master and an input when the bspi is configured as a slave. selection of an individual slave bspi device is performed on the slave select line and slave devices that are not selected do not interfere with the bspi buses. figure 24. bspi bus transfer the cpol (clock polarity) and cpha (clock phase) bits of the bspcsr1 are used to select any of the four combinations of serial clock (see figure 25 on page 189 , figure 26 on page 189 , figure 27 on page 190 and figure 28 on page 190 ). these bits must be the same for both the master and slave bspi devices. the clock polarity bit selects either an active high or active low clock but does not affect transfer format. the clock phase bit selects the transfer format. there is a 16-bit shift register which interfac es directly to the bspi bus lines. as transmit data goes out from the register, received data fills the register. note when bspi cell is configured in slave mode, sclk_in clock must be divided by a factor of 8 or more compared with the configured peripheral clock (apb clock). in case a clock polarity change is required when bspi macrocell is configured in master mode, the following sequence should be followed in order to avoid spurious clock edges generation: 1. write ?0? into both mstr and bspe bit in bspcsr1 register, so to safely disable bspi macrocell. 2. change cpol and cpha bits in bspcsr1 regi ster according to the required polarity set- ting. 3. write ?1? into bspe bit of bspcsr1 re gister to enable again bspi macrocell. 4. write ?1? into mstr bit of bspcsr1 register to configure the master mode again. it must be noticed that the above sequence should be executed as reported, without merging in a single instruction any of the steps. mosi/miso sck data1 8 bits 8 bits ss data0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 189/401 figure 25. bspi clocking scheme (cpol=0, cpha=0) figure 26. bspi clocking scheme (cpol=0, cpha=1) cpol=0 , c pha=0 ss internal strobe for data capture on positive edge of sck msb 6 5 4 3 2 1 lsb msb 6 5 4 3 2 1 lsb internal strobe for data capture on positive edge of sck data captured on mosi (in) miso (out) data captured on miso (in) mosi (out) sck (out) sck (in) master signals slave signals cpol=0 , c pha=1 ss internal strobe for data capture on negative edge of sck msb 6 5 4 3 2 1 lsb msb 6 5 4 3 2 1 lsb internal strobe for data capture on negative edge of sck miso (out) mosi (out) sck (out) sck (in) data captured on miso (in) data captured on mosi (in) master signals slave signals 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 190/401 figure 27. bspi clocking scheme (cpol=1, cpha=0) figure 28. bspi clocking scheme (cpol=1, cpha=1) ss internal strobe for data capture on negative edge of sck msb 6 5 4 3 2 1 lsb msb 6 5 4 3 2 1 lsb internal strobe for data capture on negative edge of sck data captured on mosi (in) miso (out) data captured on miso (in) mosi (out) sck (out) sck (in) master signals slave signals cpol=1 , c pha=0 ss internal strobe for data capture on positive edge of sck msb 6 5 4 3 2 1 lsb msb 6 5 4 3 2 1 lsb internal strobe for data capture on positive edge of sck data captured on mosi (in) miso (out) data captured on miso (in) mosi (out) sck (out) sck (in) master signals slave signals cpol=1 , c pha=1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 191/401 17.3.3 transmit fifo the transmit fifo consists of a 16 by 16 bit register bank which can operate in 8/16 bit modes as configured by the word length (wl[1:0]) cont rol bits of bspcsr1. data is left justified indicating that only the most significant porti on of the word is transmitted if using 8 bit mode. after a transmission is completed the next data word is loaded from the transmit fifo. the user can set the depth of the fifo from the default one location up to a maximum of sixteen locations. this can be set dynamically but will only take effect after the completion of the current transmission. status flags report if the fifo is full (tff), the fifo is not empty (tfne), the fifo is empty (tfe) and the transmit buffer has under flown (tufl), this last one being generated only when macrocell is configured in master mode. the transmit interrupt enable (tie[1:0]) control bits of bspcsr2 de termine the source of the transmit interrupt. if the interrupt source is enabled then an active high interrupt will be asserted to the processor. if bspi is configured in master mode and the tufl flag is asserted then a subsequent write to the transmit fifo will clear the flag. if interrupts are enabled the interrupt will be de-asserted. regardless of the selected bspi mode, tff and tfne flags are updated at the end of the processor write cycle and at the end of each transmission. note data should be written in the fifo only if the macro is enabled (see bspi system enable bit of bspi control register). if one data word is written in the trasmit fifo before enabling the bspi no data will be transmitted. note when it is necessary to be notified about the end of last word transmission, tufl event can be used for the purpose, provided bspi is configured in master mode. in case this notification is r equired also when bspi is configured as a slave, the end of transmission cannot be detected and a suitable wait loop must be implemented. 17.3.4 receive fifo the bspi receive fifo is a 16 word by 16-b it fifo used to buffer the data words received from the bspi bus. the fifo can operate in 8-bit and 16-bit modes as configured by the wl[1:0] bits of the bspcsr1 register. irrelevant of the word depth in the fifo, if operating in 8-bit mode, the data will occupy both the most significant and the least significant bytes of each location of the fifo (data can be used either as left or right justified). the receive fifo enable bits rfe[3:0] decl are how many words deep the fifo is for all transfers. the fifo defaults to one word deep. whenever there is at least one block of data in the fifo the rfne bit is set in the bspcsr2 register, i.e there is data in at least one location. the rff flag does not get set until all locations of the fifo contain data, i.e. rff is set when the depth of fifo is filled and nothing has been read out. if the fifo is one word deep then the rfne and rff flags are set once data is written to it. when the data is read then both flags are cleared. a write to and a read from the fifo can happen independent of each once rff is not set, if rff is set a read must occur before the next write or an overflow (rofl) will occur. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 192/401 17.3.5 start-up status if the bspi is to operate in master mode, it must first be enabled, then the mstr bit must be set high. the tfe flag will be set, signalling that the transmit fifo is empty, if the tie is set, a tfe interrupt will be generated. the data to be transferred must be written to the transmit data register, the tfe interrupt will be cl eared and then the bspi clock will be generated according to the value of the bspclk register . the transfer of data then begins. a second tfe interrupt occurs so that the peripheral has a full data transfer time to request the data before the next transfer is to begin. if the bspi is to operate in slave mode, once again the device must be enabled. the ss line must only be asserted low after the sck from the master is stable. the tfe flag will be set, depending on the bspi being enabled , signalling that the transm it data register is empty and will be cleared by a write to the transmit data register. the second tfe interrupt occurs to request data for the following transfer. 17.3.6 clocking problems and c learing of the shift-register should a problem arise on the clock which results in a misalignment of data in the shift register of the bspi, it may be cleared by disabling the bspi enable. this has the effect of setting the tfe which requests data to be written to the transmit register for the next transfer. clearing the bspi enable will also reset the counter of bits received. the next block of data received will be written to the next location in the fifo continuing on from the last good transfer. if the fifo was just one word deep it will be written to the only location available. 17.3.7 interrupt control the bspi generates one interrupt based upon the status bits monitoring the transmit and receive logic. the interrupt is acknowledged or cleared by subsequent read or write operations which remove the error or status u pdate condition. it is the responsibility of the programmer to ascertain the source of the interrupt and then remove the error condition or alter the state of the bspi. in the case of multiple errors the interrupt will remain active until all interrupt sources have been cleared. for example, in the case of tfe, whenever the last word has been transferred to the transmit buffer, the tfe flag is asserted. if interrupts ar e enabled then an interrupt will be asserted to the processor. to clear the interrupt the user must write at least one data word into the fifo, or disable the interrupts if this condition is valid. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 193/401 17.3.8 dma interface the dma interface is a feature of the bspi that allows data to be transferred to or from system memory using a dma controller instead of main cpu. data can be transferred in single data accesses or in burst mode, the amount of words being selectable by the programmer, thus making efficient more use of system bus. th e bspi dma interface has the following features: 1) the dma interface can be totally disa bled using a bit in bspcsr3 register. 2) user programmable burst size: 1, 4, 8 or 16 words can be transferred at a time. 3) two request lines to the dma are generated: one dedicated to the bspi operating in transmit mode and another dedicated to the bspi operating in receiv e mode. these signals are generated in independently from each other inside the bspi. 4) received 8-bit data, being se nt from the bspi to the memory, is arranged in a format which is compatible both with little and big endian co nvention, replicating the received data on both high and low byte in bsprxr register. the dma interface makes use of pointers inside both the transmit and receive fifo (these being independent of one another) in order for it to decide when a dma request to transmit or receive data can be made. the choice of burst size should match the one configured in the corresponding dma channel. note there is a restriction on the burst capability of dma interface during reception. the total number of words to be transferred to system memory via dma must be an integer multiple of the programmed burst length size, since dma interface is not capable of handling incomplete received burst transfers. for example if burst length size is set to 4 and at the end of received data transfer bspi fifo has only 3 spaces, no request would be issued. on the contrary, with an even divide, the last chunk of received data will always be equal to the programmed size of the burst length. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 194/401 17.4 register description bspi control/status register 1 (bspcsr1) address offset: 08h reset value: 0000h bits 15:12 = rfe[3:0]: receive fifo enable. the receive fifo can be programmed to operate with a word depth up to 16. the receive fifo enable bits declare how many words deep the fifo is for all transfers. the fifo defaults to one word deep, i.e. similar to a single data register. table below shows how the fifo is controlled. bit 11:10 = wl[1:0] : word length. these two bits configure the word length operation of the receive fifo and transmit data registers as shown below: 1514131211109 87654321 0 rfe[3:0] wl[1:0] cpha cpol beie reserved reie rie[1:0] mstr bspe rw rw rw rw rw - rw rw rw rw rfe[3:0] depth of fifo 0000 1st word enabled 0001 1st & 2nd words enabled 0010 1-3 words enabled 0011 1-4 words enabled 0100 1-5 words enabled 0101 1-6 words enabled 0110 1-7 words enabled 0111 1-8 words enabled 1000 1-9 words enabled 1001 1-10 words enabled 1010 1-11 words enabled 1011 1-12 words enabled 1100 1-13 words enabled 1101 1-14 words enabled 1110 1-15 words enabled 1111 1-16 words enabled wl[1:0] word length 00 8-bit 01 16-bit 10 reserved 11 reserved 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 195/401 bit 9 = cpha : clock phase select. used with the cpol bit to define the master-s lave clock relationship. when cpha=0, as soon as the ss goes low the first data sample is captured on the first edge of sck. when cpha=1, the data is captured on the second edge. bit 8 = cpol : clock polarity select. when this bit is cleared and data is not being transferred, a stable low value is present on the sck pin. if the bit is set the sck pin will idle high. this bit is used with the cpha bit to define the master-slave clock relationship. 0 = active high clocks selected; sck idles low. 1 = active low clocks selected; sck idles high. bit 7 = beie : bus error interrupt enable. when this bit is set to ?1?, an interrupt will be asserted to the processor whenever a bus error condition occurs. bit 6 = reserved. to be left at 0 level (reset status). bit 5 = reserved. to be left at 0 level (reset status). bit 4 = reie : receive error interrupt enable . when this bit is set to ?1? and the receiver overflow error condition occurs, a receive error interrupt will be asserted to the processor. bits 3:2 = rie[1:0] : bspi receive interrupt enables. the rie1:0 bits are interrupt enables which co nfigure when the processor will be interrupted on received data. the following configurations are possible. bit 1 = mstr : master/slave select. 1: bspi is configured as a master 0: bspi is configured as a slave bit 0 = bspe : bspi system enable. 1: bspi system is enabled 0: bspi system is disabled note the peripheral should be enabled before selecting the interrupts. in this way the application software can avoid unexpected behaviours of interrupt request signal. rie1 rie0 interrupted on 00 disabled 0 1 receive fifo not empty 10 reserved 1 1 receive fifo full 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 196/401 bspi control/status register 2 (bspcsr2) address offset: 0ch reset value: 0040h bits 15:14 = tie[1:0] : bspi transmit interrupt enable. these bits control the source of the transmit interrupt. bits 13:10 = tfe[3:0] : transmit fifo enable. these bits control the depth of the transmit fi fo. the table below indicates all valid settings. bit 9 = tfne : transmit fifo not empty. this bit is set whenever the fifo contains at least one data word. bit 8 = tff : transmit fifo full. tff is set whenever the number of words written to the transmit fifo is equal to the number 1514131211109 87654321 0 tie[1:0] tfe[3:0] tfn e tff tufl tfe rofl rff rfne berr res. dfifo rw rw r rrrrrrr-w tie1 tie0 interrupted on 00 disabled 0 1 transmit fifo empty 1 0 transmit underflow (only in master mode) 1 1 transmit fifo full tfe[3:0] depth of fifo 0000 1st word enabled 0001 1st & 2nd words enabled 0010 1-3 words enabled 0011 1-4 words enabled 0100 1-5 words enabled 0101 1-6 words enabled 0110 1-7 words enabled 0111 1-8 words enabled 1000 1-9 words enabled 1001 1-10 words enabled 1010 1-11words enabled 1011 1-12words enabled 1100 1-13words enabled 1101 1-14words enabled 1110 1-15words enabled 1111 1-16words enabled 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 197/401 of fifo locations enabled by tfe[3:0]. the flag is set immediately after the data write is complete. bit 7 = tufl : transmit underflow. this status bit gets set only wh en bspi is configured in master mode, when the tfe bit is set and, by the time the transmit data register contents are to be transferred to the shift register for the next transmission, the processor has not yet put the data for transmission into the transmit data register. tufl is set on the first edge of the clock when cpha = 1 and when cpha = 0 on the assertion of ss . if tie[1:0] bits are set to ?10? then, when tufl gets set, an interrupt will be asserted to the processor. note from an application point of view, it is important to be aware that the first word available after an underflow event has occurred should be ignored, as this data was loaded into the shift register before the underflow condition was flagged. bit 6 = tfe : transmit fifo empty. this bit gets set whenever the transmit fifo has transferred its last data word to the transmit buffer. if interrupts are enabled then an interrupt will be asserted whenever the last word has been transferred to the transmit buffer. bit 5 = rofl : receiver overflow. this bit gets set if the receive fifo is full and has not been read by the processor by the time another received word arrives. if the reie bit is set then, when this bit gets set an interrupt will be asserted to the processor. this bit is cl eared when a read takes place of the csr register and the fifo. bit 4 = rff : receive fifo full. this status bit indicates that the number of fifo locations, as defined by the rfe[3:0] bits, are all full, i.e. if the fifo is 4 deep then all data has been received to all four locations. if the rie[1:0] bits are configured as ?11? then, when this status bit gets set, an interrupt will be asserted to the processor. this bit is cleared when at least one data word has been read. bit 3 = rfne : receive fifo not empty. this status bit indicates that there is data in the receive fifo. it is set whenever there is at least one block of data in the fifo i.e. for 8-bit mode 8 bits and for 16 - bit mode 16 bits. if the rie[1:0] bits are configured to ?01? then whenever this bit gets set an interrupt will be asserted to the processor. this bit is cleared when all valid data has been read out of the fifo. bit 2 = berr : bus error. this status bit indicates that a bus error condition has occurred, i.e. that more than one device has acted as a master simultaneously on the bspi bus. a bus error condition is defined as a condition where the slave select line goes active low when the module is configured as a master, provided that mask_ ss bit in bspcsr3 register is not set. this indicates contention in that mo re than one node on the bspi bu s is attempting to function as a master. this bit is cleared when the slave se lect line is deasserted, mask_ss bit is set or slave mode is selected. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 198/401 bit 1 = reserved. to be left at 0 level (reset status). bit 0 = dfifo : disable for the fifo. when this bit is enabled, the fifo pointers are all reset to zero, the rfe bits are set to zero and therefore the bspi is set to one location. the data within the fifo is lost. this bit is reset to zero after a clock cycle. bspi control/status register 3 (bspcsr3) address offset: 14h reset value: 0000h this register is used to control the bspi dma interface. when the bspi is receiving da- ta, it will be the source of dma transfer and system memory will act as destination. conversely, when the bspi is in transmit mode, it is sendin g data to an external source and it will act as dma dest ination while system memory will be the source. bits 15:8 = reserved. these bits must be always written to ?0?. bit 7 = rreq_en : receive request enable this is the enable bit for the reception dma request and it flags the dma controller that an amount of data corresponding at least to the conf igured reception burst length is available in the bspi receive fifo to be transferred. 0 = receive dma requests are disabled. 1 = receive dma requests are enabled. bit 6 = treq_en : transmit request enable this is the enable bit for the transmission dma request and it flags the dma controller that in the bspi transmit fifo there is an amount of free locations corres ponding at least to the configured transmission burst length. 0 = transmit dma requests are disabled. 1 = transmit dma requests are enabled. bits 5:4 = rburst_len[1:0] : receive burst length these bits configure the burst length when the bspi receives data. this programmable length is used to set the number of data words the dma controller is expected to retrieve upon a receive request; this value is used in the dm a interface to determine when the bspi is ready to send a data burst to the dma. a word can be 16 bit or 8 bit wide according to the configuration set in wl bits inside bspcsr1 register. 1514131211109 87654321 0 reserved rreq _en treq _en rburst_len [1:0] tburst_len [1:0] dma _en mask _ss -rwrwrwrwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 199/401 note the value set in rburst_len field should match with the configured burst length set in the corresponding dma channel (soburst field in dma control register). bits 3:2 = tburst_len [1:0] : transmit burst length these bits configure the burs t length when the bspi tran smits data. this programmable length is used to set the number of data words the dma controller is expected to send upon a transmit request; this value is used in the dm a interface to determine when the bspi is ready to receive a data burst from the dma. a word can be 16 bit or 8 bit wide according to the configuration set in wl bits inside bspcsr1 register. note the value set in tburst_len field should match with the configured burst length set in the corresponding dma channel (soburst field in dma control register). bit 1 = dma_en : dma interface enable this bit is a general enable switch for the dma interface. when bspi dma interface is disabled no request line will be activated and data transfer can occur through interrupt notification only. 0 = dma interface is disabled. 1 = dma interface is enabled. bit 0 = mask_ss : mask slave select this bit can be used to mask the status of sl ave select pin when bspi is in master mode and the pad corresponding to ss pin is not available. when this bit is set to ?1?, the bus error interrupt condition cannot be detected since inter nally the related signal is always considered high regardless from the actual pad status. 0 = slave select pin is used. 1 = slave select pin is masked. rburst_ len[1:0] burst length 00 1 word transferred 01 4 words transferred 10 8 words transferred 11 16 words transferred tburst_ len[1:0] burst length 00 1 word transferred 01 4 words transferred 10 8 words transferred 11 16 words transferred 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 200/401 bspi master clock divider register (bspclk) address offset: 10h reset value: 0006h bits 15:8 = reserved . to be left at 0 level (reset status). bits 7:0 = div[7:0] : divide factor bits. these bits are used to control the frequency of the bspi serial clock with relation to the device clock apb_clk. in master mode this number must be an even number greater than five, i.e. six is the lowest divide factor. in slave mode this number must be an even number greater than seven, i.e. eight is the lowest divide factor. these bits must be set before the bspe or mstr bits, i.e. before the bspi is configured into master mode. bspi transmit register (bsptxr) address offset: 04h reset value: n/a bits 15:0 = tx[15:0] : transmit data. this register is used to write data for transm ission into the bspi. if the fifo is enabled then data written to this register will be transferred to the fifo before transmission. if the fifo is disabled then the register contents are transferred directly to the shift register for transmission. in sixteen bit mode all of the regi ster bits are used. in eight bit mode only the upper eight bits of the register are used while lower eight bits are ignored. in both case the data is left justified, i.e. bit[15] = msb, bit[0] / bit[8] = lsb depending on the operating mode. 1514131211109 87654321 0 reserved div[7:0] -rw 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 bit transmission tx[15:0] 8 bit transmission tx[7:0] not used w 1 .com .com .com .com .com 4 .com u datasheet
STR720 - buffered spi (bspi) 201/401 bspi receive register (bsprxr) address offset: 00h reset value: 0000h bits 15:0 = rx[15:0] : received data . this register contains the data received from the bspi bus. if the fifo is disabled then the data from the shift register is placed into the receive register directly. if the fifo is enabled then the received data is transferred into the fifo. in sixteen bit mode all the register bits are utilized. in eight bit reception mode the received data is replicated on the upper and lower eight bits of the register so to support both little and big endian memory systems. 17.4.1 register map a summary overview of the bspi registers is given in the following table. (*)data is justified depending on transmission mode, bit 15 = msb. refer to table 20 on page 49 for the base address. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 bit reception rx[15:0] 8 bit reception rx[7:0] rx[7:0] r table 47. bspi register map addr. offset register name 1514131211109876543210 0 bsprxr rx[15:0] (*) 04 bsptxr tx[15:0] (*) 08 bspcsr1 rfe[3:0] wl[1:0] cpha cpol beie reserved reie rie[1:0] mstr bspe 0c bspcsr2 tie[1:0] tfe[3:0] tfne tff tufl tfe rofl rff rfne berr res. dfifo 10 bspclk reserved div[7:0] 14 bspcsr3 reserved rreq _en treq_ en rburst_ len[1:0] tburst_ len [1:0] dma _en mask _ss 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 202/401 18 controller area network (can) 18.1 introduction the can peripheral consists of the can core, message ram, message handler, control registers and module interface (refer to figure 29 ). the can core performs communication according to the can protocol version 2.0 part a and b. the bit rate can be programmed to values up to 1mbit/s. for the connection to the physical layer, additional transceiver hardware is required. for communication on a can network, individual message objects are configured. the message objects and identifier masks for acceptance filtering of received messages are stored in the message ram. all functions concerning the handling of messages are implemented in the message handler. these functions include acceptance filtering, the transfer of messages between the can core and the message ram, and the handling of transmission requests as well as the generation of the module interrupt. the register set of the can peripheral can be accessed directly by the cpu through the module interface. these registers are used to control/configure the can core and the message handler and to access the message ram. 18.2 main features  supports can protocol version 2.0 part a and b.  bit rates up to 1 mbit/s.  32 message objects.  each message object has its own identifier mask.  programmable fifo mode (concatenation of message objects).  maskable interrupt.  disabled automatic re-transmission mode for time triggered can applications.  programmable loop-back mode for self-test operation.  8-bit non-multiplex motorola hc08 compatible module interface.  two 16-bit module interfaces to the amba apb bus. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 203/401 18.3 block diagram the can peripheral interfaces with the amba apb bus. figure 29 shows the block diagram of the can peripheral. can core can protocol controller and rx/tx shift register for serial/parallel conversion of messages. message ram stores message objects and identifier masks. registers all registers used to control and to configure the can peripheral. message handler state machine that controls the data transfer between the rx/tx shift register of the can core and the message ram as well as the generation of interrupts as programmed in the control and configuration registers. module interface can peripheral interfaces to the amba apb 16-bit bus from arm. figure 29. block diagram of the can peripheral can peripheral can core registers module interface message handler can_tx can_rx message ram datain interrupt clock reset address(7:0) control can_wait_b dataout 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 204/401 18.4 functional description 18.4.1 software initialization the software initialization is started by setting the init bit in the can control register, either by a software or a hardware reset, or by going to bus_off state. while the init bit is set, all message transfers to and from the can bus are stopped and the status of the can_tx output pin is recess ive (high). the error management logic (eml) counters are unchanged. setting the init bit does not change any configuration register. to initialize the can controller, software has to set up the bit timing register and each message object. if a message object is not required, the corresponding msgval bit should be cleared. otherwise, the entire message object has to be initialized. access to the bit timing register and to the baud rate prescaler (brp) extension register for configuring bit timing is enabled when the init and configuration change enable ( cce) bits in the can control register are both set. resetting the init bit (by cpu only) finishes the software initialization. later, the bit stream processor (bsp) (see section 18.7.10: configuring the bit timing on page 249 ) synchronizes itself to the data transfer on the can bus by waiting for the occurrence of a sequence of 11 consecutive recessive bits ( bus idle) before it can take part in bus activities and start the message transfer. the initialization of the message objects is independent of init and can be done on the fly, but the message objects should all be configured to particular identifiers or set to not valid before the bsp starts the message transfer. to change the configuration of a message object during normal operation, software has to start by resetting the corresponding msgval bit. when the configuration is completed, msgval is set again. 18.4.2 can message transfer once the can peripheral is initialized and init bit is cleared, the can peripheral core synchronizes itself to the can bus and starts the message transfer. received messages are stored in their appropriate message objects if they pass the message handler?s acceptance filtering. the whole message including all arbitration bits, dlc and eight data bytes are stored in the message object. if the identifier mask is used, the arbitration bits which are masked to ?don?t care? may be overwritten in the message object. software can read or write each message any time through the interface registers and the message handler guarantees data consistency in case of concurrent accesses. messages to be transmitted are updated by the application software. if a permanent message object (arbitration and control bits are set during configuration) exists for the message, only the data bytes are updated and the txrqst bit with newdat bit are set to start the 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 205/401 transmission. if several transmit messages are assigned to the same message object (when the number of message objects is not sufficient), the whole message object has to be configured before the transmission of this message is requested. the transmission of any number of message objects may be requested at the same time. message objects are transmitted subsequently according to their internal priority. messages may be updated or set to not valid any time, even when their requested transmission is still pending. the old data will be discarded when a message is updated before its pending transmission has started. depending on the configuration of the message object, the transmission of a message may be requested autonomously by the reception of a remote frame with a matching identifier. 18.4.3 disabled automatic re-transmission mode in accordance with the can specification (see iso11898, 6.3.3 recovery management), the can peripheral provides means for automatic re-transmission of frames that have lost arbitration or have been disturbed by errors during transmission. the frame transmission service will not be confirmed to the user before the transmission is successfully completed. this means that, by default, automatic retransmission is enabled. it can be disabled to enable the can peripheral to work within a time triggered can (ttcan, see iso11898-1) environment. disabled automatic retransmission mode is enabled by setting the disable automatic retransmission (dar) bit in the can control register. in this operation mode, the programmer has to consider the different behavio ur of bits txrqst and newdat in the control registers of the message buffers:  when a transmission starts, bit txrqst of the respective message buffer is cleared, while bit newdat remains set.  when the transmission completed successfully, bit newdat is cleared.  when a transmission fails (lost arbitrat ion or error), bit newdat remains set. to restart the transmission, the cpu should set the bit txrqst again. 18.4.4 test mode test mode is entered by setting the test bit in the can control register. in test mode, bits tx1, tx0, lback, silent and basic in the test register are writeable. bit rx monitors the state of the can_rx pin and therefore is only readable. all test register functions are disabled when the test bit is cleared. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 206/401 18.4.5 silent mode the can core can be set in silent mode by programming the silent bit in the test register to one. in silent mode, the can peripheral is able to receive valid data frames and valid remote frames, but it sends only recessive bits on the can bus and it cannot start a transmission. if the can core is required to send a dominant bit (ack bit, error frames), the bit is rerouted internally so that the can core monitors this dominant bit, although the can bus may remain in recessive state. the silent mode can be used to analyse the traffic on a can bus without affecting it by the transmission of dominant bits. figure 30 shows the connection of signals can_tx and can_rx to the can core in silent mode. in iso 11898-1, silent mode is called bus monitoring mode. 18.4.6 loop back mode the can core can be set in loop back mode by programming the test register bit lback to one. in loop back mode, the can core treats its own transmitted messages as received messages and stores them in a receive b uffer (if they pass acceptance filtering). figure 31 shows the connection of signals, can_tx and can_rx, to the can core in loop back mode. figure 30. can core in silent mode can_tx can_rx tx rx can core can peripheral ? ? =1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 207/401 this mode is provided for self-test functions. to be independent from external stimulation, the can core ignores acknowledge errors (recessive bit sampled in the acknowledge slot of a data/ remote frame) in loop back mode. in this mode, the can core performs an internal feedback from its tx output to its rx input. the actual value of the can_rx input pin is disregarded by the can core. the transmitted messages can be monitored on the can_tx pin. 18.4.7 loop back combined with silent mode it is also possible to combine loop back mode and silent mode by programming bits lback and silent to one at the same time. this mode can be used for a ?hot selftest?, which means that can peripheral can be tested without affecting a running can system connected to the can_tx and can_rx pins. in this mode, the can_rx pin is disconnected from the can core and the can_tx pin is held recessive. figure 32 shows the connection of signals can_tx and can_rx to the can core in case of the combination of loop back mode with silent mode. figure 31. can core in loop back mode figure 32. can core in loop back mode combined with silent mode can_tx can_rx tx rx can core ? ? can peripheral can_tx can_rx tx rx can core ? ? =1 can peripheral 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 208/401 18.4.8 basic mode the can core can be set in basic mode by programming the test register bit basic to one. in this mode, the can peripheral runs without the message ram. the if1 registers are used as transmit buffer . the transmission of the contents of the if1 registers are requested by writing the busy bit of the if1 command request register to one. the if1 registers are locked while the busy bit is set. the busy bit indicates that the transmission is pending. as soon the can bus is idle, the if1 register s are loaded into the shift register of the can core and the transmission is started. when the transmission has been completed, the busy bit is reset and the locked if1 registers are released. a pending transmission can be aborted at any time by resetting the busy bit in the if1 command request register while the if1 registers are locked. if the cpu has reset the busy bit, a possible retransmission in case of lost ar bitration or in case of an error is disabled. the if2 registers are used as a receive buffer. after the reception of a message the contents of the shift register is stored into th e if2 registers, without any acceptance filtering. additionally, the actual contents of the shi ft register can be monitored during the message transfer. each time a read message object is initiated by writing the busy bit of the if2 command request register to one, the contents of the shift register are stored in the if2 registers. in basic mode, the evaluation of all message object related control and status bits and the control bits of the ifn command mask registers are turned off. the message number of the command request registers is not evaluated. the newdat and msglst bits in the if2 message control register retain their function, dlc3-0 indicate the received dlc, and the other control bits are read as ?0?. 18.4.9 software control of can_tx pin four output functions are available for the can transmit pin, can_tx. in addition to its default function (serial data output), the can transmit pin can drive the can sample point signal to monitor can_core?s bit timing and it can drive constant dominant or recessive values. the latter two functions, combined with the readable can receive pin can_rx, can be used to check the physical layer of the can bus. the output mode for the can_tx pin is selected by programming the tx1 and tx0 bits of the can test register. the three test functions of the can_tx pin interfere with all can protocol functions. can_tx must be left in its default function when can message transfer or any of the test modes (loop back mode, silent mode, or basic mode) are selected. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 209/401 18.5 register description the can peripheral allocates an address spac e of 256 bytes. the registers are organized as 16-bit registers. the two sets of interface registers (if1 and if2) control the cpu access to the message ram. they buffer the data to be transferred to and from the ram, avoiding conflicts between cpu accesses and message reception/transmission. in this section, the following abbreviations are used: the can registers are listed in table 48 . read/write (rw) the software can read and write to these bits. read-only (r) the software can only read these bits. write-only (w) the software should only write to these bits. table 48. can registers register name address offset reset value can control register (can_cr) 00h 0001h status register (can_sr) 04h 0000h error counter (can_err) 08h 0000h bit timing register (can_btr) 0ch 2301h test register (can_testr) 14h 0000 0000 r000 0000 b brp extension register (can_brpr) 18h 0000h ifn command request registers (can_ifn_crr) 20h (can_if1_crr), 80h (can_if2_crr) ifn command mask registers (can_ifn_cmr) 24h (can_if1_cmr), 84h (can_if2_cmr) 0000h ifn mask 1 register (can_ifn_m1r) 28h (can_if1_m1r), 88h (can_if2_m1r) ffffh ifn mask 2 register (can_ifn_m2r) 2ch (can_if1_m2r), 8ch (can_if2_m2r) ffffh ifn message arbitration 1 register (can_ifn_a1r) 30h (can_if1_a1r), 90h (can_if2_a1r) 0000h ifn message arbitration 2 register (can_ifn_a2r) 34h (can_if1_a2r), 94h (can_if2_a2r) 0000h ifn message control registers (can_ifn_mcr) 38h (can_if1_mcr), 98h (can_if2_mcr) 0000h ifn data a/b registers (can_ifn_danr and can_ifn_dbnr) interrupt identifier register (can_idr) 10h 0000h transmission request registers 1 & 2 (can_txrnr) 100h (can_txr1r), 104h (can_txr2r) 0000 0000h new data registers 1 & 2 (can_ndnr) 120h (can_nd1r), 124h (can_nd2r) 0000 0000h 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 210/401 18.5.1 can interface reset state after the hardware reset, the can peripheral registers hold the reset values given in the register descriptions below. additionally the busoff state is reset and the output can_tx is set to recessive (high). the value 0x0001 (init = ?1?) in the can control register enables the software initialization. the can peripheral does not influence the can bus until the cpu resets the init bit to ?0?. the data stored in the message ram is not affected by a hardware reset. after powering on, the contents of the message ram are undefined. 18.5.2 can protocol related registers these registers are related to the can protocol controller in the can core. they control the operating modes and the configuration of the can bit timing and provide status information. interrupt pending registers 1 & 2 (can_ipnr) 140h (can_ip1r), 144h (can_ip2r) 0000 0000h message valid registers 1 & 2 (can_mvnr) 160h (can_mv1r), 164h (can_mv2r) 0000 0000h table 48. can registers register name address offset reset value 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 211/401 can control register (can_cr) address offset: 00h reset value: 0001h 15141312111098765 4 3210 reserved test cce dar res eie sie ie init rw rw rw rw rw rw rw bits 15:8 reserved these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. bit 7 test: test mode enable 0: normal operation. 1: test mode. bit 6 cce: configuration change enable 0: no write access to the bit timing register. 1: write access to the bit timing register allowed (while bit init=1). bit 5 dar: disable automatic re-transmission 0: automatic retransmission of disturbed messages enabled. 1: automatic retransmission disabled. bit 4 reserved this is a reserved bit. this bit is always read as ?0? and must always be written with ?0?. bit 3 eie: error interrupt enable 0: disabled - no error status interrupt will be generated. 1: enabled - a change in the bits boff or ewarn in the status register will generate an interrupt. bit 2 sie: status change interrupt enable 0: disabled - no status change interrupt will be generated. 1: enabled - an interrupt will be generated when a message transfer is successfully completed or a can bus error is detected. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 212/401 note the busoff recovery sequence (see can specification rev. 2.0) cannot be shortened by setting or resetting the init bit. if the device goes in the busoff state, it will set init of its own accord, stopping al l bus activities. once init has been cleared by the cpu, the device will then wait for 129 occurrences of bus idle (129 * 11 consecutive recessive bits) before resu ming normal operations. at the end of the busoff recovery sequence, the error management counters will be reset. during the waiting time after resetting init, each time a sequence of 11 recessive bits has been monitored, a bit0error code is written to the status register, enabling the cpu to readily check up whether the can bus is stuck at dominant or continuously disturbed and to monitor the proceeding of the busoff recovery sequence. bit 1 ie: module interrupt enable 0: disabled. 1: enabled. bit 0 init initialization 0: normal operation. 1: initialization is started. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 213/401 status register (can_sr) address offset: 04h reset value: 0000h 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved boff ewarn epass rxok txok lec rr rrwrw rw bit 15:8 reserved these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. bit 7 boff: busoff status 0: the can module is not in busoff state. 1: the can module is in busoff state. bit 6 ewarn: warning status 0: both error counters are below the error warning limit of 96. 1: at least one of the error counters in the eml has reached the error warning limit of 96. bit 5 epass: error passive 0: the can core is error active. 1: the can core is in the error passive state as defined in the can specification. bit 4 rxok: received a message successfully 0: no message has been successfully received since this bit was last reset by the cpu. this bit is never reset by the can core. 1: a message has been successfully received since this bit was last reset by the cpu (independent of the result of acceptance filtering). bit 3 txok: transmitted a message successfully 0: since this bit was reset by the cpu, no message has been successfully transmitted. this bit is never reset by the can core. 1: since this bit was last reset by the cpu, a message has been successfully (error free and acknowledged by at least one other node) transmitted. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 214/401 bits 2:0 lec[2:0]: last error code (type of the last error to occur on the can bus) the lec field holds a code, which indi cates the type of the last error to occur on the can bus. this field will be cleared to ?0? when a message has been transferred (reception or transmission) without error. the unused code ?7? may be written by the cpu to check for updates. table 49 describes the error codes. table 49. error codes error code meaning 0no error 1 stuff error: more than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. 2 form error: a fixed format part of a received frame has the wrong format. 3 ackerror: the message this can core transmitted was not acknowledged by another node. 4 bit1error: during the transmission of a message (with the exception of the arbitra- tion field), the device wanted to send a recessive level (bit of logical value ?1?), but the monitored bus value was dominant. 5 bit0error: during the transmission of a message (or acknowledge bit, or active error flag, or overload flag), though the device wanted to send a dominant level (data or identifier bit logical value ?0?), but the monitored bus value was recessive. during busoff recovery, this status is set each time a sequence of 11 recessive bits has been monitored. this enables the cpu to monitor the proceedings of the busoff recovery sequence (indicating the bus is not stuck at dominant or continu- ously disturbed). 6 crcerror: the crc check sum was incorr ect in the message received, the crc received for an incoming message does not match with the calculated crc for the received data. 7 unused: when the lec shows the value ?7?, no can bus event was detected since the cpu wrote this value to the lec. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 215/401 status interrupts a status interrupt is generated by bits boff and ewarn (error interrupt) or by rxok, txok, and lec (status change interrupt) assuming that the corresponding enable bits in the can control register are set. a change of bit epass or a write to rxok, txok, or lec will never generate a status interrupt. reading the status register will clear the status interrupt value (8000h) in the interrupt register, if it is pending. error counter (can_err) address offset: 08h reset value: 0000h 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 rp rec[6:0] tec[7:0] rr r bit 15 rp: receive error passive 0: the receive error counter is below the error passive level. 1: the receive error counter has reached the error passive level as defined in the can specification. bits 14:8 rec[6:0]: receive error counter actual state of the receive error counter. values between 0 and 127. bits 7:0 tec[7:0]: transmit error counter actual state of the transmit error counter. values between 0 and 255. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 216/401 bit timing register (can_btr) address offset: 0ch reset value: 2301h note with a module clock apb_clk of 8 mhz, the reset value of 0x2301 configures the can peripheral for a bit rate of 500 kbit/s. the registers are only writable if bits cce and init in the can control register are set. 1514131211109876543210 res tseg2 tseg1 sjw brp rw rw rw rw bit 15 reserved this is a reserved bit. this bit is always read as ?0? and must always be written with ?0?. bits 14:12 tseg2: time segment after sample point 0x0-0x7: valid values for tseg2 are [ 0 ? 7 ]. the actual interpretation by the hardware of this value is such that one more than the value programmed here is used. bits 11:8 tseg1: time segment before the sample point minus sync_seg 0x01-0x0f: valid values for tseg1 are [ 1 ? 15 ]. the actual interpretation by the hardware of this value is such that one more than the value programmed is used. bits 7:6 sjw : ( re)synchronization jump width 0x0-0x3: valid programmed values are [ 0 ? 3 ]. the actual interpretation by the hardware of this value is such that one more than the value programmed here is used. bits 5:0 brp: baud rate prescaler 0x01-0x3f: the value by which the oscillator frequency is divided for generating the bit time quanta. the bit time is built up from a multiple of this quanta. valid values for the baud rate prescaler are [ 0 ? 63 ]. the actual interpretation by the hardware of this value is such that one more than the value programmed here is used. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 217/401 test register (can_testr) address offset: 14h reset value: 0000 0000 r000 0000 b (r:current value of rx pin) write access to the test register is enabled by setting the test bit in the can control register. the different test functions may be combined, but tx1-0 ?00? disturbs message transfer. 15141312111098765432 1 0 reserved rx tx[1:0] lback silent basic res rrwrwrwrw bits 15:8 reserved these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. bit 7 rx: current value of can_rx pin 0: the can bus is dominant (can_rx = ?0?). 1: the can bus is recessive (can_rx = ?1?). bit 6:5 tx[1:0]: can_tx pin control 00: reset value, can_tx is controlled by the can core 01: sample point can be monitored at can_tx pin 10: can_tx pin drives a dominant (?0?) value. 11: can_tx pin drives a recessive (?1?) value. bit 4 lback: loop back mode 0: loop back mode is disabled. 1: loop back mode is enabled. bit 3 silent: silent mode 0: normal operation. 1: the module is in silent mode. bit 2 basic: basic mode 0: basic mode disabled. 1: if1 registers used as tx buffer, if2 registers used as rx buffer. bits 1:0 reserved. these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 218/401 brp extension register (can_brpr) address offset: 18h reset value: 0000h 1514131211109876543210 reserved brpe rw bits 15:4 reserved these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. bits 3:0 brpe: baud rate prescaler extension 0x00-0x0f: by programming brpe, the baud rate prescaler can be extended to values up to 1023. the actual interpretation by the hardware is that one more than the value programmed by brpe (msbs) and brp (lsbs) is used. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 219/401 18.5.3 message interface register sets there are two sets of interface registers, wh ich are used to control the cpu access to the message ram. the interface registers avoid conflict between the cpu access to the message ram and can message reception and transmission by buffering the data to be transferred. a complete message object (see section 18.5.3.2 ) or parts of the message object may be transferred between the message ram and the if n message buffer registers (see section 18.5.3.1 ) in one single transfer. the function of the two interface register sets is identical except for the basic test mode. they can be used the way one set of registers is used for data transfer to the message ram while the other set of registers is used for the data transfer from the message ram, allowing both processes to be interrupted by each other. table 50 if1 and if2 message interface register set on page 219 provides an overview of the two interface register sets. each set of interface registers consists of me ssage buffer registers controlled by their own command registers. the command mask register specifies the direction of the data transfer and which parts of a message object will be transferred. the command request register is used to select a message object in the message ram as target or source for the transfer and to start the action specified in the command mask register. table 50. if1 and if2 message interface register set address if1 register set address if2 register set can base + 0x20 if1 command request can base + 0x80 if2 command request can base + 0x24 if1 command mask can base + 0x84 if2 command mask can base + 0x28 if1 mask 1 can base + 0x88 if2 mask 1 can base + 0x2c if1 mask 2 can base + 0x8c if2 mask 2 can base + 0x30 if1 arbitration 1 can base + 0x90 if2 arbitration 1 can base + 0x34 if1 arbitration 2 can base + 0x94 if2 arbitration 2 can base + 0x38 if1 message control can base + 0x98 if2 message control can base + 0x3c if1 data a 1 can base + 0x9c if2 data a 1 can base + 0x40 if1 data a 2 can base + 0xa0 if2 data a 2 can base + 0x44 if1 data b 1 can base + 0xa4 if2 data b 1 can base + 0x48 if1 data b 2 can base + 0xa8 if2 data b 2 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 220/401 if n command request registers (can_if n_ crr) address offset: 20h (can_if1_crr), 80h (can_if2_crr) reset value: 0001h a message transfer is started as soon as the application software has written the message number to the command request register. with this write operation, the busy bit is automatically set to notify the cpu that a transfer is in progress. after a waiting time of 3 to 6 apb_clk periods, the transfer between the in terface register and the message ram is completed. the busy bit is cleared. note when a message number that is not va lid is written into the command request register, the message number will be transformed into a valid value and that message object will be transferred. 15 14131211109876543210 busy reserved message number r rw bit 15 busy: busy flag 0: read/write action has finished. 1: writing to the if n command request register is in progress. this bit can only be read by the software. bits 14:6 reserved these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. bits 5:0 message number 0x01-0x20: valid message number, the message object in the message ram is selected for data transfer. 0x00: not a valid message number, interpreted as 0x20 . 0x21-0x3f: not a valid message number, interpreted as 0x01-0x1f . 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 221/401 if n command mask registers (can_if n_ cmr) address offset: 24h (can_if1_cmr), 84h (can_if2_cmr) reset value: 0000h the control bits of the if n command mask register specify the transfer direction and select which of the if n message buffer registers are source or target of the data transfer. 1514131211109876543210 reserved wr/rd mask arb control clrintpnd txrqst/ newdat data a data b rw rw rw rw rw rw rw rw bits 15:8 reserved these are reserved bits. these bits ar e always read as ?0? and must always be written with ?0?. bit 7 wr/rd: write / read 0: read: transfer data from the message object addressed by the command request register into the selected message buffer registers. 1: write: transfer data from the selected message buffer registers to the message object addressed by the command request register. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 222/401 bits 6:0 these bits of ifn command mask register have different functions depending on the transfer direction: direction = write bit 6 = mask access mask bits 0: mask bits unchanged. 1: transfer identifier mask + mdir + mxtd to message object. bit 5 = arb access arbitration bits 0: arbitration bits unchanged. 1: transfer identifier + dir + xtd + msgval to message object. bit 4 = control access control bits 0: control bits unchanged. 1: transfer control bits to message object. bit 3 = clrintpnd clear interrupt pending bit when writing to a message object, this bit is ignored. bit 2 = txrqst/newdat access transmission request bit 0: txrqst bit unchanged. 1: set txrqst bit. if a transmission is requested by prog ramming bit txrqst/newdat in the ifn command mask register, bit txrqst in the ifn message control register will be ignored. bit 1 = data a access data bytes 3:0 0: data bytes 3:0 unchanged. 1: transfer data bytes 3:0 to message object. bit 0 = data b access data bytes 7:4 0: data bytes 7:4 unchanged. 1: transfer data bytes 7:4 to message object. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 223/401 bits 6:0 direction = read bit 6 = mask: access mask bits 0: mask bits unchanged. 1: transfer identifier mask + mdir + mxtd to if n message buffer register. bit 5 = arb: access arbitration bits 0: arbitration bits unchanged. 1: transfer identifier + dir + xtd + msgval to if n message buffer register. bit 4 = control: access control bits 0: control bits unchanged. 1: transfer control bits to if n message buffer register. bit 3 = clrintpnd: clear interrupt pending bit 0: intpnd bit remains unchanged. 1: clear intpnd bit in the message object. bit 2 = txrqst/newdat: access transmission request bit 0: newdat bit remains unchanged. 1: clear newdat bit in the message object. note a read access to a message object can be combined with the reset of the control bits intpnd and newdat. the values of these bits transferred to the ifn message control register always reflect the status before resetting these bits. bit 1 = data a access data bytes 3:0 0: data bytes 3:0 unchanged. 1: transfer data bytes 3:0 to if n message buffer register. bit 0 = data b access data bytes 7:4 0: data bytes 7:4 unchanged. 1: transfer data bytes 7:4 to if n message buffer register. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 224/401 18.5.3.1 if n message buffer registers the bits of the message buffer registers mirror the message objects in the message ram. the function of the message objects bits is described in section 18.5.3.2: message object in the message memory on page 227 . if n mask 1 register (can_if n_ m1r) address offset: 28h (can_if1_m1r), 88h (can_if2_m1r) reset value: ffffh the function of the msk bits is described in section 18.5.3.2: message object in the message memory on page 227 . if n mask 2 register (can_if n_ m2r) address offset: 2ch (can_if1_m2r), 8ch (can_if2_m2r) reset value: ffffh the function of the message objects bits is described in the section 18.5.3.2: message object in the message memory on page 227 . 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 msk[15:0] rw 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 mxtd mdir res msk[28:16] rw rw r rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 225/401 if n message arbitration 1 register (can_if n _a1r) address offset: 30h (can_if1_a1r), 90h (can_if2_a1r) reset value: 0000h the function of the message objects bits is described in the section 18.5.3.2: message object in the message memory on page 227 . if n message arbitration 2 register (can_if n _a2r) address offset: 34h (can_if1_a2r), 94h (can_if2_a2r) reset value: 0000h the function of the message objects bits is described in the section 18.5.3.2: message object in the message memory on page 227 . if n message control registers (can_if n _mcr) address offset: 38h (can_if1_mcr), 98h (can_if2_mcr) reset value: 0000h the function of the message objects bits is described in the section 18.5.3.2: message object in the message memory on page 227 . 1514131211109876543210 id[15:0] rw 15 14 131211109876543210 msgval xtd dir id[28:16] rw rw rw rw 151413121110987654321 0 newdat msglst intpnd umask txie rxie rmten txrqst eob reserved dlc[3:0] rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 226/401 if n data a/b registers (can_if n _da n r and can_if n _db n r) the data bytes of can messages are stored in the if n message buffer registers in the following order: in a can data frame, data(0) is the first, data(7) is the last byte to be transmitted or received. in can?s serial bit stream, the msb of each byte will be transmitted first. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 if1 message data a1 (address 0x3c) data(1) data(0) if1 message data a2 (address 0x40) data(3) data(2) if1 message data b1 (address 0x44) data(5) data(4) if1 message data b2 (address 0x48) data(7) data(6) if2 message data a1 (address 0x9c) data(1) data(0) if2 message data a2 (address 0xa0) data(3) data(2) if2 message data b1 (address 0xa4) data(5) data(4) if2 message data b2 (address 0xa8) data(7) data(6) rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 227/401 18.5.3.2 message object in the message memory there are 32 message objects in the message ram. to avoid conflicts between cpu access to the message ram and can message reception and transmission, the cpu cannot directly access the message objects, these accesses are handled through the if n interface registers. table 51 provides an overview of the structures of a message object. the arbitration registers id28-0, xtd, and dir are used to define the identifier and type of outgoing messages and are used (together with the mask registers msk28-0, mxtd, and mdir) for acceptance filtering of incoming messages. a received message is stored in the valid message object with matching identifier and di rection set to receive (data frame) or transmit (remote frame). extended frames can be stored only in message objects with xtd set, standard frames in message objects with xtd clear. if a received message (data frame or remote frame) matches more than one valid message object, it is stored into that with the lowest message number. for details see section ?acceptance filtering of received messages? . table 51. structure of a message object in the message memory message object uma sk msk 28-0 m xt d m dir eob newdat ms gls t rxi e txi e int pnd rmt en txrq st msg val id28- 0 xt d dir dlc 3-0 dat a 0 dat a 1 dat a 2 dat a 3 dat a 4 dat a 5 data 6 data 7 msgval message valid 1: the message object is configured and should be considered by the message handler. 0: the message object is ignored by the message handler. note the application software must reset the msgval bit of all unused messages objects during the initialization before it resets bit init in the can control register. this bit must also be reset before the identifier id28-0, the control bits xtd, dir, or the data length code dlc3-0 are modified, or if the messages object is no longer required. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 228/401 umask use acceptance mask 1: use mask (msk28-0, mxtd, and mdir) for acceptance filtering. 0: mask ignored. note if the umask bit is set to one, the message object?s mask bits have to be programmed during initialization of the message object before msgval is set to one. id28-0 message identifier id28 - id0, 29-bit identifier (?extended frame?) id28 - id18, 11-bit identifier (?standard frame?) msk28-0 identifier mask 1: the corresponding identifier bit is used for acceptance filtering. 0: the corresponding bit in the identifier of the message object cannot inhibit the match in the acceptance filtering. xtd extended identifier 1: the 29-bit (?extended?) identifier will be used for this message object. 0: the 11-bit (?standard?) identifier will be used for this message object. mxtd mask extended identifier 1: the extended identifier bit (ide ) is used for acceptance filtering. 0: the extended identifier bit (ide) has no effect on the acceptance filtering. note when 11-bit (?standard?) identifiers are used for a message object, the identifiers of received data frames are written into bits id28 to id18. for acceptance filtering, only these bits together with mask bits msk28 to msk18 are considered. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 229/401 dir message direction 1: direction = transmit: on txrqst, the respective message object is transmitted as a data frame. on reception of a remote frame with matching identifier, the txrqst bit of this message object is set (if rmten = one). 0: direction = receive : on txrqst, a remote frame with the identifier of this message object is transmitted. on reception of a data frame with matching identifier, that message is stored in this message object. mdir mask message direction 1: the message direction bit (dir) is used for acceptance filtering. 0: the message direction bit (dir) has no effect on the acceptance filtering. eob end of buffer 1: single message object or last message object of a fifo buffer. 0: message object belongs to a fifo buffer and is not the last message object of that fifo buffer. note this bit is used to concatenate two or more message objects (up to 32) to build a fifo buffer. for single message objects (not belonging to a fifo buffer), this bit must always be set to one. for details on the concatenation of message objects see section ?configuring a fifo buffer? . newdat new data 1: the message handler or the application software has written new data into the data portion of this message object. 0: no new data has been written into the data portion of this message object by the message handler since last time this flag was cleared by the application software. msglst message lost (only valid for message objects with direction = receive ) 1: the message handler stored a new message into this object when newdat was still set, the cpu has lost a message. 0: no message lost since last time this bit was reset by the cpu. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 230/401 rxie receive interrupt enable 1: intpnd will be set after a successful reception of a frame. 0: intpnd will be left unchanged after a successful reception of a frame. txie transmit interrupt enable 1: intpnd will be set after a successful transmission of a frame. 0: intpnd will be left unchanged after the successful transmission of a frame. intpnd interrupt pending 1: this message object is the source of an interrupt. the interrupt identifier in the interrupt register will point to this message object if there is no other interrupt source with higher priority. 0:this message object is not the source of an interrupt. rmten remote enable 1: at the reception of a remote frame, txrqst is set. 0: at the reception of a remote frame, txrqst is left unchanged. txrqst transmit request 1: the transmission of this message object is requested and is not yet done. 0: this message object is not waiting for transmission. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 231/401 dlc3-0 data length code 0-8 : data frame has 0-8 data bytes. 9-15 : data frame has 8 data bytes note the data length code of a message object must be defined the same as in all the corresponding objects with the same identifier at other nodes. when the message handler stores a data frame, it will write the dlc to the value given by the received message. data 0: 1st data byte of a can data frame data 1 : 2nd data byte of a can data frame data 2 : 3rd data byte of a can data frame data 3 : 4th data byte of a can data frame data 4 : 5th data byte of a can data frame data 5 : 6th data byte of a can data frame data 6 : 7th data byte of a can data frame data 7 : 8th data byte of a can data frame note the data 0 byte is the first data byte shifted into the shift register of the can core during a reception while the data 7 byte is the last. when the message handler stores a data frame, it will write all the eight data bytes into a message object. if the data length code is less than 8, the remaining bytes of the message object will be overwritten by unspecified values. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 232/401 18.5.4 message handler registers all message handler registers are read-only. their contents, txrqst, newdat, intpnd, and msgval bits of each message object and the interrupt identifier is status information provided by the message handler fsm. interrupt identifier register (can_idr) address offset: 10h reset value: 0000h 1514131211109876543210 intid[15:0] r bits 15:0 intid15:0 interrupt identifier ( table 52 indicates the source of the interrupt) if several interrupts are pending, the can interrupt register will point to the pending interrupt with the highest priority, disregarding their chronological order. an interrupt remains pending until the application software has cleared it. if intid is different from 0x0000 and ie is set, the irq interrupt signal to the eic is active. the interrupt remains active until intid is back to value 0x0000 (the cause of the interrupt is reset) or until ie is reset. the status interrupt has the highest priority. among the message interrupts, the message object? s interrupt priority decreases with increasing message number. a message interrupt is cleared by clearing the message object?s intpnd bit. the status interrupt is cleared by reading the status register. table 52. source of interrupts 0x0000 no interrupt is pending 0x0001-0x0020 number of message object which caused the interrupt. 0x0001-0x0020 number of message object which caused the interrupt. 0x0021-0x7fff unused 0x8000 status interrupt 0x8001-0xffff unused 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 233/401 transmission request registers 1 & 2 (can_txr n r) address offset: 100h (can_txr1r), 104h (can_txr2r) reset value: 0000 0000h these registers hold the txrqst bits of the 32 message objects. by reading the txrqst bits, the cpu can check which message object in a transmission request is pending. the txrqst bit of a specific message object can be set/reset by the application software through the ifn message interface registers or by the message handler after reception of a remote frame or after a successful transmission. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 txrqst[32:17] r 1514131211109876543210 txrqst[16:1] r bits 31:16 txrqst32-17 transmission request bits (of all message objects) 0: this message object is not waiting for transmission. 1: the transmission of this message object is requested and is not yet done . these bits are read only. bits 15:0 txrqst16-1 transmission request bits (of all message objects) 0: this message object is not waiting for transmission. 1: the transmission of this message object is requested and is not yet done . these bits are read only. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 234/401 new data registers 1 & 2 (can_nd n r) address offset: 120h (can_nd1r), 124h (can_nd2r) reset value: 0000 0000h these registers hold the newdat bits of the 32 message objects. by reading out the newdat bits, the cpu can check for which message object the data portion was updated. the newdat bit of a specific message object can be set/reset by the cpu through the ifn message interface registers or by the message handler after reception of a data frame or after a successful transmission. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 newdat[32:17] r 1514131211109876543210 newdat[16:1] r bits 31:16 newdat32-17 new data bits (of all message objects) 0: no new data has been written into the data portion of this message object by the message handler since the last time this flag was cleared by the application software. 1: the message handler or the application software has written new data into the data portion of this message object. bits 15:0 newdat16-1 new data bits (of all message objects) 0: no new data has been written into the data portion of this message object by the message handler since the last time this flag was cleared by the application software. 1: the message handler or the application software has written new data into the data portion of this message object. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 235/401 interrupt pending registers 1 & 2 (can_ip n r) address offset: 140h (can_ip1r), 144h (can_ip2r) reset value: 0000 0000h these registers contain the intpnd bits of the 32 message objects. by reading the intpnd bits, the cpu can check for which message object an interrupt is pending. the intpnd bit of a specific message object can be set/reset by the application software through the ifn message interface registers or by the messa ge handler after reception or after a successful transmission of a frame. this will also affect the value of intid in the interrupt register. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 intpnd[32:17] r 1514131211109876543210 intpnd[16:1] r bits 31:16 intpnd32-17 interrupt pending bits (of all message objects) 0: this message object is not the source of an interrupt. 1: this message object is the source of an interrupt. bits 15:0 intpnd16-1 interrupt pending bits (of all message objects) 0: this message object is not the source of an interrupt. 1: this message object is the source of an interrupt. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 236/401 message valid registers 1 & 2 (can_mv n r) address offset: 160h (can_mv1r), 164h (can_mv2r) reset value: 0000 0000h these registers hold the msgval bits of the 32 message objects. by reading the msgval bits, the application software can check which message object is valid. the msgval bit of a specific message object can be set/reset by the application software via the ifn message interface registers. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 msgval[32:17] r 1514131211109876543210 msgval[16:1] r bits 31:16 msgval32-17 message valid bits (of all message objects) 0: this message object is ignored by the message handler. 1: this message object is configured and should be considered by the message handler. bits 15:0 msgval16-1 message valid bits (of all message objects) 0: this message object is ignored by the message handler. 1: this message object is configured and should be considered by the message handler. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 237/401 18.6 register map table 53. can register map addr offset register name 1 5 1 4 1 3 1 2 1 1 1 0 98765432 1 0 00h can_cr reserved test cce dar re s eie sie ie init 04h can_sr reserved boff ewarn epass rxok txok lec 08h can_err r p rec6-0 tec7-0 0ch can_btr re s tseg2 tseg1 sjw brp 10h can_idr intid15-8 intid7-0 14h can_testr reserved rx tx1 tx0 lback silent basic reserved 18h can_brpr reserved brpe 20h can_if1_crr b u sy reserved message number 24h can_if1_cmr reserved wr/rd mask arb control clrintpnd txrqst/ data a data b 28h can_if1_m1r msk15-0 2ch can_if1_m2r m xt d m di r re s msk28-16 30h can_if1_a1r id15-0 34h can_if1_a2r m s g v al xt d di r id28-16 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 238/401 38h can_if1_mcr newdat msglst intpnd umask txie rxie rmten txrqst eob reserved dlc3-0 3ch can_if1_da1 r data(1) data(0) 40h can_if1_da2 r data(3) data(2) 44h can_if1_db1 r data(5) data(4) 48h can_if1_db2 r data(7) data(6) 80h can_if2_crr b u sy reserved message number 84h can_if2_cmr reserved wr/rd mask arb control clrintpnd txrqst/ data a data b 88h can_if2_m1r msk15-0 8ch can_if2_m2r m xt d m di r re s msk28-16 90h can_if2_a1r id15-0 94h can_if2_a2r m s g v al xt d di r id28-16 98h can_if2_mcr newdat msglst intpnd umask txie rxie rmten txrqst eob reserved dlc3-0 9ch can_if2_da1 r data(1) data(0) table 53. can register map addr offset register name 1 5 1 4 1 3 1 2 1 1 1 0 98765432 1 0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 239/401 note reserved bits are read as 0? except fo r ifn mask 2 register where they are read as ?1?. a0h can_if2_da2 r data(3) data(2) a4h can_if2_db1 r data(5) data(4) a8h can_if2_db2 r data(7) data(6) 100h can_txr1r txrqst16-1 104h can_txr2r txrqst32-17 120h can_nd1r newdat16-1 124h can_nd2r newdat32-17 140h can_ip1r intpnd16-1 144h can_ip2r intpnd32-17 160h can_mv1r msgval16-1 164h can_mv2r msgval32-17 table 53. can register map addr offset register name 1 5 1 4 1 3 1 2 1 1 1 0 98765432 1 0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 240/401 18.7 can communications 18.7.1 managing message objects the configuration of the message objects in the message ram (with the exception of the bits msgval, newdat, intpnd, and txrqst) will not be affected by resetting the chip. all the message objects must be initialized by the application software or they must be ?not valid? (msgval = ?0?) and the bit timing must be confi gured before the application software clears the init bit in the can control register. the configuration of a message object is done by programming mask, arbitration, control and data fields of one of the two interface registers to the desired values. by writing to the corresponding ifn command request register, the ifn message buffer registers are loaded into the addressed message object in the message ram. when the init bit in the can control register is cleared, the can protocol controller state machine of the can_core and state machine of the message handler control the internal data flow of the can peripheral. received messages that pass the acceptance filtering are stored in the message ram, messages with pending transmission request are loaded into the can_core?s shift register and are transmitted through the can bus. the application software reads received messages and updates messages to be transmitted through the if n interface registers. depending on the configuration, the cpu is interrupted on certain can message and can error events. 18.7.2 message handler state machine the message handler controls the data transfer between the rx/tx shift register of the can core, the message ram and the if n registers. the message handler fsm controls the following functions:  data transfer from if n registers to the message ram  data transfer from message ram to the if n registers  data transfer from shift register to the message ram  data transfer from message ram to shift register  data transfer from shift register to the acceptance filtering unit  scanning of message ram for a matching message object  handling of txrqst flags  handling of interrupts. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 241/401 18.7.2.1 data transfer from/to message ram when the cpu initiates a data transfer between the if n registers and message ram, the message handler sets the busy bit in the respective command request register (can_ifn_crr). after the transfer has completed, the busy bit is again cleared (see figure 33 ). the respective command mask register specifies whether a complete message object or only parts of it will be transferred. due to the structure of the message ram, it is not possible to write single bits/bytes of one message object. it is always necessary to write a complete message object into the message ram. therefore, the data transfer from the if n registers to the message ram requires a read-modify-write cycle. first, those parts of the message object that are not to be changed are read from the message ram and then the complete contents of the message buffer registers are written into the message object. figure 33. data transfer between if n registers and message ram start wr/rd = 1 busy = 0 busy = 1 read message object to ifn write ifn to message ram read message object to ifn no yes can_wait_b = 0 can_wait_b = 1 write command request register no yes 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 242/401 after a partial write of a message object, the message buffer registers that are not selected in the command mask register will set the actual contents of the selected message object. after a partial read of a message object, the message buffer registers that are not selected in the command mask register will be left unchanged. 18.7.2.2 message transmission if the shift register of the can core cell is ready for loading and if there is no data transfer between the ifn registers and message ram, the msgval bits in the message valid register and txrqst bits in the transmission requ est register are evaluated. the valid message object with the highest priority pending transmission request is loaded into the shift register by the message handler and the transmission is started. the newdat bit of the message object is reset. after a successful transmission and also if no new data was written to the message object (newdat = ?0?) since the start of the transmission, the txrqst bit of the message control register (can_ifn_mcr) will be reset. if txie bit of the message control register (can_ifn_mcr) is set, intpnd bit of the interrupt identifier register (can_idr) will be set after a successful transmission. if the can peripheral has lost the arbitration or if an error occurred during the transmission, the message will be retransmitted as soon as the can bus is free again. meanwhile, if the transmission of a message with higher priority has been requested, the messages will be transmitted in the order of their priority. 18.7.2.3 acceptance filtering of received messages when the arbitration and control field (identifier + ide + rtr + dlc) of an incoming message is completely shifted into the rx/tx shift register of the can core, the message handler fsm starts the scanning of the message ram for a matching valid message object. to scan the message ram for a matching message object, the acceptance filtering unit is loaded with the arbitration bits from the can core shift register. the arbitration and mask fields (including msgval, umask, newdat, and eo b) of message object 1 are then loaded into the acceptance filtering unit and compared with the arbitration field from the shift register. this is repeated with each following message object until a matching message object is found or until the end of the message ram is reached. if a match occurs, the scan is stopped and the message handler fsm proceeds depending on the type of frame (data frame or remote frame) received. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 243/401 reception of data frame the message handler fsm stores the message from the can core shift register into the respective message object in the message ram. not only the data bytes, but all arbitration bits and the data length code are stored in the corresponding message object. this is done to keep the data bytes connected with the identifier even if arbitration mask registers are used. the newdat bit is set to indicate that new data (not yet seen by the cpu) has been received. the application software should reset newdat bit when the message object has been read. if at the time of reception, the newdat bit was already set, msglst is set to indicate that the previous data (supposedly not seen by the cpu) is lost. if the rxie bit is set, the intpnd bit is set, causing the interrupt register to point to this message object. the txrqst bit of this message object is reset to prevent the transmission of a remote frame, while the requested data frame has just been received. reception of remote frame when a remote frame is received, three different configurations of the matching message object have to be considered: 1) dir = ?1? (direction = transmit ), rmten = ?1?, umask = ?1? or?0? at the reception of a matching remote frame, the txrqst bit of this message object is set. the rest of the message object remains unchanged. 2) dir = ?1? (direction = transmit ), rmten = ?0?, umask =?0? at the reception of a matching remote frame, the txrqst bit of this message object remains unchanged; the remote frame is ignored. 3) dir = ?1? (direction = transmit ), rmten = ?0?, umask =?1? at the reception of a matching remote frame, the txrqst bit of this message object is reset. the arbitration and control field (identifier + ide + rtr + dlc) from the shift register is stored in the message object of the message ram and the newdat bit of this message object is set. the data field of the message object remains unchanged; the remote frame is treated similar to a received data frame. 18.7.2.4 receive/transmit priority the receive/transmit priority for the message objects is attached to the message number. message object 1 has the highest priority, while message object 32 has the lowest priority. if more than one transmission request is pending, they are serviced due to the priority of the corresponding message object. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 244/401 18.7.3 configuring a transmit object table 54 shows how a transmit object should be initialized. the arbitration register values (id28-0 and xtd bit) are provided by the application. they define the identifier and type of the outgoing message. if an 11-bit identifier (?standard frame?) is used, it is programmed to id28 - id18. the id17 - id0 can then be disregarded. if the txie bit is set, the intpnd bit will be se t after a successful transmission of the message object. if the rmten bit is set, a matching received remote frame will cause the txrqst bit to be set; the remote frame will autonomously be answered by a data frame. the data register values (dlc3-0, data0-7) are provided by the application, txrqst and rmten may not be set before the data is valid. the mask registers (msk28-0, umask, mxtd, and mdir bits) may be used (umask=?1?) to allow groups of remote frames with similar identifiers to set the txrqst bit. the dir bit should not be masked. 18.7.4 updating a transmit object the cpu may update the data bytes of a transmit object any time through the ifn interface registers, neither msgval nor txrqst have to be reset before the update. even if only a part of the data bytes are to be updated, all four bytes of the corresponding ifn data a register or ifn data b register have to be valid before the contents of that register are transferred to the message object. either the cpu has to write all four bytes into the ifn data register or the message object is transferred to the ifn data register before the cpu writes the new data bytes. when only the (eight) data bytes are updated, first 0x0087 is written to the command mask register and then the number of the message object is written to the command request register, concurrently updating the data bytes and setting txrqst. to prevent the reset of txrqst at the end of a transmission that may already be in progress while the data is updated, newdat has to be set together with txrqst. for details see section 18.7.2.2: message transmission on page 242 . when newdat is set together with txrqst, newdat will be reset as soon as the new transmission has started. table 54. initialization of a transmit object msgval arb data mask eob dir newdat msglst rxie txie intpnd rmten txrqst 1 appl. appl. appl. 1 1 0 0 0 appl. 0 appl. 0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 245/401 18.7.5 configuring a receive object table 55 shows how a receive object should be initialized. the arbitration registers values (id28-0 and xtd bit) are provided by the application. they define the identifier and type of accepted received messages. if an 11-bit identifier (?standard frame?) is used, it is programmed to id28 - id18. then id17 - id0 can be disregarded. when a data frame with an 11-bit identifier is received, id17 - id0 will be set to ?0?. if the rxie bit is set, the intpnd bit will be set when a received data frame is accepted and stored in the message object. the data length code (dlc3-0) is provided by the application. when the message handler stores a data frame in the message object, it will store the received data length code and eight data bytes. if the data length code is less than 8, the remaining bytes of the message object will be overwritten by unspecified values. the mask registers (msk28-0, umask, mxtd, and mdir bits) may be used (umask=?1?) to allow groups of data frames with similar iden tifiers to be accepted. the dir bit should not be masked in typical applications. 18.7.6 handling received messages the cpu may read a received message any time via the if n interface registers. the data consistency is guaranteed by the message handler state machine. typically, the cpu will write first 0x007f to the command mask register and then the number of the message object to the command request register. this combination will transfer the whole received message from the message ram into the message buffer register. additionally, the bits newdat and intpnd are cleared in the message ram (not in the message buffer). if the message object uses masks for acceptance filtering, the arbitration bits shows which of the matching messages have been received. the actual value of newdat shows whether a new message has been received since the last time this message object was read. the actual value of msglst shows whether more than one message has been received since the last time this message object was read. msglst will not be automatically reset. table 55. initialization of a receive object msgval arb data mask eob dir newdat msglst rxie txie intpnd rmten txrqst 1appl.appl.appl.1000appl.0000 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 246/401 by means of a remote frame, the cpu may request another can node to provide new data for a receive object. setting the txrqst bit of a receive object will cause the transmission of a remote frame with the receive object?s identifier. this remote frame triggers the other can node to start the transmission of the matching data frame. if the matching data frame is received before the remote frame could be transmitted, the txrqst bit is automatically reset. 18.7.7 configuring a fifo buffer with the exception of the eob bit, the configuration of receive objects belonging to a fifo buffer is the same as the configuration of a (single) receive object, see section 18.7.5: configuring a receive object on page 245 . to concatenate two or more message objects into a fifo buffer, the identifiers and masks (if used) of these message objects have to be programmed to matching values. due to the implicit priority of the message objects, the message object with the lowest number will be the first message object of the fifo buffer. the eob bit of all message objects of a fifo buffer except the last have to be programmed to zero. the eob bits of the last message object of a fifo buffer is set to one, configuring it as the end of the block. 18.7.8 receiving messages with fifo buffers received messages with identifiers matching to a fifo buffer are stored in a message object of this fifo buffer starting with the message object with the lowest message number. when a message is stored in a message object of a fifo buffer, the newdat bit of this message object is set. by setting newdat while eob is zero, the message object is locked for further write access by the message handler until the application software has written the newdat bit back to zero. messages are stored into a fifo buffer until the last message object of this fifo buffer is reached. if none of the preceding message objects is released by writing newdat to zero, all further messages for this fifo buffer will be written into the last message object of the fifo buffer and therefore overwrite previous messages. 18.7.8.1 reading from a fifo buffer when the cpu transfers the contents of a message object to the ifn message buffer register by writing its number to the ifn command request register, the corresponding command mask register should be programmed in such a way that bits newdat and intpnd are reset to zero (txrqst/newdat = ?1? and clrintpnd = ?1?). the values of these bits in the message control register always reflect the status before resetting the bits. to assure the correct function of a fifo buffer, the cpu should read the message objects starting at the fifo object with the lowest message number. figure 34 shows how a set of message objects which are concatenated to a fifo buffer can be handled by the cpu. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 247/401 figure 34. cpu handling of a fifo buffer read interrupt pointer start case interrupt pointer 0x8000h else 0x0000h status change end messagenum = interrupt pointer write messagenum to if n command request (read message to if n registers, reset newdat = 0, reset intpnd = 0) read if n message control newdat = 1 read data from if n data a,b eob = 1 messagenum = messagenum + 1 yes no yes no message interrupt interrupt handling 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 248/401 18.7.9 handling interrupts if several interrupts are pending, the can interrupt register will point to the pending interrupt with the highest priority, disregarding their chronological order. an interrupt remains pending until the application software has cleared it. the status interrupt has the highest priority. among the message interrupts, interrupt priority of the message object decreases with increasing message number. a message interrupt is cleared by clearing the intpnd bit of the message object. the status interrupt is cleared by reading the status register. the interrupt identifier, intid, in the interrupt register, indicates the cause of the interrupt. when no interrupt is pending, the register will hold the value zero. if the value of the interrupt register is different from zero, then there is an interrupt pending and, if ie is set, the irq interrupt signal to the eic is active. the interr upt remains active until the interrupt register is back to value zero (the cause of the interrupt is reset) or until ie is reset. the value 0x8000 indicates that an interrupt is pending because the can core has updated (not necessarily changed) the status register (error interrupt or status interrupt). this interrupt has the highest priority. the cpu can update (reset) the status bits rxok, txok and lec, but a write access of the cpu to the status register can never generate or reset an interrupt. all other values indicate that the source of the interrupt is one of the message objects. intid points to the pending message interrupt with the highest interrupt priority. the cpu controls whether a change of the status register may cause an interrupt (bits eie and sie in the can control register) and whether the interrupt line becomes active when the interrupt register is different from zero (bit ie in the can control register). the interrupt register will be updated even when ie is reset. the cpu has two possibilities to follow the source of a message interrupt. first, it can follow the intid in the interrupt register and second it can poll the interrupt pending register (see see ?interrupt pending registers 1 & 2 (can_ipnr)? on page 235. ). an interrupt service routine that is reading the message that is the source of the interrupt may read the message and reset the message object?s intpnd at the same time (bit clrintpnd in the command mask register). when intpnd is cleared, the interrupt register will point to the next message object with a pending interrupt. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 249/401 18.7.10 configuring the bit timing even if minor errors in the configuration of the can bit timing do not result in immediate failure, the performance of a can network can be reduced significantly. in many cases, the can bit synchronization w ill amend a faulty configuration of the can bit timing to such a degree that only occasionally an error frame is generated. however, in the case of arbitration, when two or more can nodes simultaneously try to transmit a frame, a misplaced sample point may cause one of the transmitters to become error passive. the analysis of such sporadic errors requ ires a detailed knowledge of the can bit synchronization inside a can node and interaction of the can nodes on the can bus. 18.7.10.1 bit time and bit rate can supports bit rates in the range of lower than 1 kbit/s up to 1000 kbit/s. each member of the can network has its own clock generator, usually a quartz oscillator. the timing parameter of the bit time (i.e. the reciprocal of the bit rate) can be configured individually for each can node, creating a common bit rate even though the oscillator periods of the can nodes (f osc ) may be different. the frequencies of these oscillators are not ab solutely stable, small variations are caused by changes in temperature or voltage and by deteriorating components. as long as the variations remain inside a specific oscillator tolerance range (df), the can nodes are able to compensate for the different bit rates by re-synchronizing to the bit stream. according to the can specification, the bit time is divided into four segments (see figure 35 ). the synchronization segment, the propagation time segment, the phase buffer segment 1 and the phase buffer segment 2. each segment consists of a specific, programmable number of time quanta (see table 56 ). the length of the time quantum (t q) , which is the basic time unit of the bit time, is defined by the can controller?s system clock f apb and the brp bit of the bit timing register (can_btr): t q = brp / f apb . the synchronization segment, sync_seg, is that part of the bit time where edges of the can bus level are expected to occur. the distance between an edge, that occurs outside of sync_seg, and the sync_seg is called the phase error of that edge. the propagation time segment, prop_seg, is intended to compensate for the physical delay times within the can network. the phase buffer segments phase_seg1 and phase_seg2 surround the sample point. the (re-)synchronization jump width (sjw) defines how far a re-synchronization may move the sample point inside the limits defined by the phase buffer segments to compensate for edge phase errors. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 250/401 a given bit rate may be met by different bit time configurations, but for the proper function of the can network the physical delay times and the oscillator?s tolerance range have to be considered. figure 35. bit timing table 56. can bit time parameters parameter range remark brp [1 .. 32] defines the l ength of the time quantum t q sync_seg 1 t q fixed length, synchronization of bus input to system clock prop_seg [1.. 8] t q compensates for the physical delay times phase_seg1 [1..8] t q may be lengthened temporarily by synchronization phase_seg2 [1.. 8] t q may be shortened temporarily by synchronization sjw [1 .. 4] t q may not be longer than eit her phase buffer segment this table describes the minimum programm able ranges required by the can protocol 1 time quantum (t q ) sync_ prop_seg phase_seg1 phase_seg2 sample point nominal can bit time seg 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 251/401 18.7.10.2 propagation time segment this part of the bit time is used to compensate physical delay times within the network. these delay times consist of the signal propagation time on the bus and the internal delay time of the can nodes. any can node synchronized to the bit stream on the can bus will be out of phase with the transmitter of that bit stream, caused by the si gnal propagation time between the two nodes. the can protocol?s non-destructive bitwise ar bitration and the dominant acknowledge bit provided by receivers of can messages requires that a can node transmitting a bit stream must also be able to receive dominant bits transmitted by other can nodes that are synchronized to that bit stream. the example in figure 36 shows the phase shift and propagation times between two can nodes. in this example, both nodes a and b are transmitters, performing an arbitration for the can bus. node a has sent its start of frame bit less than one bit time earlier than node b, therefore node b has synchronized itself to the received edge from recessive to dominant. since node b has received this edge delay (a_to_b) after it has been transmitted, b?s bit timing segments are shifted with respect to a. node b sends an identifier with higher priority and so it will win the arbitration at a specific identifier bit when it transmits a dominant bit while node a transmits a recessive bit. the dominant bit transmitted by node b will arrive at node a after the delay (b_to_a). due to oscillator tolerances, the actual position of node a?s sample point can be anywhere inside the nominal range of node a?s phase buffer segments, so the bit transmitted by node b figure 36. propagation time segment sync_seg prop_seg phase_seg1 phase_seg2 node b node a delay a_to_b delay b_to_a prop_seg >= delay a_to_b + delay b_to_a prop_seg >= 2  [max(node output delay+ bus line delay + node input delay)] delay a_to_b >= node output delay(a) + bus line delay(a b) + node input delay(b) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 252/401 must arrive at node a before the start of phase_seg1. this condition defines the length of prop_seg. if the edge from recessive to dominant transmitted by node b arrives at node a after the start of phase_seg1, it can happen that node a samples a recessive bit instead of a dominant bit, resulting in a bit error and the destruction of the current frame by an error flag. the error occurs only when two nodes arbitrate for the can bus that have oscillators of opposite ends of the tolerance range and that are separated by a long bus line. this is an example of a minor error in the bit timing configuration (prop_seg to short) that causes sporadic bus errors. some can implementations provide an optional 3 sample mode but the can peripheral does not. in this mode, the can bus input signal pa sses a digital low-pass filter, using three samples and a majority logic to determine the valid bit value. this results in an additional input delay of 1 t q , requiring a longer prop_seg. 18.7.10.3 phase buffer segments and synchronization the phase buffer segments (phase_seg1 and phase_seg2) and the synchronization jump width (sjw) are used to compensate for the oscillator tolerance. the phase buffer segments may be lengthened or shortened by synchronization. synchronizations occur on edges from recessi ve to dominant, their purpose is to control the distance between edges and sample points. edges are detected by sampling the actual bus level in each time quantum and comparing it with the bus level at the previous sample point. a synchronization may be done only if a recessive bit was sampled at the previous sample point and if the bus level at the actual time quantum is dominant. an edge is synchronous if it occurs inside of sync_seg, otherwise the distance between edge and the end of sync_seg is the edge phase error, measured in time quanta. if the edge occurs before sync_seg, the phase error is negative, else it is positive. two types of synchronization exist, hard synchronization and re-synchronization. a hard synchronization is done once at the start of a frame and inside a frame only when re-synchronizations occur.  hard synchronization after a hard synchronization, the bit time is restarted with the end of sync_seg, regardless of the edge phase error. thus har d synchronization forces the edge, which has caused the hard synchronization to lie within the synchronization segment of the restarted bit time.  bit re-synchronization re-synchronization leads to a shortening or lengthening of the bit time such that the position of the sample point is shifted with regard to the edge. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 253/401 when the phase error of the edge which ca uses re-synchronization is positive, phase_seg1 is lengthened. if the magnitude of the phase error is less than sjw, phase_seg1 is lengthened by the magnitude of the phase error, else it is lengthened by sjw. when the phase error of the edge, which causes re-synchronization is negative, phase_seg2 is shortened. if the magnitude of the phase error is less than sjw, phase_seg2 is shortened by the magnitude of the phase error, else it is shortened by sjw. when the magnitude of the phase error of the edge is less than or equal to the programmed value of sjw, the results of hard synchronization and re-synchronization are the same. if the magnitude of the phase error is larger than sjw, the re-synchronization cannot compensate the phase error completely, an error (phase error - sjw) remains. only one synchronization may be done between two sample points. the synchronizations maintain a minimum distance between edges and sample points, giving the bus level time to stabilize and filtering out spikes that are shorter than (prop_seg + phase_seg1). apart from noise spikes, most synchronizations are caused by arbitration. all nodes synchronize ?hard? on the edge transmitted by the ?leading? transceiver that started transmitting first, but due to propagation delay times, they cannot become ideally synchronized. the ?leading? transmitter does not necessarily win the arbitration, therefore the receivers have to synchronize themselves to different transmitters that subsequently ?take the lead? and that are differently synchronized to the previously ?leading? transmitter. the same happens at the acknowledge field, where the transmitter and some of the receivers will have to synchronize to that receiver that ?takes the lead? in the transmission of the dominant acknowledge bit. synchronizations after the end of the arbitration will be caused by oscillator tolerance, when the differences in the oscillator?s clock periods of transmitter and receivers sum up during the time between synchronizations (at most ten bits). these summarized differences may not be longer than the sjw, limiting the oscillator?s tolerance range. the examples in figure 37 show how the phase buffer segments are used to compensate for phase errors. there are three drawings of each two consecutive bit timings. the upper drawing shows the synchronization on a ?late? edge, the lower drawing shows the synchronization on an ?early? edge, and the middle drawing is the reference without synchronization. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 254/401 in the first example, an edge from recessive to dominant occurs at the end of prop_seg. the edge is ?late? since it occurs after the sync_s eg. reacting to the ?late? edge, phase_seg1 is lengthened so that the distance from the edge to the sample point is the same as it would have been from the sync_seg to the sample point if no edge had occurred. the phase error of this ?late? edge is less than sjw, so it is fully compensated and the edge from dominant to recessive at the end of the bit, which is one nominal bit time long, occurs in the sync_seg. in the second example, an edge from recessive to dominant occurs during phase_seg2. the edge is ? early ? since it occurs before a sync_seg. reacting to the ? early ? edge, phase_seg2 is shortened and sync_seg is omitted, so that the distance from the edge to the sample point is the same as it would have been from an sync_seg to the sample point if no edge had occurred. as in the previous example, the magnitude of phase error of this ? early ? edge?s is less than sjw, so it is fully compensated. the phase buffer segments are lengthened or shortened temporarily only; at the next bit time, the segments return to their nominal programmed values. in these examples, the bit timing is seen from the point of view of the can state machine, where the bit time starts and ends at the sample points. the state machine omits sync_seg when synchronizing on an ?early? edge, because it cannot subsequently redefine that time quantum of phase_seg2 where the edge occurs to be the sync_seg. figure 37. synchronization on ?late? and ?early? edges recessive dominant recessive dominant sync_seg prop_seg phase_seg1 phase_seg2 ?late? edge ?early? edge rx-input rx-input sample-point sample-point sample-point sample-point sample-point sample-point 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 255/401 the examples in figure 38 show how short dominant noise spikes are filtered by synchronizations. in both examples the spike starts at the end of prop_seg and has the length of ?prop_seg + phase_seg1?. in the first example, the synchronization jump width is greater than or equal to the phase error of the spike?s edge from recessive to dominant. therefore the sample point is shifted after the end of the spike; a recessive bus level is sampled. in the second example, sjw is shorter than the phase error, so the sample point cannot be shifted far enough; the dominant spike is sampled as actual bus level. figure 38. filtering of short dominant spikes recessive dominant sync_seg prop_seg phase_seg1 phase_seg2 spike rx-input sample-point sample-point sample-point sample-point recessive dominant spike rx-input sjw phase error sjw < phase error 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 256/401 18.7.10.4 oscillator tolerance range the oscillator tolerance range was increase d when the can protocol was developed from version 1.1 to version 1.2 (version 1.0 was never implemented in silicon). the option to synchronize on edges from dominant to recessive became obsolete, only edges from recessive to dominant are considered for synchronization. the only can controllers to implement protocol version 1.1 have been intel 82526 and philips 82c200, both are superseded by successor products. the protocol update to version 2.0 (a and b) had no influence on the oscillator tolerance. the tolerance range df for an oscillator frequency f osc around the nominal frequency f nom is: it depends on the proportions of phase_seg1, phase_seg2, sjw, and the bit time. the maximum tolerance df is the defined by two conditions (both shall be met): it has to be considered that sjw may not be larger than the smaller of the phase buffer segments and that the propagation time segment limits that part of the bit time that may be used for the phase buffer segments. the combination prop_seg = 1 and phase_seg1 = phase_seg2 = sjw = 4 allows the largest possible oscillator tolerance of 1.58%. this combination with a propagation time segment of only 10% of the bit time is not suitable for short bit times; it can be used for bit rates of up to 125 kbit/s (bit time = 8 s) with a bus length of 40 m. 1df ? () f nom ? f osc 1df + () f nom ? ? i: df min phase_seg1 phase_seg2 , () 2 13 bit_time phase_seg2 ? ? () ? -------------------------------------------------------------------------------------- - ii: df sjw 20 bit_time ? ------------------------------- - 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 257/401 18.7.10.5 configuring the can protocol controller in most can implementations and also in the can peripheral, the bit timing configuration is programmed in two register bytes. the sum of prop_seg and phase_seg1 (as tseg1) is combined with phase_seg2 (as tseg2) in one byte, sjw and brp are combined in the other byte (see figure 39 on page 257 ). in these bit timing registers, the four components tseg1, tseg2, sjw, and brp have to be programmed to a numerical value that is one less than its functional value. therefore, instead of values in the range of [1..n], values in the range of [0..n-1] are programmed. that way, e.g. sjw (functional range of [1..4]) is represented by only two bits. therefore the length of the bit time is (programmed values) [tseg1 + tseg2 + 3] t q or (functional values) [sync_seg + pr op_seg + phase_seg1 + phase_seg2] t q . the data in the bit timing registers is the co nfiguration input of the can protocol controller. the baud rate prescaler (configured by brp) defines the length of the time quantum, the basic time unit of the bit time; the bit timi ng logic (configured by tseg1, tseg2, and sjw) defines the number of time quanta in the bit time. the processing of the bit time, the calculation of the position of the sample point, and occasional synchronizations are controlled by the btl state machine, which is evaluated once figure 39. structure of the can core?s can protocol controller sample_point bit_to_send sync_mode bus_off scaled_clock (tq) system clock receive_data transmit_data control received_message send_message status bit timing logic baudrate_ prescaler sampled_bit configuration (tseg1, tseg2, sjw) configuration (brp) shift-register received_data_bit next_data_bit control bit stream processor ipt 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 258/401 each time quantum. the rest of the can protocol cont roller, the bsp state machine is evaluated once each bit time, at the sample point. the shift register sends the messages serially and receives the messages parallely. its loading and shifting is controlled by the bsp. the bsp translates messages into frames an d vice versa. it generates and discards the enclosing fixed format bits, inserts and extracts stuff bits, calculates and checks the crc code, performs the error management, and decides which type of synchronization is to be used. it is evaluated at the sample point and processes the sampled bus input bit. the time that is needed to calculate the next bit to be sent after the sample point(e.g. data bit, crc bit, stuff bit, error flag, or idle) is called the information processing time (ipt). the ipt is application specific but may not be longer than 2 t q ; the ipt for the can peripheral is 0 t q . its length is the lower limit of the programmed length of phase_seg2. in case of a synchronization, phase_seg2 may be shortened to a value less than ipt, which does not affect bus timing. 18.7.10.6 calculating bit timing parameters usually, the calculation of the bit timing configuration starts with a desired bit rate or bit time. the resulting bit time (1/bit rate) must be an integer multiple of the system clock period. the bit time may consist of 4 to 25 time quanta, the length of the time quantum t q is defined by the baud rate prescaler with t q = (baud rate prescaler)/f sys . several combinations may lead to the desired bit time, allowing iterations of the following steps. first part of the bit time to be defined is the prop_seg. its length depends on the delay times measured in the system. a maximum bus length as well as a maximum node delay has to be defined for expandible can bus systems. the resulting time for prop_seg is converted into time quanta (rounded up to the nearest integer multiple of t q ). the sync_seg is 1 t q long (fixed), leaving (bit time ? prop_seg ? 1) t q for the two phase buffer segments. if the number of remaining t q is even, the phase buffer segments have the same length, phase_seg2 = phase_seg1, else phase_seg2 = phase_seg1 + 1. the minimum nominal length of phase_seg2 has to be regarded as well. phase_seg2 may not be shorter than the ipt of the can controller, which, depending on the actual implementation, is in the range of [0..2] t q . the length of the synchronization jump width is set to its maximum value, which is the minimum of 4 and phase_seg1. the oscillator tolerance range necessary for the resulting configuration is calculated by the formulas given in section 18.7.10.4: oscillator tolerance range on page 256 if more than one configuration is possible, that configuration allowing the highest oscillator tolerance range should be chosen. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 259/401 can nodes with different system clocks requir e different configurations to come to the same bit rate. the calculation of the propagation time in the can network, based on the nodes with the longest delay times, is done once for the whole network. the oscillator tolerance range of the can systems is limited by that node with the lowest tolerance range. the calculation may show that bus length or bit rate have to be decreased or that the stability of the oscillator frequency has to be increa sed in order to find a protocol compliant configuration of the can bit timing. the resulting configuration is wri tten into the bit timing register: (phase_seg2-1)&(phase_seg1+prop_seg-1)& (synchronisationjumpwidth-1)&(prescaler-1) example for bit timing at high baudrate in this example, the frequency of apb_clk is 10 mhz, brp is 0, the bit rate is 1 mbit/s. t q 100 ns = t apb_clk delay of bus driver 50 ns delay of receiver circuit 30 ns delay of bus line (40m) 220 ns t prop 600 ns = 6  t q t sjw 100 ns = 1  t q t tseg1 700 ns = t prop + t sjw t tseg2 200 ns = information processing time + 1  t q t sync-seg 100 ns = 1  t q bit time 1000 ns = t sync-seg + t tseg1 + t tseg2 tolerance for apb_clk 0.39 % = = min pb 1 pb 2 , () 2 x 13 x bit time pb2 ? () () --------------------------------------------------------------- 0.1 s 2 x 13 x 1 s 0.2 s ? () () ---------------------------------------------------------- - 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 260/401 in this example, the concatenated bit time parameters are (2-1) 3 &(7-1) 4 &(1-1) 2 &(1-1) 6 , the bit timing register is programmed to= 0x1600. example for bit timing at low baudrate in this example, the frequency of apb_clk is 2 mhz, brp is 1, the bit rate is 100 kbit/s. in this example, the concatenated bit time parameters are (4-1) 3 &(5-1) 4 &(4-1) 2 &(2-1) 6 , the bit timing register is programmed to= 0x34c1. t q 1 s= 2t apb_clk delay of bus driver 200 ns delay of receiver circuit 80 ns delay of bus line (40m) 220 ns t prop 1 s= 1t q t sjw 4 s= 4t q t tseg1 5 s= t prop + t sjw t tseg2 4 s = information processing time + 3  t q t sync-seg 1 s= 1t q bit time 10 s= t sync-seg + t tseg1 + t tseg2 tolerance for apb_clk 1.58 % = = min pb 1 pb 2 , () 2 x 13 x bit time pb2 ? () () --------------------------------------------------------------- 4 s 2 x 13 x 10 s 4 s ? () () --------------------------------------------------------- - 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 261/401 18.7.11 register map a summary of the can peripheral registers is given in the following table. refer to table 20 on page 49 for the base address.. table 57. can register map addr offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00h can_cr reserved test cce dar res eie sie ie init 04h can_sr reserved boff ewarn epass rxok txok lec 08h can_err rp rec6-0 tec7-0 0ch can_btr res tseg2 tseg1 sjw brp 10h can_idr intid15-8 intid7-0 14h can_testr reserved rx tx1 tx0 lback silent basic reserved 18h can_brpr reserved brpe 20h can_if1_crr busy reserved message number 24h can_if1_cmr reserved wr/rd mask arb control clrintpnd txrqst/ data a data b 28h can_if1_m1r msk15-0 2ch can_if1_m2r mxtd mdir res msk28-16 30h can_if1_a1r id15-0 34h can_if1_a2r msg val xtd dir id28-16 38h can_if1_mcr newdat msglst intpnd umask txie rxie rmten txrqst eob reserved dlc3-0 3ch can_if1_da1r data(1) data(0) 40h can_if1_da2r data(3) data(2) 44h can_if1_db1r data(5) data(4) 48h can_if1_db2r data(7) data(6) 80h can_if2_crr busy reserved message number 1 .com .com .com .com .com 4 .com u datasheet
STR720 - controller area network (can) 262/401 84h can_if2_cmr reserved wr/rd mask arb control clrintpnd txrqst/ data a data b 88h can_if2_m1r msk15-0 8ch can_if2_m2r mxtd mdir res msk28-16 90h can_if2_a1r id15-0 94h can_if2_a2r msg val xtd dir id28-16 98h can_if2_mcr newdat msglst intpnd umask txie rxie rmten txrqst eob reserved dlc3-0 9ch can_if2_da1r data(1) data(0) a0h can_if2_da2r data(3) data(2) a4h can_if2_db1r data(5) data(4) a8h can_if2_db2r data(7) data(6) 100h can_txr1r txrqst16-1 104h can_txr2r txrqst32-17 120h can_nd1r newdat16-1 124h can_nd2r newdat32-17 140h can_ip1r intpnd16-1 144h can_ip2r intpnd32-17 160h can_mv1r msgval16-1 164h can_mv2r msgval32-17 table 57. can register map addr offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 263/401 19 usb slave interface (usb) 19.1 introduction the usb peripheral implements an interface between a full-speed usb 2.0 bus and the apb bus. usb suspend/resume are supported which allows to stop the device clocks for low power consumption. 19.2 main features  configurable number of endpoints from 1 to 8.  cyclic redundancy check (crc) generation/checking, non-return-to-zero inverted (nrzi) encoding/decoding and bit-stuffing.  isochronous transfers support.  double-buffered bulk endpoint support.  usb suspend/resume operations.  frame locked clock pulse generation. 19.3 block diagram figure 40 shows the block diagram of the usb peripheral. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 264/401 figure 40. usb peripheral block diagram arbiter packet buffer memory register mapper interrupt mapper apb wrapper suspend timer packet buffer interface usb rx-tx clock recovery control endpoint selection s.i.e. control registers & logic interrupt registers & logic analog endpoint registers d+ d- transceiver endpoint registers pclk apb bus irqs to eic usb clock pclk apb interface 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 265/401 19.4 functional description the usb peripheral provides an usb compliant connection between the host pc and the function implemented by the microcontroller. data transfer between the host pc and the system memory occurs through a dedicated packet buffer memory accessed directly by the usb peripheral. the size of this dedicated buffer memory must be according to the number of endpoints used and the maximum packet size. in this implementation, the dedicated memory of 512 byte and up to 8 endpoints can be used. the usb peripheral interfaces with the usb host, detecting token packets, handling data transmission/reception, and processing handshake packets as required by the usb standard. transaction formatting is performed by the hardware, including crc generation and checking. each endpoint is associated with a buffer description block indicating where the endpoint related memory area is located, how large it is or how many bytes must be transmitted. when a token for a valid function/endpoint pair is recognized by the usb peripheral, the related data transfer (if required and if the endpoint is configured) takes place. the data buffered by the usb peripheral is loaded in an internal 16 bit register and memory access to the dedicated buffer is performed. when all the data has been transferred, if needed, the proper handshake packet over the usb is generated or expected according to the direction of the transfer. at the end of the transaction, an endpoint-specific interrupt is generated, reading status registers and/or using different interrupt re sponse routines. the microcontroller can determine:  which endpoint has to be served  which type of transaction took place, if errors occurred (bit stuffing, format, crc, protocol, missing ack, over/underrun, etc). two interrupt lines are generated by the usb peripheral : one irq collecting high priority endpoint interrupts (isochronous and double-buffered bulk) and another irq collecting all other interrupt sources (check the irq interrupt vector table for detailed interrupt source mapping). special support is offered to isochronous transfers and high throughput bulk transfers, implementing a double buffer usage, which allows to always have an available buffer for the usb peripheral while the microcontroller uses the other one. the unit can be placed in low-power mode (suspend mode), by writing in the control register, whenever required. at this time, all static power dissipation is avoided, and the usb clock can be slowed down or stopped. the detec tion of activity at the usb inputs, while in low-power mode, wakes the device up asynchronously. a special interrupt source can be connected directly to a wake-up line to allow the system to immediately restart the normal clock generation and/or support direct clock start/stop. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 266/401 19.4.1 description of usb blocks the usb peripheral implements all the features related to usb interfacing, which include the following blocks:  serial interface engine (sie): the functions of this block include: synchronization pattern recognition, bit-stuffing, crc generation and checking, pid verification/generation, and handshake evaluation. it must interface with the usb transceivers and uses the virtual buffers provided by the packet buffer interface for local data storage,. this unit also generates signals according to usb peripheral events, such as start of frame (sof), usb_reset, data errors etc. and to endpoint related events like end of transmission or correct reception of a packet; these signals are then used to generate interrupts.  suspend timer: this block generates the frame locked clock pulse for any external device requiring start-of-frame synchronization and it detects a global suspend (from the host) when no traffic has been received for 3 ms.  packet buffer interface: this block manages the local memory implementing a set of buffers in a flexible way, both for transmission and reception. it can choose the proper buffer according to requests coming from the sie and locate them in the memory addresses pointed by the endpoint registers. it increments the address after each exchanged word until the end of packet, keeping track of the number of exchanged bytes and preventing the buffer to overrun the maximum capacity.  endpoint-related registers: each endpoint has an associated register containing the endpoint type and its current status. for mono-directional/single-buffer endpoints, a single register can be used to implement two distinct endpoints. in this implementation, the number of registers is 8, allowing up to 8 double-buffer endpoints or up to 16 mono-directional/single-buffer ones in any combination.  control registers: these are the register s containing information about the status of the whole usb peripheral and used to force some usb events, such as resume and power-down.  interrupt registers: these contain the interrupt masks and a record of the events. they can be used to inquire an interrupt reason, the interrupt status or to clear the status of a pending interrupt. the usb peripheral is connected to the apb bus through an apb interface, containing the following blocks:  packet memory: this is the local memory that physically contains the packet buffers. it can be used by the packet buffer interface, which creates the data structure and can be accessed directly by the application software. the size of the packet memory is 512 bytes, structured as 256 words by 16 bits.  arbiter: this block accepts memory reques ts coming from the apb bus and from the usb interface. it resolves the conflicts by giving priority to apb accesses, while always reserving half of the memory bandwidth to complete all usb transfers. this time-duplex 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 267/401 scheme implements a virtual dual-port ram that allows memory access, while an usb transaction is happening. multi-word apb transfers of any length are also allowed by this scheme.  register mapper: this block collects the various byte-wide and bit-wide registers of the usb peripheral in a structured 16-bit wide word set addressed by the apb.  interrupt mapper: this block is used to select how the possible usb events can generate interrupts and map them to irq lines of the eic.  apb wrapper: this provides an interface to the apb for the memory and register. it also maps the whole usb peripheral in the apb address space. 19.5 programming considerations in the following sections, the expected interactions between the usb peripheral and the application program are described, in order to ease application software development. 19.5.1 generic usb device programming this part describes the main tasks required of the application software in order to obtain usb compliant behaviour. the actions related to the most general usb events are taken into account and paragraphs are dedicated to the special cases of double-buffered endpoints and isochronous transfers. apart from system res et, action is always initiated by the usb peripheral, driven by one of the usb events described below. 19.5.2 system and power-on reset upon system and power-on reset, the first operation the application software should perform is to provide all required clock signals to the usb peripheral and subsequently de-assert its reset signal so to be able to access its registers. the whole initialization sequence is hereafter described. as a first step application software needs to activate register macrocell clock and de-assert macrocell specific reset signal using relate d control bits provided by device clock management logic. after that the analog part of the device related to the usb transceiver must be switched on using the pdwn bit in cntr register which requ ires a special handling. this bit is intended to switch on the internal voltage references supp lying the port transceiver . since this circuits have a defined start-up time, during which the behaviour of usb transceiver is not defined, it is necessary to wait this time, after having set the pdwn bit in cntr register, then the reset condition on the usb part can be removed (clearing of fres bit in cntr register) and the istr register can be cleared, removing any spurious pending interrupt, before enabling any other macrocell operation. as a last step the usb specific 48 mhz clock needs to be activated, using the related control bits provided by device clock management logic, where applicable. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 268/401 at system reset, the microcontroller must init ialize all required registers and the packet buffer description table, to make the usb peripheral able to properly generate interrupts and data transfers. all registers not specific to any endpo int must be initialized according to the needs of application software (choice of enabled interrupts, chosen address of packet buffers, etc.). then the process continues as for the usb reset case (see further paragraph). 19.5.2.1 usb reset (reset interrupt) when this event occurs, the usb peripheral is put in the same conditions it is left by the system reset after the initialization described in the previous paragraph: the usb_daddr register is reset, and communication is disabled in all endpoint registers (the usb peripheral will not respond to any packet). as a response to the usb reset event, the usb function must be enabled, having as usb address 0, implementing only the default control endpoint (endpoint address is 0 too). this is accomplished by setting the enable function (ef) bit of the usb_daddr register and initializing the ep0r register and its related packet buffers accordingly. during usb enumeration process, the host assigns a unique address to this device, which must be written in the add[6:0] bits of the usb_daddr register, and configures any other necessary endpoint. when a reset interrupt is received, the application software is responsible to enable again the default endpoint of usb function 0 within 10ms from the end of reset sequence which triggered the interrupt. 19.5.2.2 structure and usage of packet buffers each bidirectional endpoint may receive or transmit data from/to the host. the received data is stored in a dedicated memory buffer reserved for that endpoint, while another memory buffer contains the data to be transmitted by the endpoint. access to this memory is performed by the packet buffer interface block, which delivers a memory access request and waits for its acknowledgement. since the packet buffer memory has to be accessed by the microcontroller also, an arbitration logic takes ca re of the access conflicts, using half apb cycle for microcontroller access and the remaining half for the usb peripheral access. in this way, both the agents can operate as if the packet memory is a dual-port ram, without being aware of any conflict even when the microcon troller is performing back-to-back accesses. the usb peripheral logic uses a dedicated clock. th e frequency of this dedicated clock is fixed by the requirements of the usb standard at 48 mhz, and this can be different from the clock used for the interface to the apb bus. different clock configurations are possible where the apb clock frequency can be higher or lower th an the usb peripheral one. however, due to usb data rate and packet memory interface requirements, the apb clock frequency must be greater than 8 mhz to avoid data overrun/underrun problems. each endpoint is associated with two packet buffers (usually one for transmission and the other one for reception). the size of the buffer can be upto 512 words each. buffers can be placed anywhere inside the packet memory because their location and size is specified in a buffer description table, which is also located in the packet memory at the address indicated by the usb_btable register. each table entry is associated to an endpoint register and it is composed of four 16-bit words so that table start address must always be aligned to an 8-byte 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 269/401 boundary (the lowest three bits of usb_btable re gister are always ?000?). buffer descriptor table entries are described in the section ?buffer descriptor table? . if an endpoint is unidirectional and it is neither an isochronous nor a double-buffered bulk, only one packet buffer is required (the one related to the supported transfer direction). other table locations related to unsupported transfer directions or unused endpoints, are available to the user. isochronous and double-buffered bulk endpoints have special handling of packet buffers (refer to ?isochronous transfers? and ?double-buffered endpoints? respectively). the relationship between buffer description table entries and packet buffer areas is depicted in figure 41 . figure 41. packet buffer areas and buffer description table locations addr0_tx count0_tx 0000_0000 (00) addr0_rx count0_rx addr1_tx count1_tx addr1_rx count1_rx addr2_tx count2_tx addr2_rx count2_rx addr3_tx count3_tx 0000_0010 (02) 0000_0100 (04) 0000_0110 (06) 0000_1000 (08) 0000_1010 (0a) 0000_1100 (0c) 0000_1110 (0e) 0001_0000 (10) 0001_0010 (12) 0001_0100 (14) 0001_0110 (16) 0001_1000 (18) 0001_1010 (1a) buffer description table locations transmission buffer for endpoint 0 reception buffer for endpoint 0 transmission buffer for endpoint 1 packet buffers 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 270/401 each packet buffer is used either during reception or transmission starting from the bottom. the usb peripheral will never change the contents of memory locations adjacent to the allocated memory buffers; if a packet bigger than the allocated buffer length is received (buffer overrun condition) the data will be copied to the memory only up to the last available location. 19.5.2.3 endpoint initialization the first step to initialize an endpoint is to write appropriate values to the addrn_tx/ addrn_rx registers so that the usb peripheral finds the data to be transmitted already available and the data to be received can be buffered. the ep_type bits in the usb_epnr register must be set according to the endpoint type, eventually using the ep_kind bit to enable any special required feature. on the transmit side, the endpoint must be enabled using the stat_tx bits in the usb_epnr register and countn_tx must be initialized. for reception, stat_rx bits must be set to enable reception and countn_rx must be written with the allocated buffer size using the bl_size and num_block fields. unidirectional endpoints, except isochronous and double-buffere d bulk endpoints, need to initialize only bits and registers related to the supported direction. once the transmission and/or reception are enabled, register usb_epnr and locations addrn_tx/addrn_rx, countn_tx/ countn_rx (respectively), should not be modi fied by the application software, as the hardware can change their value on the fly. when the data transfer operation is completed, notified by a ctr interrupt event, they can be accessed again to re-enable a new operation. 19.5.2.4 in packets (data transmission) when receiving an in token packet, if the received address matches a configured and valid endpoint one, the usb peripheral accesses the contents of addrn_tx and countn_tx locations inside buffer descriptor table entry related to the addressed endpoint. the content of these locations is stored in its internal 16 bit registers addr and count (not accessible by software). the packet memory is accessed again to read the first word to be transmitted (refer to section ?structure and usage of packet buffers? ) and starts sending a data0 or data1 pid according to usb_epnr bit dtog_tx. when the pid is completed, the first byte from the word, read from buffer memory, is loaded into the output shift register to be transmitted on the usb bus. after the last data byte is transmitted, the computed crc is sent. if the addressed endpoint is not valid, a nak or stall handshake packet is sent instead of the data packet, according to stat_tx bits in the usb_epnr register. the addr internal register is used as a pointe r to the current buffer memory location while count is used to count the number of remaining bytes to be transmitted. each word read from the packet buffer memory is transmitted over the usb bus starting from the least significant byte. transmission buffer memory is read starting from the address pointed by addrn_tx for countn_tx/2 words. if a transmitted packet is composed of an odd number of bytes, only the lower half of the last word accessed will be used. on receiving the ack receipt by the host, the usb_epnr register is updated in the following way: dtog_tx bit is toggled, the endpoint is made invalid by setting stat_tx=10 (nak) and bit ctr_tx is set. the application software must first identify the endpoint, which is 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 271/401 requesting microcontroller attention by examining the ep_id and dir bits in the usb_istr register. servicing of the ctr_tx event starts clearing the interrupt bit; the application software then prepares another buffer full of data to be sent, updates the countn_tx table location with the number of byte to be transmitted during the next transfer, and finally sets stat_tx to ?11? (valid) to re-enable transmis sions. while the stat_tx bits are equal to ?10? (nak), any in request addressed to that en dpoint is naked, indicating a flow control condition: the usb host will retry the transaction until it succeeds. it is mandatory to execute the sequence of operations in the above mentioned order to avoid losing the notification of a second in transaction addressed to the same endpoint immediately following the one which triggered the ctr interrupt. 19.5.2.5 out and setup packets (data reception) these two tokens are handled by the usb peripheral more or less in the same way; the differences in the handling of setup packets are detailed in the following paragraph about control transfers. when receiving an out/setup pid, if the address matches a valid endpoint, the usb peripheral accesses the contents of the addrn_rx and countn_rx locations inside the buffer descriptor table entry related to the addressed endpoint. the content of the addrn_rx is stored directly in its internal register addr. while count is now reset and the values of bl_size and num_block bit field s, which are read within countn_rx content are used to initialize buf_count, an internal 16 bit counter, which is used to check the buffer overrun condition (all these internal registers are not accessible by software). data bytes subsequently received by the usb peripheral are packed in words (the first byte received is stored as least significant byte) and then transferred to the packet buffer starting from the address contained in the internal addr register while buf_count is decremented and count is incremented at each byte transfer. when the end of data packet is detected, the correctness of the received crc is tested and only if no errors occurred during the reception, an ack handshake packet is sent back to the transmitting host. in case of wrong crc or other kinds of errors (bit-stuff violations, frame errors, etc.), data bytes are anyways copied in the packet memory buffer, at least until the error detection point, but ack packet is not sent and the err bit in usb_istr register is set. however, there is usually no software action required in this case: the usb peripheral recovers from reception errors and remains ready for the next transaction to come. if the addressed endpoint is not valid, a nak or stall handshake packet is sent instead of the ack, according to bits stat_rx in the usb_epnr register and no data is written in the reception memory buffers. reception memory buffer locations are written starting from the address contained in the addrn_rx for a number of bytes corresponding to the received data packet length, crc included (i.e. data payload length + 2), or up to the last allocated memory location, as defined by bl_size and num_block, whichever comes first. in this way, the usb peripheral never writes beyond the end of the allocated reception memory buffer area. if the length of the data packet payload (actual number of bytes used by the application) is greater than the allocated buffer, the usb peripheral detects a buffer overrun condition. in this case, a stall handshake is sent instead of the usual ack to notify the problem to the host, no interrupt is generated and the transaction is considered failed. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 272/401 when the transaction is completed correctly, by sending the ack handshake packet, the internal count register is copied back in the countn_rx location inside the buffer description table entry, leaving unaffected bl_size and num_block fields, which normally do not require to be re-written, and the usb_epnr register is updated in the following way: dtog_rx bit is toggled, the endpoint is made in valid by setting stat_rx = ?10? (nak) and bit ctr_rx is set. if the transaction has failed due to errors or buffer overrun condition, none of the previously listed actions take place. the application software mu st first identify the endpoint, which is requesting microcontroller attention by examining the ep_id and dir bits in the usb_istr register. the ctr_rx event is serviced by first determining the transaction type (setup bit in the usb_epnr register); the application software must clear the interrupt flag bit and get the number of received bytes reading the countn_rx location inside the buffer description table entry related to the endpoint being processed. after the received data is processed, the application software should set the stat_rx bits to ?11? (valid) in the usb_epnr, enabling further transactions. while the stat_rx bits are equal to ?10? (nak), any out request addressed to that endpoint is naked, indicating a flow control condition: the usb host will retry the transaction until it succeeds. it is mandatory to execute the sequence of operations in the above mentioned order to avoid losing the notification of a second out transaction addressed to the same endpoint following immediately the one which triggered the ctr interrupt. 19.5.2.6 control transfers control transfers are made of a setup transaction, followed by zero or more data stages, all of the same direction, followed by a status stage (a zero-byte transfer in the opposite direction). setup transactions are handled by control endpoints only and are very similar to out ones (data reception) except that the values of dtog_tx and dtog_rx bits of the addressed endpoint registers are set to 1 and 0 respectively, to initialize the control transfer, and both stat_tx and stat_rx are set to ?10? (nak) to let software decide if subsequent transactions must be in or out depending on the setup contents. a control endpoint must check setup bit in the usb_epnr register at each ctr_rx event to distinguish normal out transactions from setup ones. a usb device can determine the number and direction of data stages by interpreting the data transferred in the setup stage, and is required to stall the transaction in the case of errors. to do so, at all data stages before the last, the unused direction should be set to stall, so that, if the host reverses the transfer direction too soon, it gets a stall as a status stage. while enabling the last data stage, the opposite direction should be set to nak, so that, if the host reverses the transfer direction (to perform the status stage) immediately, it is kept waiting for the completion of the control operation. if the control operation completes successfully, the software will change nak to valid, otherwise to stall. at the same time, if the status stage will be an out, the status_out (ep_kind in the usb_epnr register) bit should be set, so that an error is generated if a status transaction is performed with not-zero data. when the status transaction is serviced, the application clears the status_out bit and sets stat_rx to valid (to accept a new command) and stat_tx to nak (to delay a possible status stage immediately following the next setup). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 273/401 since the usb specification states that a setup packet cannot be answered with a handshake different from ack, eventually aborting a previously issued command to start the new one, the usb logic doesn?t allow a control endpoint to answer with a nak or stall packet to a setup token received from the host. when the stat_rx bits are set to ?01? (stall) or ?10? (nak) and a setup token is received, the usb accepts the data, performing the required data transfers and sends back an ack handshake. if that endpoint has a previously issued ctr_rx request not yet acknowledged by the application (i.e. ctr_rx bit is still s et from a previously completed reception), the usb discards the setup transaction and does not answer with any handshake packet regardless of its state, simulating a reception error and forcing the host to send the setup token again. this is done to avoid losing the notificati on of a setup transaction addressed to the same endpoint immediately following the transaction, which triggered the ctr_rx interrupt. 19.5.3 double-buffered endpoints all different endpoint types defined by the usb standard represent different traffic models, and describe the typical requirements of different kind of data transfer operations. when large portions of data are to be transferred between the host pc and the usb function, the bulk endpoint type is the most suited model. this is because the host schedules bulk transactions so as to fill all the available bandwidth in the frame, maximizing the actual transfer rate as long as the usb function is ready to handle a bulk transaction addressed to it. if the usb function is still busy with the previous transaction when the next one arrives, it will answer with a nak handshake and the host pc will issue the same transaction again until the usb function is ready to handle it, reducing the actual transfer rate due to the bandwidth occupied by re-transmissions. for this reason, a dedicated feature called ?double-buffering? can be used with bulk endpoints. when ?double-buffering? is activated, data toggl e sequencing is used to select, which buffer is to be used by the usb peripheral to perform the required data transfers, using both ?transmission? and ?reception? packet memory areas to manage buffer swapping on each successful transaction in order to always have a complete buffer to be used by the application, while the usb peripheral fills the other one. for example, during an out transaction directed to a ?reception? double-buffered bulk endpoint, while one buffer is being filled with new data coming from the usb host, the other one is av ailable for the microcontroller software usage (the same would happen with a ?transmission? double-buffered bulk endpoint and an in transaction). since the swapped buffer management requires the usage of all 4 buffer description table locations hosting the address pointer and the length of the allocated memory buffers, the usb_epnr registers used to implement double-buffered bulk endpoints are forced to be used as uni-directional ones. therefore, only one stat bit pair must be set at a value different from ?00? (disabled): stat_rx if the double-buff ered bulk endpoint is enabled for reception, stat_tx if the double-buffered bulk endpoint is enabled for transmission. in case it is required to have double-buffered bulk endpoints enabled both for reception and transmission, two usb_epnr registers must be used. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 274/401 to exploit the double-buffering feature and reach the highest possible transfer rate, the endpoint flow control structure, described in pr evious chapters, has to be modified, in order to switch the endpoint status to nak only when a buffer conflict occurs between the usb peripheral and application software, instead of doing it at the end of each successful transaction. the memory buffer which is currently being used by the usb peripheral is defined by the dtog bit related to the endpoint direction: dtog_rx (bit 14 of usb_epnr register) for ?reception? double-buffered bulk endpoints or dtog_tx (bit 6 of usb_epnr register) for ?transmission? double-buffered bulk endpoints. to implement the new flow control scheme, the usb peripheral should know which packet buffer is currently in use by the application software, so to be aware of any conflict. since in the usb_epnr register, there are two dtog bits but only one is used by usb peripheral for data and buffer sequencing (due to the uni-directional constraint required by double-buffering feature) the other one can be used by the application software to show which buffer it is currently using. this new buffer flag is called sw_buf. in the following table the correspondence between usb_epnr register bits and dtog/sw_buf definition is explained, for the cases of ?transmission? and ?reception? double-buffered bulk endpoints. the memory buffer which is currently being used by the usb peripheral is defined by dtog buffer flag, while the buffer currently in use by application software is identified by sw_buf buffer flag. the relationship between the buffer flag value and the used packet buffer is the same in both cases, and it is listed in the following table. table 58. double-buffering buffer flag definition buffer flag ?transmission? endpoint ?reception? endpoint dtog dtog_tx (usb_epnr bit 6) dtog_rx (usb_epnr bit 14) sw_buf usb_epnr bit 14 usb_epnr bit 6 table 59. double-buffering memory buffers usage dtog or sw_buf bit value packet buffer used by usb peripheral (dtog) or application software (sw_buf) 0 addrn_tx / countn_tx buffer description table locations. 1 addrn_rx / countn_rx buffer description table locations. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 275/401 double-buffering feature for a bulk endpoint is activated by:  writing ep_type bit field at ?00? in its u sb_epnr register, to define the endpoint as a bulk, and  setting ep_kind bit at ?1? (dbl_buf), in the same register. the application software is responsible for dtog and sw_buf bits initialization according to the first buffer to be used; this has to be done considering the special toggle-only property that these two bits have. the end of the first transaction occurring after having set dbl_buf, triggers the special flow control of double-buff ered bulk endpoints, which is used for all other transactions addressed to this endpoint unt il dbl_buf remain set. at the end of each transaction the ctr_rx or ctr_tx bit of the addressed endpoint usb_epnr register is set, depending on the enabled direction. at the same time, the affected dtog bit in the usb_epnr register is hardware toggled making the usb peripheral buffer swapping completely software independent. unlike common transactions, and the first one after dbl_buf setting, stat bit pair is not affected by the transaction termination and its value remains ?11? (valid). however, as the token packet of a new transaction is received, the actual endpoint status will be masked as ?10? (nak) when a buffer conflict between the usb peripheral and the application software is detected (this condition is identified by dtog and sw_buf having the same value). the application software responds to the ctr event notification by clearing the interrupt flag and starting any required handling of the completed transaction. when the application packet buffer usage is over, the software toggles the sw_buf bit, writing ?1? to it, to notify the usb pe ripheral about the availability of that buffer. in this way, the number of naked transactions is limited only by the application elaboration time of a transaction data: if the elaboration time is shorter than the time required to complete a transaction on the usb bus, no re-transmissions due to flow control will take place and the actual transfer rate will be limited only by the host pc. the application software can always override the special flow control implemented for double-buffered bulk endpoints, writing an explicit status different from ?11? (valid) into the stat bit pair of the related usb_epnr register. in this case, the usb peripheral will always use the programmed endpoint status, regardless of the buffer usage condition. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 276/401 19.5.4 isochronous transfers the usb standard supports full speed peripherals requiring a fixed and accurate data production/consume frequency, defining this kind of traffic as ?isochronous?. typical examples of this data are: audio samples, compressed video streams, and in general any sort of sampled data having strict requirements for the accuracy of delivered frequency. when an endpoint is defined to be ?isochronous? during the enumeration phase, the host allocates in the frame the required bandwidth and delivers exactly one in or out packet each frame, depending on endpoint direction. to limit the bandwidth requirements, no re-transmission of failed transactions is possible for isochronous traffic; this leads to the fact that an isochronous transaction does not have a handshake phase and no ack packet is expected or sent after the data packet. for the same reason, isochronous transfers do not support data toggle sequencing and always use data0 pid to start any data packet. the isochronous behaviou r for an endpoint is selected by setting the ep_type bits at ?10? in its usb_epnr register; since there is no handshake phase the only legal values for the stat_rx/stat_tx bit pairs are ?00? (disabled) and ?11? (valid), any other value will produce results not compliant to usb standard. isochronous endpoints implement double-buffering to ease application software development, using both ?transmission? and ?reception? packet memory areas to manage buffer swapping on each successful transaction in order to have always a complete buffer to be used by the application, while the usb peripheral fills the other. the memory buffer which is currently used by the usb peripheral is defined by the dtog bit related to the endpoint direction (dtog_rx for ?reception? isochronous endpoints, dtog_tx for ?transmission? isochronous endpoints, both in the related usb_epnr register) according to table 60 . as it happens with double-buffered bulk endpoints, the usb_epnr registers used to implement isochronous endpoints are forced to be used as uni-directional ones. in case it is required to have isochronous endpoints enabled both for reception and transmission, two usb_epnr registers must be used. the application software is responsible for the dtog bit initialization according to the first buffer to be used; this has to be done considering the special toggle-only property that these table 60. isochronous memory buffers usage dtog bit value dma buffer used by usb peripheral dma buffer used by application software 0 addrn_tx / countn_tx buffer description table locations. addrn_rx / countn_rx buffer description table locations. 1 addrn_rx / countn_rx buffer description table locations. addrn_tx / countn_tx buffer description table locations. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 277/401 two bits have. at the end of each transacti on, the ctr_rx or ctr_tx bit of the addressed endpoint usb_epnr register is set, depending on the enabled direction. at the same time, the affected dtog bit in the usb_epnr register is hardware toggled making buffer swapping completely software independent. stat bit pair is not affected by transaction completion; since no flow control is possible for isochr onous transfers due to the lack of handshake phase, the endpoint remains always ?11? (valid). crc errors or buffer-overrun conditions occurring during isochronous out transfers are anyway considered as correct transactions and they always trigger an ctr_rx event. however, crc errors will anyway set the err bit in the usb_istr register to notify the software of the possible data corruption. 19.5.5 suspend/resume events the usb standard defines a special peripheral state, called suspend, in which the average current drawn from the usb bus must not be greater than 500 a. this requirement is of fundamental importance for bus-powered devices, while self-powered devices are not required to comply to this strict power consumption constraint. in suspend mode, the host pc sends the notification to not send any traffic on the usb bus for more than 3ms: since a sof packet must be sent every ms during normal operations, the usb peripheral detects the lack of 3 consecutive sof packets as a suspend request from the host pc and set the susp bit to ?1? in usb_istr register, causing an interrupt if enabled. once the device is suspended, its normal operation can be restored by a so called resume sequence, which can be started from the host pc or directly from the peripheral itself, but it is always terminated by the host pc. the suspended usb peripheral must be anyway able to detect a reset sequence, reacting to this event as a normal usb reset event. the actual procedure used to suspend the usb peripheral is device dependent since according to the device composition, different actions may be required to reduce the total consumption. a brief description of a typical suspend procedure is provided below, focused on the usb- related aspects of the application software rout ine responding to the susp notification of the usb peripheral: 1. set the fsusp bit in the usb_cntr register to 1. this action activates the suspend mode within the usb peripheral. as soon as the suspend mode is activated, the check on sof reception is disabled to avoid any further susp interrupts being issued while the usb is suspended. 2. remove or reduce any static power consumption in blocks different from the usb periph- eral. 3. set lp_mode bit in usb_cntr register to 1 to remove static power consumption in the analog usb transceivers but keeping them able to detect resume activity. 4. optionally turn off external oscillator and device pll to stop any activity inside the device. when an usb event occurs while the device is in suspend mode, the resume procedure must be invoked to restore nominal clocks and regain normal usb behaviour. particular care must be taken to insure that this process does not take more than 10ms when the wakening 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 278/401 event is an usb reset sequence (see ?universal serial bus specification? for more details). the start of a resume or reset sequence, while the usb peripheral is suspended, clears the lp_mode bit in usb_cntr register asynchronously. even if this event can trigger an wkup interrupt if enabled, the use of an interrupt response routine must be carefully evaluated because of the long latency due to system clock restart; to have the shorter latency before re-activating the nominal clock it is suggested to put the resume procedure just after the end of the suspend one, so its code is immediately executed as soon as the system clock restarts. to prevent esd discharges or any other kind of noise from waking-up the system (the exit from suspend mode is an asynchronous event), a suitable analog filter on data line status is activated during suspend; the filter width is about 70ns. the following is a list of actions a resume procedure should address: 1. optionally turn on external oscillator and device pll. 2. clear fsusp bit of usb_cntr register. 3. if the resume triggering event has to be identified, bits rxdp and rxdm in the usb_fnr register can be used according to table 61 , which also lists the intended software action in all the cases. if required, the end of resume or reset sequence can be detected moni- toring the status of the above mentioned bits by checking when they reach the ?10? config- uration, which represent the idle bus state; moreover at the end of a reset sequence the reset bit in usb_istr register is set to 1, issuing an inte rrupt if enabled, which should be handled as usual. a device may require to exit from suspend mode as an answer to particular events not directly related to the usb protocol (e.g. a mouse movement wakes up the whole system). in this case, the resume sequence can be started by setting the resume bit in the usb_cntr register to ?1? and resetting it to 0 after an interval between 1ms and 15ms (this interval can be timed using esof interrupts, occurring with a 1ms period when the system clock is running at nominal frequency). once the resume bit is clear, the resume sequence will be completed by the host pc and its end can be monitored again using the rxdp and rxdm bits in the usb_fnr register. note the resume bit must be anyway used only after the usb peripheral has been put in suspend mode, setting the fsusp bit in usb_cntr register to 1. table 61. resume event detection [rxdp,rxdm] status wake-up event required resume software action ?00? root reset none ?10? none (noise on bus) go back in suspend mode ?01? root resume none ?11? not allowed (noise on bus) go back in suspend mode 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 279/401 19.6 register description the usb peripheral registers can be divided into the following groups:  common registers: interrupt and control registers  endpoint registers: endpoint configuration and status  buffer descriptor table: location of packet memory used to locate data buffers all register addresses are expr essed as offsets with respect to the usb peripheral registers base address 0xc000 8000, except the buffer descriptor table locations, which starts at the address specified by the usb_btable regist er. due to the common limitation of apb bridges on word addressability, all register addresses are aligned to 32-bit word boundaries although they are 16-bit wide. the same address al ignment is used to access packet buffer memory locations, which are located starting from 0xc000 8800. in this section, the following abbreviations are used: read/write (rw) the software can read and write to these bits. read-only (r) the software can only read these bits. write-only (w) the software can only write to these bits. read-clear (rc) the software can only read or clear this bit. toggle (t) the software can only toggle this bit by writing ?1?. writing ?0? has no effect. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 280/401 19.6.1 common registers these registers affect the general behaviour of the usb peripheral defining operating mode, interrupt handling, device address and giving access to the current frame number updated by the host pc. usb control register (usb_cntr) address offset: 40h reset value: 0000 0000 0000 0011 (0003h) 1514131211109876543210 ctrm dovrm errm wkupm suspm resetm sofm esofm reserved resume fsusp lp mode pdwn fres rw rw rw rw rw rw rw rw rw rw rw rw rw bit 15 ctrm: correct transfer interrupt mask 0: correct transfer (ctr) interrupt disabled. 1: ctr interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bit 14 dovrm: dma over / underrun interrupt mask 0: dovr interrupt disabled. 1: dovr interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bit 13 errm: error interrupt mask 0: err interrupt disabled. 1: err interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bit 12 wkupm: wake-up interrupt mask 0: wkup interrupt disabled. 1: wkup interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bit 11 suspm: suspend mode interrupt mask 0: suspend mode request (susp) interrupt disabled. 1: susp interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 281/401 bit 10 resetm: usb reset interrupt mask 0: reset interrupt disabled. 1: reset interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bit 9 sofm: start of frame interrupt mask 0: sof interrupt disabled. 1: sof interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bit 8 esofm: expected start of frame interrupt mask 0: expected start of frame (esof) interrupt disabled. 1: esof interrupt enabled, an interrupt request is generated when the corresponding bit in the usb_istr register is set. bits 7:5 reserved these are reserved bits. these bits are always read as ?0? and must always be written with ?0?. bit 4 resume: resume request the microcontroller can set this bit to send a resume signal to the host. it must be activated, according to usb specifications, for no less than 1ms and no more than 15ms after which the host pc is ready to drive the resume sequence up to its end. bit 3 fsusp: force suspend software must set this bit when the susp interrupt is received, which is issued when no traffic is received by the usb peripheral for 3 ms. 0: no effect. 1: enter suspend mode. clocks and static power dissipation in the analog transceiver are left unaffected. if suspend power consumption is a requirement (bus-powered device), the application software should set the lp_mode bit after fsusp as explained below. bit 2 lp_mode: low-power mode this mode is used when the suspend-mode power constraints require that all static power dissipation is avoided, except the one required to supply the external pull-up resistor. this condition should be entered when the application is ready to stop all system clocks, or reduce their frequency in order to meet the power consumption requirements of the usb suspend condition. the usb activity during the suspend mode (wkup event) asynchronously resets this bit (it can also be reset by software). 0: no low power mode. 1: enter low power mode. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 282/401 bit 1 pdwn: power down this bit is used to completely switch off all usb-related analog parts if it is required to completely disable the usb peripheral for any reason. when this bit is set, the usb peripheral is disconnected from the transceivers and it cannot be used. 0: exit power down. 1: enter power down mode. bit 0 fres: force usb reset 0: clear usb reset. 1: force a reset of the usb peripheral, exactly like a reset signalling on the usb. the usb peripheral is held in r eset state until software clears this bit. a ?usb-reset? interrupt is generated, if enabled. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 283/401 usb interrupt status register (usb_istr) address offset: 44h reset value: 0000 0000 0000 0000 (0000h) this register contains the status of all the interrupt sources allowing application software to determine, which events caused an interrupt request. the upper part of this register contains single bits, each of them representing a specific event. these bits are set by the hardware when the related event occurs; if the corresponding bit in the usb_cntr register is set, a generic interrupt request is generated. the interrupt routine, examining each bit, will perform all necessary action s, and finally it will clear the serviced bits. if any of them is not cleared, the interrupt is considered to be still pending, and the interrupt line will be kept high again. if several bits are set simultaneously, only a single interrupt will be generated. endpoint transaction completion can be handled in a different way to reduce interrupt response latency. the ctr bit is set by the hardware as soon as an endpoint successfully completes a transaction, generating a generic interrupt request if the corresponding bit in usb_cntr is set. an endpoint dedicated interrupt condition is activated independently from the ctrm bit in the usb_cntr register. both interrupt conditions remain active until software clears the pending bit in the corr esponding usb_epnr register (the ctr bit is actually a read only bit). the usb peripheral has two interrupt request lines:  higher priority usb irq: the pending requests for endpoints, which have transactions with a higher priority (isochronous and d ouble-buffered bulk) and they cannot be masked.  lower priority usb irq: all other interru pt conditions, which can either be non-maskable pending requests related to the lower priority transactions and all other maskable events flagged by the usb_istr high bytes. for endpoint-related interrupts, the software can use the direction of transaction (dir) and ep_id read-only bits to identify, which endpoint made the last interrupt request and called the corresponding interrupt service routine. the user can choose the relative priority of simultaneously pending usb_istr events by specifying the order in which software checks usb_istr bits in an interrupt service routine. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ctr dovr err wkup susp reset sof esof reserved dir ep_id[3:0] r rcrcrcrcrcrcrc r r 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 284/401 only the bits related to events, which are serviced, are cleared. at the end of the service routine, another interrupt will be requested, to service the remaining conditions. to avoid spurious clearing of some bits, it is recommended to clear them with a load instruction where all bits which must not be altered are written with 1, and all bits to be cleared are written with ?0? (these bits can only be cleared by software). read-modify-write cycles should be avoided because between the read and the write operations another bit could be set by the hardware and the next write will clear it before the microprocessor has the time to serve the event. the following describes each bit in detail: bit 15 ctr: correct transfer this bit is set by the hardware to indicate that an endpoint has successfully completed a transaction; using dir and ep_id bits software can determine which endpoint requested the interrupt. this bit is read-only. bit 14 dovr: dma over / underrun this bit is set if the microcontroller has not been able to respond in time to an usb memory request. the usb peripheral handles this event in the following way: during reception an ack handshake packet is not sent, during transmission a bit-stuff error is forced on the transmitted stream; in both cases the host will retry the transaction. the dovr interrupt should never occur during normal operations. since the failed transaction is retried by the host, the application software has the chance to speed-up device operations during this interrupt handling, to be ready for the next transaction retry; however this does not happen during isochronous transfers (no isochronous transaction is anyway retried) leading to a loss of data in this case. this bit is read/write but only ?0? can be written and writing ?1? has no effect. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 285/401 bit 13 err: error this flag is set whenever one of the errors listed below has occurred: nans: no answer. the timeout for a host response has expired. crc: cyclic redundancy check error. one of the received crcs, either in the token or in the data, was wrong. bst: bit stuffing error. a bit stuffing error was detected anywhere in the pid, data, and/or crc. fvio: framing format violation. a non-standard frame was received (eop not in the right place, wrong token sequence, etc.). the usb software can usually ignore errors, since the usb peripheral and the pc host manage retransmission in case of errors in a fully transparent way. this interrupt can be useful during the software development phase, or to monitor the quality of transmission over the usb bus, to flag possible problems to the user (e.g. loose connector, too noisy environment, broken conductor in the usb cable and so on). this bit is read/write but only ?0? can be written and writing ?1? has no effect. bit 12 wkup: wake up this bit is set to 1 by the hardware when, during suspend mode, activity is detected that wakes up the usb peripheral. this event asynchronously clears the lp_mode bit in the ctlr register and activates the usb_wakeup line, which can be used to notify the rest of the device (e.g. wake-up unit) about the start of the resume process. this bit is read/write but only ?0? can be written and writing ?1? has no effect. bit 11 susp suspend mode request this bit is set by the hardware when no traffic has been received for 3ms, indicating a suspend mode request from the usb bus. the suspend condition check is enabled immediately after any usb reset and it is disabled by the hardware when the suspend mode is active (fsusp=1) until the end of resume sequence. this bit is read/write but only ?0? can be written and writing ?1? has no effect. bit 10 reset: usb reset request set when the usb peripheral detects an active usb reset signal at its inputs. the usb peripheral, in response to a reset, just resets its internal protocol state machine, generating an interrupt if resetm enable bit in the usb_cntr register is set. reception and transmis sion are disabled until the reset bit is cleared. all configuration registers do not reset: the microcontroller must explicitly clear these registers (this is to ensure that the reset interrupt can be safely delivered, and any transaction immediately followed by a reset can be completed). the function address and endpoint registers are reset by an usb reset event. this bit is read/write but only ?0? can be written and writing ?1? has no effect. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 286/401 bit 9 sof: start of frame this bit signals the beginning of a new usb frame and it is set when a sof packet arrives through the usb bus. the interrupt service routine may monitor the sof events to have a 1ms synchronization event to the usb host and to safely read the usb_fnr register which is updated at the sof packet reception (this could be useful for isochr onous applications). this bit is read/ write but only ?0? can be written and writing ?1? has no effect. bit 8 esof: expected start of frame this bit is set by the hardware when an sof packet is expected but not received. the host sends an sof packet each ms, but if the hub does not receive it properly, the suspend timer issues this interrupt. if three consecutive esof interrupts are generated (i.e. three sof packets are lost) without any traffic occurring in between, a susp interrupt is generated. this bit is set even when the missing sof packets occur while the suspend timer is not yet locked. this bit is read/write but only ?0? can be written and writing ?1? has no effect. bits 7:5 reserved. these are reserved bits. these bits are always read as ?0? and must always be written with ?0?. bit 4 dir: direction of transaction . this bit is written by the hardware according to the direction of the successful transaction, which generated the interrupt request. if dir bit=0, ctr_tx bit is set in the usb_epnr register related to the interrupting endpoint. the interrupting tr ansaction is of in type (data transmitted by the usb peripheral to the host pc). if dir bit=1, ctr_rx bit or both ctr_tx/ctr_rx are set in the usb_epnr register related to the interrupting endpoint. the interrupting transaction is of out type (data received by the usb peripheral from the host pc) or two pending transactions are waiting to be processed. this information can be used by the application software to access the usb_epnr bits related to the triggering transaction since it represents the direction having the interrupt pending. this bit is read-only. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 287/401 bits 3:0 ep_id[3:0]: endpoint identifier . these bits are written by the hardware according to the endpoint number, which generated the interrupt request. if several endpoint transactions are pending, the hardware writes the endpoint identifier related to the endpoint having the highest priority defined in the following way: two endpoint sets are defined, in order of priority: isochronous and double-buffered bulk endpoints are considered first and then the other endpoints are examined. if more than one endpoint from the same set is requesting an interrupt, the ep_id bits in usb_istr register are assigned according to the lowest requesting endpoint register, ep0r having the highest priority followed by ep1r and so on. the application software can assign a register to each endpoint according to this priority scheme, so as to order the concurring endpoint requests in a suitable way. these bits are read only. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 288/401 usb frame number register (usb_fnr) address offset: 48h reset value: 0000 0xxx xxxx xxxx (0xxxh) 151413121110987654321 0 rxdp rxdm lck lsof[1:0] fn[10:0] rrr r r bit 15 rxdp receive data + line status this bit can be used to observe the status of received data plus upstream port data line. it can be used during end-of-suspend routines to help determining the wake-up event. bit 14 rxdm. receive data - line status this bit can be used to observe the status of received data minus upstream port data line. it can be used during end-of-suspend routines to help determining the wake-up event. bit 13 lck: locked this bit is set by the hardware when at least two consecutive sof packets have been received after the end of an usb reset condition or after the end of an usb resume sequence. once locked, the frame timer remains in this state until an usb reset or usb suspend event occurs. bits12:11 lsof[1:0]: lost sof these bits are written by the hardware when an esof interrupt is generated, counting the number of consecutive sof packets lost. at the reception of an sof packet, these bits are cleared. bits 10:0 fn[10:0] : frame number this bit field contains the 11-bits frame number contained in the last received sof packet. the frame number is incremented for every frame sent by the host and it is useful for isochronous transfers. this bit field is updated on the generation of an sof interrupt. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 289/401 usb device address (usb_daddr) address offset: 4ch reset value: 0000 0000 0000 0000 (0000h) this register is also reset when a usb reset is received from the usb bus or forced through bit fres in the usb_cntr register. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved ef add[6:0] - rw rw bits 15:8 reserved these are reserved bits. these bits are always read as ?0? and must always be written with ?0?. bit 7 ef: enable function this bit is set by the software to enable the usb device. the address of this device is contained in the followin g add[6:0] bits. if this bit is at ?0? no transactions are handled, irrespective of the settings of usb_epnr registers. bits 6:0 add[6:0]: device address these bits contain the usb function address assigned by the host pc during the enumeration process. both this field and the endpoint address (ea) field in the associated usb_epnr register must match with the information contained in a usb token in order to handle a transaction to the required endpoint. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 290/401 buffer table addr ess (usb_btable) address offset: 50h reset value: 0000 0000 0000 0000 (0000h) 151413121110987654321 0 btable[15:3] reserved rw bits 15:3 btable[15:3]: buffer table . these bits contain the start address of the buffer allocation table inside the dedicated packet memory. this table describes each endpoint buffer location and size and it must be aligned to an 8 byte boundary (the 3 least significant bits are always ?0?). at the beginning of every transaction addressed to this device, the usp peripheral reads the element of this table related to the addressed endpoint, to get its buffer start location and the buffer size (refer to section ?structure and usage of packet buffers? ). bits 2:0 reserved. these are reserved bits. these bits are always read as ?0? and must always be written with ?0?. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 291/401 19.6.2 endpoint-specific registers the number of these registers varies according to the number of endpoints that the usb peripheral is designed to handle. the usb peripheral supports up to 8 endpoints. each usb device must support a control endpoint whose address (ea bits) must be set to 0. the usb peripheral behaves in an undefined way if multiple endpoints are enabled having the same endpoint number value. for each endpoint, an usb_epnr register is available to store the endpoint specific information. usb endpoint n register (usb_epnr) address offset: 00h to 2ch reset value: 0000 0000 0000 0000b (0000h) they are also reset when an usb reset is received from the usb bus or forced through bit fres in the ctlr register, except the ctr_rx and ctr_tx bits, which are kept unchanged to avoid missing a correct packet notification immediately followed by an usb reset event. each endpoint has its usb_epnr register where n is the endpoint identifier. read-modify-write cycles on these registers should be avoided because between the read and the write operations some bits could be set by the hardware and the next write would modify them before the microprocessor has the time to detect the change. for this purpose, all bits affected by this problem have an ?invariant? value that must be used whenever their modification is not required. it is recomme nded to modify these registers with a load instruction where all the bits, which can be modified only by the hardware, are written with their ?invariant? value. 1514131211109876543210 ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] r-c t t r rw rw r-c t t rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 292/401 bit 15 ctr_rx: correct transfer for reception this bit is set by the hardware when an out/setup transaction is successfully completed on this endpoint; the software can only clear this bit. if the ctrm bit in usb_cntr register is set accordingly, a generic interrupt condition is generated together with the endpoint related interrupt condition, which is always activated. the type of occurred transaction, out or setup, can be determined from the setup bit described below. a transaction ended with a nak or stall handshake does not set this bit, since no data is actually transferred, as in the case of protocol errors or data toggle mismatches. this bit is read/write but only ?0? can be written, writing 1 has no effect. bit 14 dtog_rx: data toggle, for reception transfers if the endpoint is not isochronous, this bit contains the expected value of the data toggle bit (0=data0, 1=data1) for the next data packet to be received. hardware toggles this bit, when the ack handshake is sent to the usb host, following a data packet reception having a matching data pid value; if the endpoint is defined as a control one, hardware clears this bit at the reception of a setup pid addressed to this endpoint. if the endpoint is using the double-buffering feature this bit is used to support packet buffer swapping too (refer to section ?double-buffered endpoints? ). if the endpoint is isochronous, this bit is used only to support packet buffer swapping since no data toggling is used for this sort of endpoints and only data0 packet are transmitted (refer to section ?isochronous transfers? ). hardware toggles this bit just after the end of data packet reception, since no handshake is used for isochronous transfers. this bit can also be toggled by the software to initialize its value (mandatory when the endpoint is not a control one) or to force specific data toggle/packet buffer usage. when the application software writes ?0?, the value of dtog_rx remains unchanged, while writing ?1? makes the bit value toggle. this bit is read/write but it can be only toggled by writing 1. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 293/401 bits 13:12 stat_rx [1:0] status bits, for reception transfers these bits contain information about the endpoint status, which are listed in table 62, ?reception status encoding,? on page 296 .these bits can be toggled by software to initialize their value. when the application software writes ?0?, the value remains unchanged, while writing ?1? makes the bit value toggle. hardware sets the stat_rx bits to nak when a correct transfer has occurred (ctr_rx=1) corresponding to a out or setup (control only) transaction addressed to this endpoint, so the software has the time to elaborate the received data before it acknowledge a new transaction double-buffered bulk endpoints implement a special transaction flow control, which control the status based upon buffer availability condition (refer to section ?double-buffered endpoints? ). if the endpoint is defined as isochronous, its status can be only ?valid? or ?disabled?, so that the hardware cannot change the status of the endpoint after a successful transaction. if the software sets the stat_rx bits to ?stall? or ?nak? for an isochronous endpoint, the usb peripheral behaviour is not defined. these bits are read/write but they can be only toggled by writing ?1?. bit 11 setup: setup transaction completed this bit is read-only and it is set by the hardware when the last completed transaction is a setup. this bit changes its value only for control endpoints. it must be examined, in the case of a successful receive transaction (ctr_rx event), to determine the type of transaction occurred. to protect the interrupt service routine from the changes in setup bits due to next incoming tokens, this bit is kept frozen while ctr_rx bit is at 1; its state changes when ctr_rx is at 0. this bit is read-only. bits 10:9 ep_type[1:0]: endpoint type these bits configure the behaviour of this endpoint as described in table 63, ?endpoint type encoding,? on page 296 . endpoint 0 must always be a control endpoint and each usb function must have at least one control endpoint which has address 0, but there may be other control endpoints if required. only control endpoints handle setup transactions, which are ignored by endpoints of other kinds. setup transactions cannot be answered with nak or stall. if a control endpoint is defined as nak, the usb peripheral will not answer, simulating a receive error, in the receive direction when a setup transaction is received. if the control endpoint is defined as stall in the receive direction, then the setup packet will be accepted anyway, transferring data and issuing the ctr interrupt. the reception of out transactions is handled in the normal way, even if the endpoint is a control one. bulk and interrupt endpoints have very similar behaviour and they differ only in the special feature available using the ep_kind configuration bit. the usage of isochronous endpoints is explained in ?isochronous transfers? 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 294/401 bit 8 ep_kind: endpoint kind the meaning of this bit depends on the endpoint type configured by the ep_type bits. table 64 summarizes the different meanings. dbl_buf: this bit is set by the software to enable the double-buffering feature for this bulk endpoint. the usage of double-buffered bulk endpoints is explained in ?double-buffered endpoints? . status_out: this bit is set by the software to indicate that a status out transaction is expected: in this case all out transactions containing more than zero data bytes are answered ?stall? instead of ?ack?. this bit may be used to improve the robustness of the application to protocol errors during control transfers and its usage is intended for control endpoints only. when status_out is reset, out transactions can have any number of bytes, as required. bit 7 ctr_tx: correct transfer for transmission this bit is set by the hardware when an in transaction is successfully completed on this endpoint; the software can only clear this bit. if the ctrm bit in the usb_cntr register is set accordingly, a generic interrupt condition is generated together with the endpoint related interrupt condition, which is always activated. note a transaction ended with a nak or stall handshake does not set this bit, since no data is actually transferred, as in the case of protocol errors or data toggle mismatches. this bit is read/write but only ?0? can be written. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 295/401 bit 6 dtog_tx: data toggle, for transmission transfers if the endpoint is non-isochronous, this bit contains the required value of the data toggle bit (0=data0, 1=data1) for the next data packet to be transmitted. hardware toggles this bit when the ack handshake is received from the usb host, following a data packet transmission. if the endpoint is defined as a control one, hardware sets this bit to 1 at the reception of a setup pid addressed to this endpoint. if the endpoint is using the double buffer feature, this bit is used to support packet buffer swapping too (refer to section ?double-buffered endpoints? ) if the endpoint is isochronous, this bit is used to support packet buffer swapping since no data toggling is used for this sort of endpoints and only data0 packet are transmitted (refer to section ?isochronous transfers? ). hardware toggles this bit just after the end of data packet transmission, since no handshake is used for isochronous transfers. this bit can also be toggled by the software to initialize its value (mandatory when the endpoint is not a control one) or to force a specific data toggle/ packet buffer usage. when the application software writes ?0?, the value of dtog_tx remains unchanged, while writing ?1? makes the bit value toggle. this bit is read/write but it can only be toggled by writing 1. bit 5:4 stat_tx [1:0] status bits, for transmission transfers these bits contain the information about the endpoint status, listed in table 65 . these bits can be toggled by the s oftware to initialize their value. when the application software writes ?0?, the value remains unchanged, while writing ?1? makes the bit value toggle. hardware sets the stat_tx bits to nak, when a correct transfer has occurred (ctr_tx=1) corresponding to a in or setup (control only) transaction addressed to this endpoint. it then waits for the software to prepare the next set of data to be transmitted. double-buffered bulk endpoints implement a special transaction flow control, which controls the status based on buffer availability condition (refer to section ?double-buffered endpoints? ). if the endpoint is defined as isochronous, its status can only be ?valid? or ?disabled?. therefore, the hard ware cannot change the status of the endpoint after a successful transaction. if the software sets the stat_tx bits to ?stall? or ?nak? for an isochronous endpoint, the usb peripheral behaviour is not defined. these bits are read/write but they can be only toggled by writing ?1?. bit 3:0 ea[3:0] endpoint address. software must write in this field the 4-bit address used to identify the transactions directed to this endpoint. a value must be written before enabling the corresponding endpoint. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 296/401 table 62. reception status encoding stat_rx[1:0] meaning 00 disabled: all reception requests addressed to this endpoint are ignored. 01 stall : the endpoint is stalled and all reception requests result in a stall hand- shake. 10 nak : the endpoint is naked and all reception requests result in a nak hand- shake. 11 valid : this endpoint is enabled for reception. table 63. endpoint type encoding ep_type[1:0] meaning 00 bulk 01 control 10 iso 11 interrupt table 64. endpoint kind meaning ep_type[1:0] ep_kind meaning 00 bulk dbl_buf 01 control status_out 10 iso not used 11 interrupt not used table 65. transmission status encoding stat_tx[1:0] meaning 00 disabled: all transmission requests addressed to this endpoint are ignored. 01 stall : the endpoint is stalled and all transmi ssion requests result in a stall handshake. 10 nak : the endpoint is naked and all transmissi on requests result in a nak handshake. 11 valid : this endpoint is enabled for transmission. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 297/401 19.6.3 buffer descriptor table although this table is located inside packet buffer memory, its entries can be considered as additional registers used to configure the location and size of packet buffers used to exchange data between usb and the STR720. due to the common apb bridge limitation on word addressability, all packet memory location s are accessed by the apb using 32-bit aligned addresses, instead of the actual memory location addresses utilized by the usb peripheral for the usb_btable register and buffer description table locations. in the following pages two location addresses are reported: the one to be used by application software while accessing the packet memory, and the local one relative to usb peripheral access. to obtain the correct STR720 memory address value to be used in the application software while accessing the packet memory, the actual memory location address must be multiplied by two. the first packet memory location is located at 0xc000 8800. the buffer description table entry associated with the usb_epnr registers is described below. a thorough explanation of packet buffers and buffer descriptor table usage can be found in the section ?structure and usage of packet buffers? . transmission buffer address n (usb_addrn_tx) address offset: [usb_btable] + n *16 usb local address: [usb_btable] + n *8 1514131211109 8 765432 1 0 addrn_tx[15:1] - rw bits 15:1 addrn_tx[15:1]. transmission buffer address these bits point to the starting address of the packet buffer containing data to be transmitted by the endpoint associated with the usb_epnr register at the next in token addressed to it. bit 0 must always be written as ?0? since packet memory is word-wide and all packet buffers must be word-aligned. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 298/401 transmission byte count n (usb_countn_tx) address offset: [usb_btable] + n *16 + 4 usb local addr ess: [usb_btable] + n *8 + 2 151413121110987654321 0 - count n _tx[9:0] rw bits 15:10 these bits are not used since packet size is limited by usb specifications to 1023 bytes. their value is not considered by the usb peripheral. bits 9:0 countn_tx[9:0]. transmission byte count these bits contain the number of bytes to be transmitted by the endpoint associated with the usb_epnr register at the next in token addressed to it. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 299/401 reception buffer address n (usb_addrn_rx) address offset: [usb_btable] + n *16 + 8 usb local addr ess: [usb_btable] + n *8 + 4 1514131211109876543210 addrn_rx[15:1] - rw bits 15:1 addrn_rx[15:1]. reception buffer address these bits point to the starting address of the packet buffer, which will contain the data received by the endpoint associated with the usb_epnr register at the next out/setup token addressed to it. bit 0 this bit must always be written as ?0? since packet memory is word-wide and all packet buffers must be word-aligned. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 300/401 reception byte count n (usb_countn_rx) this table location is used to store two different values, both required during packet reception. the most significant bits contains the definition of allocated buffer size, to allow buffer overflow detection, while the least significant part of this lo cation is written back by the usb peripheral at the end of reception to give the actual number of received bytes. due to the restrictions on the number of available bits, buffer size is represented using the number of allocated memory blocks, where block size can be selected to choose the trade-off between fine-granularity/ small-buffer and coarse-granularity/large-buffe r. the size of allocated buffer is a part of the endpoint descriptor and it is normally defined during the enumeration process according to its maxpacketsize parameter value (see ?universal serial bus specification?). address offset: [usb_btable] + n *16 + 12 usb local addr ess: [usb_btable] + n *8 + 6 151413121110987654321 0 blsize num_block[4:0] count n _rx[9:0] rw rw r bit 15 bl_size: block size. this bit selects the size of memory block used to define the allocated buffer area.  if bl_size=0, the memory block is 2 byte large, which is the minimum block allowed in a word-wide memory. with this block size the allocated buffer size ranges from 2 to 62 bytes .  if bl_size=1, the memory block is 32 byte large, which allows to reach the maximum packet length defined by usb specifications. with this block size the allocated buffer size ranges from 32 to 1024 bytes, which is the longest packet size allowed by usb standard specifications. bits 14:10 num_block[4:0]: number of blocks . these bits define the number of memory blocks allocated to this packet buffer. the actual amount of allocated memory depends on the bl_size value as illustrated in table 66 . bits 9:0 countn_rx[9:0]. these bits contain the number of bytes received by the endpoint associated with the usb_epnr register during the last out/ setup transaction addressed to it. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 301/401 table 66. definition of allocated buffer memory value of num_block[4:0] memory allocated when bl_size=0 memory allocated when bl_size=1 0 (?00000?) not allowed 32 bytes 1 (?00001?) 2 bytes 64 bytes 2 (?00010?) 4 bytes 96 bytes 3 (?00011?) 6 bytes 128 bytes ... ... ... 15 (?01111?) 30 bytes 512 bytes 16 (?10000?) 32 bytes 544 bytes 17 (?10001?) 34 bytes 576 bytes 18 (?10010?) 36 bytes 608 bytes ... ... ... 30 (?11110?) 60 bytes 992 bytes 31 (?11111?) 62 bytes 1024 bytes 1 .com .com .com .com .com 4 .com u datasheet
STR720 - usb slave interface (usb) 302/401 19.6.4 register map a summary of the usb peripheral registers is given in the following table. refer to table 20 on page 49 for the base address.. table 67. usb peripheral register page mapping offset register 1514131211109876543210 0x00 usb_ep0r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x04 usb_ep1r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x08 usb_ep2r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x0c usb_ep3r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x10 usb_ep4r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x14 usb_ep5r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x18 usb_ep6r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x1c usb_ep7r ctr_rx dtog_rx stat rx[1:0] setup ep type[1:0] ep_kind ctr tx dtog_tx stat tx[1:0] ea[3:0] 0x40 usb_cntr ctrm dovrm errm wkupm suspm resetm sofm esofm reserved resume fsusp lp pdwn fres 0x44 usb_istr ctr dovr err wkup susp reset sof esof reserved dir ep_id[3:0] 0x48 usb_fnr rxdp rxdm lck lsof[1:0] fn[10:0] 0x4c usb_daddr reserved ef add[6:0] 0x50 usb_btable btable[15:3] reserved 1 .com .com .com .com .com 4 .com u datasheet
STR720 - watchdog timer (wdg) 303/401 20 watchdog timer (wdg) 20.1 introduction the watchdog timer peripheral can be used as free-running timer or as watchdog to resolve STR720 microcontroller malfunctions due to hardware or software failures. 20.2 main features 16-bit down counter 8-bit clock prescaler safe reload sequence free-running timer mode end of counting interrupt generation second clock source (4 khz de rived from 32 khz rtc clock 20.3 functional description figure 42 shows the functional blocks of the watchdog timer module. the module can work as watchdog or as free-running timer. in both working modes the 16-bit counter value can be accessed through a reading of the wdtcnt register. 20.3.1 free-running timer mode if the we bit of wdtcr register is not written to ?1? by software, the peripheral enter in free-running timer mode. when in this operating mode as the sc bit of wdtcr register is written to ?1? the wdtvr value is loaded in the counter and the counter starts counting down. figure 42. watchdog timer functional block eoc apb_clk irq / ee ecm ec 16-bit counter wdtvr register clk_af/8 8-bit prescaler sc wdtpr register we sys rst 1 .com .com .com .com .com 4 .com u datasheet
STR720 - watchdog timer (wdg) 304/401 when it reaches the end of count value (0000h) an end of count interrupt is generated (ec) and the wdtvr value is automatically re-loaded. the counter runs until the sc bit is cleared. setting sc bit again, both the counter and the prescaler are re-loaded with the values contained in registers wdtvr and wdtpr respecti vely, so it does not restart from where it was eventually stopped, but from a defined situation without need to reset and re-program the module. it is clear that, on the other hand, it is not possible to change on fly the prescaling factor since it will only effect the counter after a restart command (sc bit setting which generates a re-load operation). the clock input signal can be either the apb_clk or an alternate clock signal, having at least a period four times longer than the period of the apb clock. this can allow for example to generate time basis independent from the apb clock which could dynamically change according to the system mode setting (run mode, low power mode, etc.). this alternate clock signal is derived from the rtc clock and is equal to clk_af divided by 8. 20.3.2 watchdog mode if we bit of wdtcr register is written to ?1? by software, the peripheral enter in watchdog mode. this operating mode can not be changed by software (the sc bit has no effect and we bit cannot be cleared). as the peripheral enters in this operating mode, the wdtvr value is loaded in the counter and the counter starts counting down. when it reaches the end of count value (0000h) a system reset signal is generated (sys rst). if the sequence of two consecutive values a55ah, 5aa5h is written in the wdtkr register see section 20.4 , the wdtvr value is re-loaded in the counter, so the end of count can be avoided. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - watchdog timer (wdg) 305/401 20.4 register description the watchdog timer registers can not be accessed by byte. the reserved bits can not be written and they are always read at ?0?. wdt control register (wdtcr) address offset: 00h reset value: 0000h bit 15:3 = reserved. bit 2 = ee : ext_ck enable bit. 1: ext_ck signal, (clk_af/8 is used as counting clock, its period must be at least 4 times the apb_clk period. 0: apb_clk is used as counting clock. this bit can be written as long as watchdog mode is not entered (we bit = 0). once we bit is set to ?1?, the value of ee cannot be changed anymore. bit 1 = sc : start counting bit. 1: the prescaler loads the prescaler pre-load value (wdtpr), the counter loads the timer pre-load value (wdtvr) and starts counting 0: the counter is stopped. to restart it, sc setting will generate a re-loading of the prescaler pre-load value and timer pre-load value. these functionalities are permitted only in timer mode (we bit = 0). bit 0 = we : watchdog enable bit. 1: watchdog mode is enabled 0: timer mode is enabled this bit can?t be reset by software. if the external wdgen signal is high the we bit is written to ?1? by hardware as soon the reset has elapsed else can write to ?1? by software but cannot be cleared. when we bit is high, sc bit has no effect. 1514131211109 87654321 0 reserved ee sc we -rwrwrw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - watchdog timer (wdg) 306/401 wdt prescaler register (wdtpr) address offset: 04h reset value: 00ffh bit 15:8 = reserved. bit 7:0 = pr[7:0] : prescaler value. the clock to timer counter is divided by pr[7:0]+1. this value takes effect when watchdog mode is enabled (we bit is put to ?1?) or the re-load sequence occurs or the counter starts (sc) bit is put to ?1? in timer mode. wdt pre-load value register (wdtvr) address offset: 08h reset value: ffffh bit 15:0 = tv[15:0] : timer pre-load value this value is loaded in the timer counter when it starts counting or a re-load sequence occurs or an end of count is reached. the time ( s) need to reach the end of count is given by: (pr[7:0]+1)*(tv[15:0]+1)*t ck /1000 ( s) where t ck is the watchdog clock period measured in ns. i.e. if f ck = 20mhz the default timeout set after the system reset is 256*65536*50/1000 = 838861 s. 1514131211109 87654321 0 reserved pr7 pr6 pr5 pr4 pr3 pr2 pr1 pr0 - rwrwrwrwrwrwrw rw 1514131211109 87654321 0 tv15 tv14 tv13 tv12 tv11 tv10 tv9 tv8 tv7 tv6 tv5 tv4 tv3 tv2 tv1 tv0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - watchdog timer (wdg) 307/401 wdt counter register (wdtcnt) address offset: 0ch reset value: ffffh bit 15:0 = cnt[15:0]: timer counter value. the current counting value of the 16-bit counter is available reading this register. wdt status register (wdtsr) address offset: 10h reset value: 0000h bit 15:1 = reserved . bit 0 = ec : end of count pending bit. 1: the end of count has occurred 0: no end of count has occurred in watchdog mode (we = 1) this bit has no effect. this bit can be set only by hardware and must be reset by software. wdt mask register (wdtmr) address offset: 14h reset value: 0000h bit15:1 = reserved . bit 0 = ecm : end of count mask bit. 1: end of count interrupt request is enabled 0: end of count interrupt request is disabled 1514131211109 87654321 0 cnt15 cnt14 cnt13 cnt12 cnt11 cnt10 cnt9 cnt8 cnt7 cnt6 cnt5 cnt4 cnt3 cnt2 cnt1 cnt0 rrrrrrr rrrrrrrr r 1514131211109 87654321 0 reserved ec -rc 1514131211109 87654321 0 reserved ecm -rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - watchdog timer (wdg) 308/401 wdt key register (wdtkr) address offset: 18h reset value: 0000h bit 15:0 = k[15:0]: key value. when watchdog mode is enabled, writing in this register the two consecutive values (a55ah, 5aa5h) the counter is initialized to tv[15:0] value and the prescaler value in wtdpr register take effect. any number of instructions can be executed between the two writes. if watchdog mode is disabled (we = 0) a writing in this register has no effect. the reading value of this register is 0000h. 20.4.1 register map a summary of the wdg registers is given in the following table. refer to table 20 on page 49 for the base address. 1514131211109 87654321 0 k15 k14 k13 k12 k11 k10 k9 k8 k7 k6 k5 k4 k3 k2 k1 k0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw table 68. watchdog timer peripheral register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 wdtcr reserved ee sc we 4 wdtpr reserved pr(7:0) 8 wdtvr tv(15:0) c wdtcnt cnt(15:0) 10 wdtsr reserved ec 14 wdtmr reserved mec 18 wdtkr k[15:0] 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 309/401 21 extended function timer (eft) 21.1 introduction the timer consists of a 16-bit counter driven by a programmable prescaler. it may be used for a variety of purposes, including pulse length measurement of up to two input signals (input capture) or generation of up to two output waveforms (output compare and pwm). pulse lengths and waveform periods can be modulated from a very wide range using the timer prescaler. note the two eft instances available in STR720 device do not implement all the features described in this chapter. please refer to section 5.16: extended function timer (eft) on page 43 . 21.2 main features programmable prescaler: f apb divided from 1 to 256, prescaler register (0 to 255) value +1. overflow status flag and maskable interrupts external clock input (must be at l east 4 times slower than the cpu clock speed) with the choice of active edge output compare functions with ? 2 dedicated 16-bit registers ? 2 dedicated programmable signals ? 2 dedicated status flags ? 2 dedicated interrupt flags. input capture functions with ? 2 dedicated 16-bit registers ? 2 dedicated active edge selection signals ? 2 dedicated status flags ? 2 dedicated interrupt flags. pulse width modulation mode (pwm) one pulse mode (opm) pwm input mode timer global interrupt (5 internally ored or separated sources, depending on device) ? icia: timer input capture a interrupt ? icib: timer input capture b interrupt ? ocia: timer output compare a interrupt ? ocib: timer output compare b interrupt ? toi: timer overflow interrupt. the block diagram is shown in figure 43 . 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 310/401 21.3 functional description 21.3.1 counter the principal block of the programmable timer is a 16-bit counter and its associated 16-bit registers. writing in the counter register (cntr) resets the counter to the fffch value. the timer clock source can be either internal or external selecting ecken bit of cr1 register. when ecken = 0, the frequency depends on the prescaler division bits (cc7-cc0) of the cr2 register. an overflow occurs when the counter rolls over from ffffh to 0000h then the tof bit of the sr register is set. an interrupt is generated if toie bit of the cr2 register is set; if this condition is false, the interrupt remains pending to be issued as soon as it becomes true. clearing the overflow interrupt request is done by a write access to the sr register while the tof bit is set with the data bus 13-bit at ?0?, whil e all the other bits shall be written to ?1? (the sr register is clear only, so writing a ?1? in a bit has no effect: this makes possible to clear a pending bit without risking to clear a new coming interrupt request from another source). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 311/401 figure 43. timer block diagram peripheral interface counter alternate register output compare register output compare edge detect overflow detect circuit amba apb bus latch a ocmpa icapa extclk cpu clock pwm ocae ecken exedg iedga ocbe opm folvb olvla olvlb folva icapb latch b ocmpb 16 16 16 16 cr1 6 16 16 16 16 16 exedg timer internal bus circuit a edge detect circuit b circuit a output compare register b input capture register a input capture register b cc03 6 16 bit counter 16 en ecken 1/cc . . . . . tof toie toi icfa icaie icfb icbie ocfa ocaie ocfb ocbie icai icbi ocai ocbi icbie ocaie icaie cc4 cc7 cc0 cc1 cc2 cc3 cc6 cc5 cr2 efti iedgb ocfb ocfa tof icfb icfa sr toie ocbie 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 312/401 21.3.2 external clock the external clock (where available) is selected if ecken = 1 in cr1 register. the status of the exedg bit determines the type of level transition on the external clock pin extclk that will trigger the counter. the counter is synchronized with the rising edge of the internal clock coming from the apb block. at least four rising edges of the apb_clk must occur between two consecutive active edges of the external clock; thus the external clock frequency must be less than a quarter of the apb clock frequency. figure 44. counter timing diagram, internal clock divided by 2 figure 45. counter timing diagram, internal clock divided by 4 apb_clk fffd fffe ffff 0000 0001 0002 0003 internal reset timer strobe: counter register overflow flag tof fffc fffd 0000 0001 apb_clk internal reset timer strobe counter register overflow flag tof 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 313/401 according to particular device implementation, the external clock can be available on a general purpose i/o pin as alternate functi on, this allows the timer to count events independently by the system clock (which could be prescaled or multiplied according to the different run and low-power modes), generating regular time basis. 21.3.3 input capture in this section, the index ? i? , may be a or b. the two input capture 16-bit registers (icar and icbr) are used to latch the value of the counter after a transition detected by the icap i pin (see figure 47 ). ic i r register are read-only registers. the active transition is software programmable through the iedg i bit of the control register (cr1). timing resolution is one/two count of the counter: (f apb /(cc7 cc0+1)). figure 46. counter timing diagram, internal clock divided by n apb_clk internal reset timer strobe counter register overflow flag tof fffc fffd 0000 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 314/401 21.3.3.1 procedure to use the input capture function select the following in the cr1 and cr2 registers: ? select the timer clock source (ecken). ? select the timer clock division factor (cc7 cc0) if internal clock is used. ? select the edge of the active transition on the icapa pin with the iedga bit, if icapa is ac- tive. ? select the edge of the active transition on the icapb pin with the iedgb bit, if icapb is ac- tive. ? set icaie (or icbie) when icapa (or icapb) is active, to generate an interrupt after an input capture. when an input capture occurs: ? icf i bit is set. ? the ic i r register contains the value of the counter on the active transition on the icap i pin (see figure 48 ). ? a timer interrupt is generated if icaie is set (i f only icapa is active) or icbie is set (if only icapb is active); otherwise, the interrupt rema ins pending until concer ned enable bits are set. clearing the input capture interrupt request is done by: 1. a write access to the sr register while the icf i bit is cleared, 15-bit at ?0? for icapa and 12-bit at ?0? for icapb. figure 47. input capture block diagram ecken 16-bit counter (control register 1) cr1 low byte icfb icfa (status register) sr high byte iedg2 icapa icapb edge detect circuit b 16-bit icar icbr edge detect circuit a cc7-cc0 from cr2 iedg1 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 315/401 21.3.4 output compare in this section, the index ? i? , may be a or b. this function can be used to control an output waveform or indicating when a period of time has elapsed. when a match is found between the output compare register and the counter, the output compare function: ? assigns pins with a programmable value if the oc i e bit is set ? sets a flag in the status register ? generates an interrupt if enabled two 16-bit registers output compare regist er a (ocar) and output compare register b (ocbr) contain the value to be compared to the counter each timer clock cycle. these registers are readable and writable and are not affected by the timer hardware. a reset event changes the oc i r value to 8000h. timing resolution is one count of the counter: (f apb /(cc7 cc0+1)). figure 48. input capture timing diagram ff01 ff02 ff03 ff03 apb_clk counter register icapi pin icapi flag icapi register note: active edge is rising edge. capture window ff04 extclk 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 316/401 21.3.4.1 procedure to use the output compare function, select the following in the cr1/cr2 registers: ? set the oc i e bit if an output is needed then the ocmp i pin is dedicated to the output com- pare i function. ? select the timer clock (eckgen) and the prescaler division factor (cc7 cc0). select the following in the cr1/cr2 registers: ? select the olvl i bit to applied to the ocmp i pins after the match occurs. ? set ocaie (ocbie) if only compare a (compare b) needs to generate an interrupt. when match is found: ? ocf i bit is set. ? the ocmp i pin takes olvl i bit value (ocmp i pin latch is forced low during reset and stays low until valid compares change it to olvl i level). ? a timer interrupt is generated if the ocaie (or ocbie) bit in cr2 register is set, the ocar (or ocbr) matches the timer counter (i.e. ocfa or ocfb is set). clearing the output compare interrupt request is done by a write access to the sr register while the ocf i bit is cleared, 14-bit at ?0? for ocar and 12-bit at ?0? for ocbr. if the oc i e bit is not set, the ocmp i pin is at ?0? and the olvl i bit will not appear when match is found. the value in the 16-bit oc i r register and the olvl i bit should be changed after each successful comparison in order to control an output waveform or establish a new elapsed timeout. the oc i r register value required for a specific ti ming application can be calculated using the following formula: where: ? t = desired output compare period (in seconds) f apb = apb clock frequency cc7 cc0 = timer clock prescaler ? oc i r = ? t * f apb ( cc7 cc0+1 ) 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 317/401 figure 49. output compare block diagram figure 50. output compare timing diagram, apb_clk divided by 2 output compare 16-bit circuit ocar 16 bit counter ocbe ecken ocae olvla (control register 1) cr1 high byte (control register 1) cr1 low byte ocfb ocfa (control register 2) cr2 high byte 16-bit 16-bit ocmpa ocmpb latch a latch b ocbr cc7-cc0 from cr2 olvlb apb_clk timer strobe counter output compare register compare register signal ocfi and ocmpi pin (olvli=1) cpu writes ffff ffff fffd fffd fffe ffff 0000 fffc 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 318/401 21.3.5 forced compare mode in this section the index ? i? may represent a or b. bits 11:8 of cr1 register and bits 7:0 of cr2 are used (refer to section 21.4 for detailed register description). when the folva bit is set, the olvla bit is copied to the ocmpa pin if pwm and opm are both cleared. when folvb bit is set, the olvlb bit is copied to the ocmpb pin. the olvl i bit has to be toggled in order to toggle the ocmp i pin when it is enabled (oc i e bit=1). note ? when folv i is set, no interrupt request is generated. ? nevertheless the ocf i bit can be set if oc i r = counter, an interrupt can be generated if enabled. ? input capture function works in forced compare mode. 21.3.6 one pulse mode one pulse mode enables the generation of a pulse when an external event occurs. this mode is selected via the opm bit in the cr1 register. the one pulse mode uses the input capture a function (trigger event) and the output compare a function. 21.3.6.1 procedure to use one pulse mode, select the following in the cr1 register: ? using the olvla bit, select the level to be applied to the ocmpa pin after the pulse. ? using the olvlb bit, select the level to be applied to the ocmpa pin during the pulse. ? select the edge of the active transition on the icapa pin with the iedga bit . ? set the ocae bit, the ocmpa pin is then dedicated to the output compare a function. ? set the opm bit. ? select the timer clock (eckgen) and the prescaler division factor (cc7-cc0). load the ocar register with the value corresponding to the length of the pulse (see the formula in next section 21.3.7.1 ). 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 319/401 then, on a valid event on the icapa pin, the counter is initialized to fffch and olvlb bit is loaded on the ocmpa pin after four clock period. when the value of the counter is equal to the value of the contents of the ocar register, the olvla bit is output on the ocmpa pin (see figure 52 ). note ? the ocfa bit cannot be set by hardware in one pulse mode but the ocfb bit can generate an output compare interrupt. ? the icfa bit is set when an active edge occurs and can generate an interrupt if the icaie bit is set. the icar register will have the value fffch. ? when the pulse width modulation (pwm) a nd one pulse mode (opm) bits are both set with folva= 1, the opm mode is the only active one, otherwise the pwm mode is the only active one. ? forced compare b mode works in opm ? input capture b function works in opm ? when ocar = fffbh in opm, then a pulse of width ffffh is generated ? if event occurs on icapa again before the counter reaches the value of ocar, then the counter will be reset again and the pulse generated might be longer than expected as in figure 52 . ? if a write operation is performed on the counter register before the counter reaches the value of ocar, then the counter will be reset again and the pulse generated might be longer than expected. ? if a write operation is performed on the coun ter register after the counter reaches the value of ocar, then there will have no effect on the waveform. figure 51. one pulse mode cycle event occurs counter is initialized to fffch ocmpa = olvlb counter = ocar ocmpa = olvla when when on icapa 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 320/401 21.3.7 pulse width modulation mode pulse width modulation mode enables the generation of a signal with a frequency and pulse length determined by the value of the ocar and ocbr registers. the pulse width modulation mode uses the co mplete output compare a function plus the ocbr register. 21.3.7.1 procedure to use pulse width modulation mode select the following in the cr1 register: ? using the olvla bit, select the level to be applied to the ocmpa pin after a successful com- parison with ocar register. ? using the olvlb bit, select the level to be applied to the ocmpa pin after a successful com- parison with ocbr register. ? set ocae bit: the ocmpa pin is then dedicated to the output compare a function. ? set the pwm bit. ? select the timer clock (eckgen) and the prescaler division factor (cc7-cc0). load the ocbr register with the value corresponding to the period of the signal. load the ocar register with the value corresponding to the length of the pulse if (olvla=0 and olvlb=1). figure 52. one pulse mode timing counter .... fffc fffd fffe 2ed0 2ed1 2ed2 2ed3 fffc fffd olvlb olvlb olvla icapa ocmpa compare a note: iedga=1, ocar=2ed0h, olvla=0, olvlb=1 counter .... fffc fffd fffe 2ed0 2ed1 2ed2 2ed3 fffc fffd olvlb olvlb olvla icapa ocmpa compare a note: iedga=1, ocar=2ed0h, olvla=0, olvlb=1 0010 fffc 4 clock period 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 321/401 if olvla=1 and olvlb=0 the length of the pulse is the difference between the ocbr and ocar registers. the oc i r register value required for a specific ti ming application can be calculated using the following formula: where: t = desired output compare period (seconds) f apb = apb clock frequency (hertz) t presc = timer clock prescaler ((cc7..cc0)+1) the output compare b event causes the counter to be initialized to fffch (see figure 54 ). note ? the ocfa bit cannot be set by hardware in pwm mode, but ocfb is set every time counter matches ocbr. ? the input capture function is available in pwm mode. ? when counter = ocbr, then ocfb bit will be set. this can generate an interrupt if ocbie is set. this interrupt will help any application where pulse-width or period needs to be changed interactively. ? when the pulse width modulation (pwm) a nd one pulse mode (opm) bits are both set with folva = 0, the pwm mode is the only active one, otherwise the opm mode is the only ac- tive one. ? the value loaded in ocbr must always be greater than that in ocar to produce mean- ingful waveforms. note that 0000h is consider ed to be greater than fffch or fffdh or fffeh or ffffh. ? when ocar > ocbr, no waveform will be generated. figure 53. pulse width modulation mode cycle oc i r value = t * f apb t presc - 5 counter counter is reset to fffch ocmpa = olvlb counter = ocbr ocmpa = olvla when when = ocar 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 322/401 ? when ocbr = ocar, a square waveform with 50% duty cycle will be generated as in figure 54 . ? when ocbr and ocar are loaded with fffc (the counter reset value) then a square wave- form will be generated & the counter will remain stuck at fffc. the period will be calculated using the following formula: ? when ocar is loaded with fffc (the counter reset value) then the waveform will be gen- erated as in figure 54 . ? when folva bit is set and pwm bit is set, then pwm mode is the active one. but if folvb bit is set then the olvlb bit will appear on ocmpb (when ocbe bit = 1). ? when a write is performed on cntr register in pwm mode, then the counter will be reset and the pulse-width/period of the waveform generated may not be as desired. period t cpu presc 1 + () ocbr 1 + () ?? = 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 323/401 figure 54. pulse width modulation mode timing counter 34e2 fffc fffd fffe 2ed0 2ed1 2ed2 34e2 fffc olvlb olvlb olvla ocmpa compare b compare a compare b note: ocar = 2ed0h, ocbr = 34e2, olvla = 0, olvlb = 1 counter 000f 0010 fffc 0010 fffc olvla olvla olvlb ocmpa note: ocar = ocbr = 0010h, olvla = 1, olvlb = 0 0010 fffc counter 0003 0004 fffc olvla olvlb ocmpa note: ocar = fffch, ocbr = 0004h, olvla = 1, olvlb = 0 0003 0004 fffc olvla olvlb 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 324/401 21.3.8 pulse width modulation input the pwm input functionality enables the meas urement of the period and the pulse width of an external waveform. the initial edge is programmable. it uses the two input capture registers and the input signal of the input capture a module. 21.3.8.1 procedure the cr2 register must be programmed as needed for interrupts and dmas. to use pulse width modulation mode select the following in the cr1 register: ? set the pwmi bit ? select the first edge in iedga ? select the second edge iedgb as the negated of iedga ? program the clock source and prescaler as needed ? enable the counter setting the en bit. to have a coherent measure the interrupt/dma should be linked to the input capture a interrupt, reading in icar the period value and in icbr the pulse width. to obtain the time values: where: f apb = apb clock frequency t presc = timer clock prescaler: (cc7..cc0)+1 the input capture a event causes the counter to be initialized to 0000h, allowing a new measure to start. the first input capture on icapa do not generate the corresponding interrupt request. period = icar * f apb t presc pulse = icbr * f apb t presc 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 325/401 note all formulas in this chapter assume that apb_clk is the clock driving the eft. if external clock (f ext ) is selected, replace (f apb / t presc ) by f ext ., where t presc = (cc7..cc0 + 1). 21.4 register description each timer is associated with two control and one status registers, and with six pairs of data registers (16-bit values) relating to the two input captures, the two output compares, the counter. every register can have only an access by 16 bits, that means is not possible to read or write only a byte. input capture a register (icar) address offset: 00h reset value: xxxxh this is a 16-bit read only register that contains the counter value transferred by the input capture a event. figure 55. pulse width modulation input mode timing 1514131211109 87654321 0 msb lsb rrrrrrr rrrrrrrr r counter 34e2 0000 0001 2ed0 2ed1 2ed2 34e2 0000 icapa capture a capture b capture a 0002 period = icapa pulse length = icapb capture a, period measurement, reset counter interrupt capture b, pulse width measurement 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 326/401 input capture b register (icbr) address offset: 04h reset value: xxxxh this is a 16-bit read only register that contains the counter value transferred by the input capture b event. output compare a register (ocar) address offset: 08h reset value: 8000h this is a 16-bit register that contains the value to be compared to the cntr register and signalled on ocmpa output. output compare b register (ocbr) address offset: 0ch reset value: 8000h this is a 16-bit register that contains the value to be compared to the cntr register and signalled on ocmpb output. 1514131211109 87654321 0 msb lsb rrrrrrr rrrrrrrr r 1514131211109 87654321 0 msb lsb rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1514131211109 87654321 0 msb lsb rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 327/401 counter register (cntr) address offset: 10h reset value: fffch this is a 16-bit register that contains the counter value. control register 1 (cr1) address offset: 14h reset value: 0000h bit 15 = en : timer count enable 0: timer counter is stopped. 1: timer counter is enabled . bit 14 = pwmi : pulse width modulation input 0: pwm input is not active. 1: pwm input is active. bit 13:12 = reserved. these bits must be always written to 0. bit 11 = folvb : forced output compare b 0: no effect. 1: forces olvlb to be copied to the ocmpb pin. bit 10 = folva : forced output compare a 0: no effect. 1: forces olvla to be copied to the ocmpa pin. bit 9 = olvlb : output level b this bit is copied to the ocmpb pin whenev er a successful comparison occurs with the ocbr register and ocbe is set in the cr2 regi ster. this value is copied to the ocmpa pin in one pulse mode and pulse width modulation mode. bit 8= olvla : output level a the olvla bit is copied to the ocmpa pin whenever a successful comparison occurs with the ocar register and the ocae bit is set in the cr2 register. 1514131211109 87654321 0 msb lsb rrrrrrr rrrrrrrr r 1514131211109 87654321 0 en pwmi reserved folvb folva olvlb olvla ocbe ocae opm pwm iedgb iedga exedg ecken rwrw - rwrwrw rwrwrwrwrwrwrwrw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 328/401 bit 7= ocbe : output compare b enable 0: output compare b function is enabled, but the ocmpb pin is a general i/o. 1: output compare b function is enabled, the ocmpb pin is dedicated to the output compare b capability of the timer. bit 6= ocae : output compare a enable 0: output compare a function is enabled, but the ocmpa pin is a general i/o. 1: output compare a function is enabled, the ocmpa pin is dedicated to the output compare a capability of the timer. bit 5 = opm : one pulse mode 0: one pulse mode is not active. 1: one pulse mode is active, the icapa pin can be used to trigger one pulse on the ocmpa pin; the active transition is given by the iedga bit. the length of the generated pulse depends on the contents of the ocar register. bit 4 = pwm : pulse width modulation 0: pwm mode is not active. 1: pwm mode is active, the ocmpa pin outputs a programmable cyclic signal; the length of the pulse depends on the value of ocar register; the period depends on the value of ocbr register. bit 3 = iedgb : input edge b this bit determines which type of level transi tion on the icapb pin will trigger the capture. 0: a falling edge triggers the capture. 1: a rising edge triggers the capture. bit 2 = iedga : input edge a this bit determines which type of level transi tion on the icapa pin will trigger the capture. 0: a falling edge triggers the capture. 1: a rising edge triggers the capture. bit 1 = exedg : external clock edge this bit determines which type of level transition on the external clock pin (or internal signal) extclk will trigger the counter. 0: a falling edge triggers the counter. 1: a rising edge triggers the counter. bit 0 = ecken : external clock enable 0: internal clock, divided by prescaler di vision factor, is used to feed timer clock. 1: external source is used for timer clock . 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 329/401 control register 2 (cr2) address offset: 18h reset value: 0001h bit 15 = icaie : input capture a interrupt enable 0: no interrupt on input capture a. 1: generate interrupt if icfa flag is set. bit 14 = ocaie : output compare a interrupt enable 0: no interrupt on ocfa set. 1: generate interrupt if ocfa flag is set. bit 13 = toie : timer overflow interrupt enable 0: interrupt is inhibited. 1: a timer interrupt is enabled whenever the tof bit of the sr register is set. bit 12= icbie : input capture b interrupt enable 0: no interrupt on input capture b. 1: generate interrupt if icfb flag is set. bit 11 = ocbie : output compare b interrupt enable 0: no interrupt on ocfb set. 1: generate interrupt if ocfb flag is set. bit 10:8 = reserved. these bits must be always written to 0. bit 7:0 = cc7-cc0 : prescaler division factor this 7-bit string is the factor used by the presca ler to divide the internal clock. timer clock will be equal to f apb / cc7 cc0. 1514131211109 87654321 0 icaie ocaie toe icbie ocbie reserved cc7 cc6 cc5 cc4 cc3 cc2 cc1 cc0 rw rw rw rw rw - rw rw rw rw rw rw rw rw 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 330/401 status register (sr) address offset: 1ch reset value: 0001h bit 15= icfa : input capture flag a 0: no input capture (reset value). 1: an input capture has occurred. to clear this bit, write the sr register, with a ?0? on the bit 15 (and ?1? in all the other bit, just to avoid an unwanted clearing of another pending bit). bit 14= ocfa : output compare flag a 0: no match (reset value). 1: the content of the counter has matched the content of the ocar register. this bit is not set in the pwm mode even if counter matches ocar. to clear this bit, write the sr register, with a ?0? on the bit 14 (and ?1? in all the other bit, just to avoid an unwanted clearing of another pending bit). bit 13= tof : timer overflow 0: no timer overflow (reset value). 1:the counter rolled over from ffffh to 0000h. to clear this bit, write the sr register, with a ?0? on the bit 13 (and ?1? in all the other bit, just to avoid an unwanted clearing of another pending bit). bit 12= icfb : input capture flag b 0: no input capture (reset value). 1: an input capture has occurred.to clear this bit, write the sr register, with a ?0? on the bit 12 (and ?1? in all the other bit, just to avoid an unwanted clearing of another pending bit). bit 11= ocfb : output compare flag b 0: no match (reset value). 1: the content of the counter has matched the content of the ocbr register. it is set in pwm mode too. to clear this bit, write the sr register, with a ?0? on the bit 11 (and ?1? in all the other bit, just to avoid an unwanted clearing of another pending bit). 1514131211109 87654321 0 icfa ocfa tof icfb ocfb reserved rc rc rc rc rc - 1 .com .com .com .com .com 4 .com u datasheet
STR720 - extended function timer (eft) 331/401 21.4.1 register map a summary of the eft registers is given in the following table. refer to table 20 on page 49 for the base address. table 69. extended function timer register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 icar input capture a 4 icbr input capture b 8 ocar output compare a c ocbr output compare b 10 cntr counter value 14 cr1 en pwmi reserved folvb folva olvlb olvla ocbe ocae opm pwm iedgb iedga exedg ecken 18 cr2 icaie ocaie toe icbie ocbie reserved cc7 cc6 cc5 cc4 cc3 cc2 cc1 cc0 1c sr icfa ocfa tof icfb ocfb reserved 1 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 332/401 22 ?? analog/digital converter (adc) 22.1 introduction the adc is used in STR720 to measure signal strength and other slowly-changing signals. four input channels are supported, which can be converted in single channel or round robin mode. 22.2 main features  11.5 bits enob resolution (effective number of bits)  0 to 2.5v input range  4 input channels  oversampling clock (f mod ) 4 mhz max.  input bandwidth 977 hz max.  input sampling frequency ( f s ) 1953 hz max.  conversion time (ts) = 1/ (f mod /512) 22.3 functional description the adc consists of a four-channel single-b it sigma-delta modulator with a 512-sample sinc 3 digital filter and a bandgap voltage reference. a block diagram of the converter is shown below in figure 56 . figure 56. sigma-delta block diagram sinc 3 filter ? modulator input1 output reference slow_ref slow_mod vcm vref vcm vref prescaler control/ status ch0 data ch2 data ch1 data ch3 data data bus irq registers input2 input3 input4 1 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 333/401 22.3.1 normal (round-robi n) operation of adc in its normal mode of operation, the converter samples each input channel for 512 cycles of the over-sampling clock. in the first clock cycle, the ?? modulator is reset and the digital filter cleared. the remaining 1-bit samples from the modulator are filtered by the sinc 3 filter and a 16 bit output sample supplied to the relevant data register after 512 clock cycles, the period over which the sinc 3 filter has filled up and settled down. the channel select will then switch to the next input channel, the reset will again be asserted on the first clock cycle, and the filter will again fill up over 512 cycles to produce a sample. this process will be repeated for each of the channels continually in a round-robin fashion. 22.3.2 single-channel operation when sampling a single channel, that channel alone will be selected as input to the analog signal to the sigma-delta modulator. the functionality of the converter will remain the same as above in that the converter will be reset every 512 cycles, once a valid sample is produced. however, to maintain the same output frequency of the converter, only one of these samples will be taken out of every four, thus a valid sample for the channel will be produced every 2048 oversampling clock cycles, as in normal operations. 22.3.3 low-rate operating mode in case the required sample rate is particularly low, a special decimation mode can be used to overcome the limitation of prescaler configurations. this mode is selected by setting dec bit of adcsr register. in this way the oversampling factor becomes 5120 instead of 512 and a valid sample for a given channel will be produced each 20480 oversampling clock cycles, instead of 2048. 22.3.4 interrupt and dma requests an active-high interrupt/dma request flag wi ll be set depending on the mode of operation. in round-robin channel selection mode, the interrupt flag will be set when all data available ( da ) flags in the control register are set, and all the interrupt enables ( ie ) are also set. in this way the interrupt/dma request (depending on which function is currently enabled) will be activated when all channels have been conv erted and their values are stored in the corresponding data registers. the interrupt/dma request is deasserted when all data registers are read, this being the typical response of a dma controller, or when ?0? is written in all da bits of adccsr register, this last case being typical of an interrupt response routine. it must be noticed that in order to work properly in this configuration all interrupt enable bits need to be set. in single channel mode, the interrupt flag will be set when the data available flag and the interrupt flag for the selected channel are set. the interrupt request is deasserted by reading the data register associated to the selected channel (dma response) or writing ?0? in the corresponding da bit of adccsr register (interrupt response). in order to have a proper single-channel interrupt/dma request, besides selecting the single-channel mode and configuring which channel is to be converted using axt and a[1:0] bits in adccsr register, the corresponding interrupt enable bit needs to be set as well. 1 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 334/401 22.3.5 clock timing the sigma-delta modulator must run at a clock frequency ( f mod , oversampling rate) not greater than 4 mhz. the registers in this converter are clocked by the apb clock. double clocked synchronization for data crossing cloc k boundaries avoids any metastability issue. it is up to the user to correctly program the prescaler, to generate the correct oversampling frequency based on the apb frequency: where: presc = value written in prescaler register ( adccpr ) fapb = apb bus clock frequency fs = sampling frequency in case the low-rate operation mode is selected, the formula above becomes: as an example, if apb clock frequency is 33 mh z and required sampling frequency is 100 hz, adccpr register should be configured by writing 80 into it using the normal decimation mode. the same prescaler value, using low-rate decimation mode, would produce a sampling rate of 10 hz. note if the prescaler is set to generate a sampling frequency greater than specified, conversion performance is not guaranteed. 22.3.6 ?? modulator the ?? modulator used is a single-bit design, second-order feedback architecture modulator including two integrators, two summing junctions and a comparator. the gains m1?m4 are set by capacitor ratios in the integrators. figure 57. modulator architecture presc fapb fs 512 8 ?? -------------------------- - = presc fapb fs 5120 8 ?? ----------------------------- - = m2 m4 m1 m3 1 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 335/401 22.3.7 the sinc 3 decimation filter the single-bit bitstream in output from the ?? modulator is fed to a sinc 3 digital filter which filters the modulator bitstream output and decimates the sample rate to f s . the sinc 3 z-domain transfer function is: with n = 171 in the case of STR720 device. can be also conveniently represented as the product of three functions of the kind: where {n=0,1, 2} is given by: is therefore the product of three low-pass filters of 171 taps each and with zeros evenly spread from 0 to f mod (modulator sampling frequency) in the frequency domain. since, in the discrete time domain, the impulse response inverse z-transform of is given by the convolution: the total number of taps of is . the normal implementation of this filter is shown below in figure 3. the transfer function is decomposed into iir and fir sections ? the iir section (consisting of 3 integrators) runs at the full oversampling clock rate while the fir section (with 3 differentiators) runs at the decimated rate. figure 58. sinc 3 digital filter hz () hz () 1 n 3 ------ 1 z n ? ? 1 z 1 ? ? ---------------- - 3 = hz () hz () h 1 h 2 h 3 = h n z () h n z () 1 n --- - 1 z n ? ? 1 z 1 ? ? ---------------- - 1 n --- - z n ? 1 z 1 ? z 2 ? z n 1 ? () ? ++++ () = n 0 = n 1 ? = = hz () h n z () n 171 = hn () hz () hn () h 1 h 2 h 3 ?? () = hn () 3 n 2 ? 511 = /171 i/p o/p 1 1 z 1 ? ? ----------------- 1 z n ? ? single bit 16 bit 1 1 z 1 ? ? ----------------- 1 1 z 1 ? ? ----------------- 1 z n ? ? 1 z n ? ? 1 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 336/401 the frequency response of the sinc 3 filter is shown in figure 59 and figure 60 below. figure 59. sinc 3 frequency response figure 60. sinc 3 frequency response - detail ?400 ?350 ?300 ?250 ?200 ?150 ?100 ?50 0 normalized frequency response ? h(z)=[1/171*(1?z ?171 )/(1?z ?1 )] 3 frequency [ ] |h(z)| [db] 0 /4 /2 3 /4 ?400 ?350 ?300 ?250 ?200 ?150 ?100 ?50 0 normalized frequency response ? h(z)=[1/171*(1?z ?171 )/(1?z ?1 )] 3 frequency [ ] |h(z)| [db] 0 2 /171 4 /171 6 /171 8 /171 10 /171 1 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 337/401 the word lengths needed in each integrator and differentiator are given by the formula b=3log2(n) + 1 . this gives a maximum word length of 21 bits for the internal registers. as the output is only 16 bits, the lsbs are discarded. note only the 12 most significant bits out of this 16 bits are guaranteed to be accurate according to the device specification, even if all 16 bits can be read. since the first zero of the decimation filter is located at while the first replica of the spectrum of the modulator after decimation is located at: care must be taken to ensure that the nyquist criterion is respected to avoid alias, i.e.: the description above refers to the operations in normal decimation mode. when low-rate decimation mode is selected, the registers in the decimated section will be updated when the count gets to 1700 instead of 170 and the world length of the registers will be 33 bits instead of 23, the final value containing bits 33:18 of the final differentiator. the reset of the filter will occur every 5120 cycles instead of every 512. 22.3.8 bandgap reference an on-chip bandgap reference generates a 1.22 v reference. this is used to generate two voltages used by the modulator ? v cm & v ref . v cm is designed to be 1.25 v, the midpoint of the converter?s voltage range and v ref is the feedback reference, 1.74 v. as the bandgap reference is not trimmed, absolute values of v cm & v ref could be inaccurate by up to 5%. this will lead to gain and offset errors in the converter which can be calibrated out digitally if necessary. to calibrate the converter it is necessary to input the minimum and maximum inputs supported ? 0 v and 2.5 v. the digital output for a 0 v input is the offset and the gain of the converter is given by: the offset and gain correction factors can be stored digitally and applied to all outputs from the converter, for all four input channels. 2 171 -------- - = 2 2048 ----------- - = f s f nyq 2 f max = g 2.5 voutput 0 voutput ? () 2.5 --------------------------------------------------------------- - = .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 338/401 22.3.9 adc input equivalent circuit the input equivalent circuit, due to the switching at f mod rate of the input capacitance where the charge taken from the input signal to be measured is stored, can be represented as follows: where v s is the voltage under measurement, r s is the output resistance of the source, v pin the voltage the will actually converted and r in the input equivalent resistance of the adc. r in is inversely proportional to the modulator ov ersampling clock and the constant k is equal to 540 [k ? ][mhz] +/- 20%. 22.3.10 adc output coding the ?? converter produces a digital sample of each analog input channel every 512 oversampling clocks (5120 when low-rate mode is selected). the digital samples in output from the sinc 3 digital filter are stored in the four adcdatan registers as 16-bit samples of which only the first 12 most significant bits are meaningful. the converted value stored in adcdata[n] is a signed two?s complement value and proportional to the difference (v in -v cm ), being ideally 0 if the input voltage were v in = v cm . since the gain and offset errors previously described, before actually using the result of the conversion calibration must be performed. note the analog input voltage should not exceed twice the center voltage of the - ? modulator (2 * v cm ) otherwise converter performances cannot be guaranteed. remember that the v cm voltage has an accuracy of +/- 5% which imposes a calibration of the converter. figure 61. adc input equivalent circuit v cm + r in = k * 1/f mod v s + r s v pin .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 339/401 22.3.11 power saving features the analog circuitry of the adc block is switched off when bit ?adc_off? in the agcr register is reset (see section 24.2: a-gcr block description on page 351 ), allowing the power consumption via av dd / av ss pins to be minimized (< 1 a). due to the fact that the analog section of adc is used also to generate reference currents for the proper operation of clock input pads, it is recommended to disable the adc by software only after having switched to a low power mode that is not using clock input pads, as slow or stop mode (see section 25: power reduction modes on page 364 ). the digital section of adc block can be stopped by using the ordinary clock gating features, provided on the device. note that on power-up, or after switching on ?adc_off? bit, the common-mode feedback circuit can take about 30 oversampling clock cycles to drive the common-mode voltage to its correct value. for this reason, the first sample should be discarded after activating adc block. 22.4 register description adc control/status register (adccsr) address offset: 20h reset value: 0000h this register controls the operating mode of the adc, sets the interrupt enables, contains status flags for the availability of data and error flags in the event of data being overwritten before being read. bit 15 = reserved. this bit should be written as ?0? and will be read always at ?0?. bit 14 = dec : decimation factor this bit selects the decimation mode between normal mode and low-rate mode, where same prescaler value can be used to reach very low sampling rates. 0: normal mode, decimation by 512. 1: low-rate mode decimation by 5120. bit 13 = or : overrun this read-clear bit is used to notify ap plication software that data on one of the channels has been overwritten before being read. 0: normal operation. no overrun has occurred. 1: overrun event occurred. this bit is set by hardware as soon as an overrun condition is detected and must be cleared by software by explicitly writing it to ?0?. writing ?1? into this bit has no effect. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 res. dec or res ie[3:0] res. axt a[1:0] da[3:0] - w rc - rw - rw rw rc .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 340/401 bit 12 = reserved. this bit should be written as ?0? and will be read always at ?0?. bits 11:8 = ie[3:0] : interrupt enable this set of bits allows to enable interrupt requests independently for each of the adc channels, where bit ie[n] corresponds to adc channel n. 0: channel n interrupt disabled. 1: channel n interrupt enabled. bit 7 = reserved. this bit should be wri tten as ?0? and will be read always at ?0?. bit 6 = axt : addressing external enable this bit allows to enable the single-channel operation, configuring the adc to convert repeatedly the channel identified by a[1:0] bits of this register. 0: round-robin addressing enabled. 1: single-channel addressing enabled. bits 5:4 = a[1:0] : channel address these bits select the external channel to be sampled when external addressing is enabled. bits 3:0 = da[3:0] : data available this read-clear set of bits allows to determine on which channel data register a new sample is ready to be read, where bit da[n] corresponds to adc channel n. they are set by hardware as soon as a new sample on the corresponding channel is available and they can be cleared explicitly by writing them to ?0? or indirectly when the corresponding data register is read. writing ?1? into these bits has no effect. 0: no sample is available on the corresponding channel. 1: new sample available on the corresponding channel. these bits also act as interrupt flags for the corresponding channels. .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 341/401 adc clock prescaler register (adccpr) address offset: 30h reset value: 0006h bits 15:7 = reserved. these bits should be always written as ?0?. bits 6:0 = presc[6:0] : prescaler value the 7 bit binary value specified on the clock prescaler register determines the factor by which the adc input clock will be divided down in order to produce the oversampling clock of the sigma-delta modulator, the actual factor being twice the presc register value as illustrated in table 70 on page 341 . the value placed in this register must subsequently generate an oversampling clock frequency not greater than 4 mhz from the master clock applied to the adc. these bits can only be written by software, any read operation on them returns 0h. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved presc[6:0] -w table 70. adc prescaler setting setting divide factor 0 not available (adc frozen) 1 not available (adc frozen) 24 36 48 .. .. 126 252 127 254 .com .com .com .com .com 4 .com u datasheet
STR720 - s-d analog/digital converter (adc) 342/401 adc data register n, n = 0 .. 3 (adcdatan) address offsets: 00h, 08h, 10h, 18h reset values: 0000h four data registers, one for each of the analogue input channels, are available. the 12 most significant bits will contain the result of the conversion, while the least significant bits of each register should be ignored. values reported in data registers are expressed in 2?s complement notation. the data registers will be filled in numerical sequence in the round-robin channel mode. in single channel mode, only the selected channel will be updated. bit 15:0 = data[15:0]: data sample this read-only register contains the last sampled value on the corresponding channel. 22.4.1 register map refer to table 20 on page 49 for the base address. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 data[15:0] r table 71. adc register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 00 adcdata0 data[15:0] 08 adcdata1 data[15:0] 10 adcdata2 data[15:0] 18 adcdata3 data[15:0] 20 adccsr reserved or res. ie[3:0] res. axt a[1:0] da[3:0] 28 reserved 30 adccpr reserved presc[7:0] .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 343/401 23 general purpose i/o ports 23.1 introduction the general purpose io port are programmable by software in several conditions: input, output, alternate function, open drain, push-pull, weak push-pull and high impedance. each port is configured in input (pc0=0, pc1=1, pc2=0, see table 72 on page 344 ) during the reset phase. warning : being each gpio pin configured in input during reset phase, the io pins are released to high impedance condition. to avoid power consumption the user has to drive the ios to stable levels. 23.2 main features data input /output alternate function cmos input push-pull output open drain output weak push-pull output full software programmability 23.3 functional description the general purpose io port has three configuration registers (pc0,pc1,pc2) and one io data register (pd). all the allowed port configurations, set by programming of the configuration registers are summarized in table 72 on page 344 , where the index (n) is a generic io bit. a writing access to the io data register always loads the data in the output latch.the output latch holds the data to be sent out while the input latch captures the data present on the io pin. a reading access to the io data register can read the input latch or the output latch according to the port configuration (see later). .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 344/401 the figure 62 on page 344 shows the basic structure of the general purpose io port bit. table 72. port bit configuration table (*) refer to the device electrical characteristics the configuration pc0(n)-pc1(n)-pc2(n)=000 is reserved and the user should not use it. in this config- uration the correspondent pin enters the high impedance state. the configuration pc0(n)pc1(n)pc2(n)=100 and 010 configure the correspondent pin in the same state: input, tristate, cmos. figure 62. basic structure of an i/o port bit pc0(n) 01010101 pc1(n) 00110011 pc2(n) 00001111 p(n) configuration re- serv ed in inout out out af af p(n) output tri tri wp od pp od pp p(n) input - cmos cmos cmos cmos cmos cmos notes: hi: high impedance od: open drain ain: analog input pp: push-pull in: input wp: weak push-pull ou: output tri: tristate inout: bidirectional cmos : cmos standard input(*) af: alternate function i/o pin i/o port register alternate function (out) alternate function (in) push-pull tristate open drain weak push-pull cmos input latch output latch .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 345/401 23.3.1 input configuration when the io port is programmed as input: the output buffer is forced tristate the data present on the io pin is sampled into the input latch every clock cycle a reading access to the data register gets the value in the input latch. the figure 63 on page 345 shows the input configuration of the io port bit. 23.3.2 bidirectional configuration when the io port is programmed as bidirectional: the output buffer is turned on in weak pull configuration ( port2 ) the output buffer is turned on in weak push configuration ( port3, port4 ) a reading access to the io data register gets the input latch value. figure 63. input configuration i/o pin i/o port data register alternate function (out) alternate function (in) tristate cmos input latch output latch .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 346/401 the figure 64 on page 346 and figure 65 on page 346 show the bidirectional configuration of the io port. figure 64. bidirectional configuration (port2) figure 65. bidirectional configuration (port3, port4) i/o pin i/o port data register alternate function (out) alternate function (in) input latch output latch weak pull i/o pin i/o port data register alternate function (out) alternate function (in) input latch output latch weak push .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 347/401 23.3.3 output configuration when the io port is programmed as output: the output buffer is turned on in open drain or push-pull configuration the data in the output latch drives the io pin a reading access to the io data register gets the output latch value. the figure 66 on page 347 shows the output configuration of the io port bit. 23.3.4 alternate function configuration when the io port is programmed as alternate function: the output buffer is turned on in open drain or push-pull configuration the output buffer is driven by the signal comi ng from the peripheral (alternate function out) the data present on the io pin is sampled into the input latch every clock cycle a reading access to the data register gets the value in the input latch. figure 66. output configuration i/o pin i/o port data register alternate function (out) alternate function (in) input latch output latch open drain push-pull .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 348/401 the figure 67 on page 348 shows the alternate function configuration of the io port bit. 23.4 register description the ioport registers can not be accessed by byte. port configuration register0 (pc0) address offset: 00h reset value: (*) bit 15:0 = c0[15:0]: port configuration bits see table 72 on page 344 to configure the io port. figure 67. alternate function configuration 1514131211109 87654321 0 c015 c014 c013 c012 c011 c010 c09 c08 c07 c06 c05 c04 c03 c02 c01 c00 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw i/o pin i/o port data register alternate function (out) alternate function (in) input latch output latch open drain push-pull .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 349/401 port configuration register1 (pc1) address offset: 04h reset value: (*) bit 15:0 = c1[15:0]: port configuration bits see table 72 on page 344 to configure the io port. port configuration register2 (pc2) address offset: 08h reset value: (*) bit 15:0 = c2[15:0]: port configuration bits see table 72 on page 344 to configure the io port. io data register (pd) address offset: 0ch reset value: (*) bit 15:0 = d[15:0]: io data bits a writing access to this register always writes the data in the output latch. a reading access reads the data from the input latch in input and alternate function configurations or from the output latch in output and high impedance configurations. (*) refer to the device io pin list 1514131211109 87654321 0 c115 c114 c113 c112 c111 c110 c19 c18 c17 c16 c15 c14 c13 c12 c11 c10 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1514131211109 87654321 0 c215 c214 c213 c212 c211 c210 c29 c28 c27 c26 c25 c24 c23 c22 c21 c20 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw 1514131211109 87654321 0 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw .com .com .com .com .com 4 .com u datasheet
STR720 - general purpose i/o ports 350/401 23.4.1 register map the following table summarizes the registers implemented in the io port macrocell. refer to table 20 on page 49 and table 21 on page 50 for the base addresses. table 73. io-port register map addr. offset register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 pc0 c0[15:0] 4 pc1 c1[15:0] 8 pc2 c2[15:0] c pd d[15:0] .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 351/401 24 miscellanea registers (gcr - cgc - ahb_err) 24.1 introduction this section collects the registers setting all the aspects of STR720 which can be configured by software. hereafter the specification of a-gcr, s-gcr and cgc blocks can be found, allowing application software to select between different functional options, to check the status of relevant internal configuration signals and to control clock and reset lines of most of internal peripherals. at the end of this section, the specification of the ahb error detection block is reported. 24.2 a-gcr block description this block contains the configuration settings related to the peripherals connected to the a-apb subsystem. a-apb global configuration register 1 (agcr1) address: 0xe000_1000 reset value: 0x0000 bit 15:3 = reserved. these bits must be always written to 0. bit 2 = adc_stop : adc stop mode this bit can temporarily stop sampling operation of the analog to digital converter block without affecting the programming of its configuration registers. 0: adc is operating normally. 1: adc operations are stopped. bit 1 = reserved. this bit must be always written to 0. bit 0 = adc_off : adc analog section off this bit controls the activation of the whole analog section contained in the adc module, where also internal current references used fo r clock pad are generated. when this bit is set to ?1? all the analog circuitry in the adc module is switched off. 0: adc analog section is switched on. 1: adc analog section is switched off. note be careful on setting adc_off bit since it switches off the current references used by clock pad and in this condition no clock signal can be supplied to the device through clk pad. if this configuration is required for extreme power reduction purposes, STR720 must be put in slow mode before setting adc_off bit, otherwise the system will stop responding up to the next hardware reset event. 1514131211109 87654321 0 reserved adc_ stop res. adc_ off -rw-rw .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 352/401 24.3 s-gcr block description this block contains the configuration settings related to the peripherals connected to the s-apb subsystem and to the whole device. s-apb global configuration register 1 (sgcr1) address: 0xf000_0c00 reset value: 0x0000 this register collects all software controllable configuration bits. bit 15:6 = reserved. these bits must be always written to 0. bit 5 = cache_conf : cache configuration selection this bit can configure sdram interface to work in ?burst-access? mode and must be used whenever cache is enabled, so to have optimal performance from the system. 0: normal access mode, to be used when arm720t cache is disabled. 1: burst-access mode, to be used when arm720t cache is enabled. note for further details and limitation of ?burst-access? mode usage see section 10.5: programming considerations on page 114 , in dram controller chapter. bit 4:3 = reserved. these bits must be always written to 0. bit 2 = eic_sres : eic soft reset this bit triggers a synchronous reset of the internal sequential logic of enhanced interrupt controller, leaving priority registers unaffected. it can be useful to recover some tricky situations occurring inside the eic state machines without requiring full reconfiguration of eic registers (see section 7.6: application note on page 67 ). 0: eic is operating normally. 1: eic logic is kept under synchronous reset. bit 1 = p7as : port7 access selection this bit selects which interface is using port 7 pins which can be shared between emi and ide, for example to access external flash banks during system boot and then switch to cd-rom access to complete system start-up. 0: emi interface uses port 7 pins. 1: ide interface uses port 7 pins. bit 0 = brm : boot remap this bit selects which memory area is mapped in the address range from 0x0000_0000 to 0x1fff_ffff (block 0) and it is used to conc lude the boot phase when internal ram has been loaded with its required contents 0: reserved rom or emi area is mapped on block 0 (see ext_boot bit in sgcr2 register). 1: prog_ram area is mapped on block 0. 1514131211109 87654321 0 reserved cache _conf reserved eic_ sres p7as brm - rw - rw rw rw .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 353/401 s-apb global configuration register 2 (sgcr2) address: 0xf000_0c04 reset value: 0x00xx this register collects internal configuration signals status so that application software can check them, if required. this is a read-only register. bit 15:1 = reserved. these bits will be always read back as ?0?. bit 0 = ext_boot : external boot this bit reports the status of p3.8 pin at rstin rising edge, which is used to configure the boot mode of the device, selecting if reset vector is fetched from emi address space. after reset rising edge p3.8 can change its value, according to application requirements, but boot mode cannot be changed unless a new hardware reset is applied to the device. 0: reserved rom mode. 1: STR720 boots from external emi area. s-apb global configuration register 3 (sgcr3) address: 0xf000_0c08 reset value: 0x0000 this register configures the dma request assignment to the available dma streams. bit 15:8 = reserved. these bits must be always written to 0. bit 7:6 = st3_sel[1:0]: dma stream3 selection this bit field selects which dma-capable perip heral is associated to dma stream 3 request: 00: bspi1 transmit dma request 01: adc sample ready request. 10: reserved. this value should never be used. 11: reserved. this value should never be used. bit 5:0= reserved. these bits must be always written to 0. 1514131211109 87654321 0 reserved ext_ boot -r 1514131211109 87654321 0 reserved st3_sel reserved -rw- .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 354/401 24.4 cgc block description the cgc block enables to configure the ahb and s-apb peripheral clock and reset lines so as to individually control each of them. the specific clock signals used by ide and usb can be controlled using dedicated registers implem ented in these cell. a set 16-bit registers is used to keep the clock gating and reset line state configuration for each of the controlled peripherals. cgc peripheral clock gating register 1 (cgc-pcg1) address: 0xf000_2c00 reset value: 0x0023 this register configures cloc k gating for each of the controlled ahb/s-apb peripherals. each peripheral can be used only when its corresponding gating bit is cleared. bits 15:12, 9:8, 4 = reserved. these bits must be always written to 0. bits 11:10, 7:5, 3:0 = pxco: peripheral x clock off 0: peripheral x clock is gated off and the block is not clocked. 1: peripheral x is clocked. the following table lists the correspondence between each controllable peripheral and the cgc-pcg1 register bits along with their reset value. 1514131211109 87654321 0 reserved p11co p10co reserved p7co p6co p5co res. p3co p2co p1co p0co - rw rw - rw rw rw - rw rw rw rw table 74. cgc-pcg1 bit assignment cgc-pcg1 bit affected peripheral reset status p0co emi on p1co dramc on p2co dmac off p3co atapi off p5co eic on p6co gpio-p3 off p7co gpio-p4 off p10co wiu off p11co rtc off .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 355/401 cgc peripheral under reset register 1 (cgc-pur1) address: 0xf000_2c04 reset value: 0x0023 this register configures the reset line status for each of the controlled ahb/s-apb peripherals. each peripheral can be used only w hen its corresponding reset line is not active. bits 15:12, 9:8, 4 = reserved. these bits must be always written to 0. bits 11:10, 7:5, 3:0 = pxur: peripheral x under reset 0: peripheral x is under reset. 1: peripheral x is operating normally. the following table lists the correspondence between each controllable peripheral and the cgc-pur1 register bits al ong with their reset value. 1514131211109 87654321 0 reserved p11ur p10ur reserved p7ur p6ur p5ur res. p3ur p2ur p1ur p0ur - rw rw - rw rw rw - rw rw rw rw table 75. cgc-pur1 bit assignment cgc-pur1 bit affected peripheral reset status p0ur emi operative p1ur dramc operative p2ur dmac under reset p3ur atapi under reset p5ur eic operative p6ur gpio-p3 under reset p7ur gpio-p4 under reset p10ur wiu under reset p11ur rtc under reset .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 356/401 cgc emulation register 1 (cgc-emu1) address: 0xf000_2c08 reset value: 0x0fff this register configures the status of clock gating for each of the controlled ahb/s-apb peripherals while the application program execution is stopped due to a debug request. each peripheral can be configured to stop work ing as the user code reaches a breakpoint. bits 15:12, 9:8, 4 = reserved. these bits must be always written to 0. bits 11:10, 7:5, 3:0 = pxem: peripheral x clock during emulation 0: peripheral x clock is gated off at a debug request, regardless from the state of the corresponding pxco bit. 1: peripheral x clock gating status is unaffected by debug requests, and it is always determined by its corresponding pxco bit. the following table lists the correspondence between each controllable peripheral and the cgc-emu1 register bits along with their reset value. 1514131211109 87654321 0 reserved p11em p10em reserved p7em p6em p5em res. p3em p2em p1em p0em - rw rw - rw rw rw - rw rw rw rw table 76. cgc-emu1 bit assignment cgc-emu 1 bit affected peripheral reset status p0em emi not affected by debug requests. p1em dramc not affected by debug requests. p2em dmac not affected by debug requests. p3em atapi not affected by debug requests. p5em eic not affected by debug requests. p6em gpio-p3 not affected by debug requests. p7em gpio-p4 not affected by debug requests. p10em wiu not affected by debug requests. p11em rtc not affected by debug requests. .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 357/401 cgc peripheral clock gating register 2 (cgc-pcg2) address: 0xf000_2c0c reset value: 0x0000 this register configures clock gating for each specific clock signal used by some blocks requiring dedicated clocks for their operations. each dedicated clock signal is delivered to the related peripheral only when its corresponding gating bit is cleared. bits 15:3 = reserved. these bits must be always written to 0. bits 2:1 = dxco: dedicated peripheral x clock off 0: peripheral x dedicated clock is gated off and the block kernel is not clocked. 1: peripheral x dedicated clock is delivered. bit 0 = reserved. this bit must be always written to 0. the following table lists the correspondence between each dedicated peripheral clock and the cgc-pcg2 register bits along with their reset value. 1514131211109 87654321 0 reserved d2co d1co res. -rwrw- table 77. cgc-pcg2 bit assignment cgc-pcg2 bit affected peripheral reset status d1co atapi-kernel off d2co usb-kernel off .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 358/401 cgc peripheral under reset register 2 (cgc-pur2) address: 0xf000_2c10 reset value: 0x0000 this register configures the reset line st atus for each of the peripheral kernels requiring a dedicated clock. each peripheral can be used only when its corresponding reset line is not active. bit 15:2 = reserved. these bits must be always written to 0. bit 1 = d1ur: dedicated peripheral 1 under reset 0: peripheral 1 is under reset. 1: peripheral 1 is operating normally. bit 0 = reserved. this bit must be always written to 0. the following table lists the correspondence between each controlled peripheral and the cgc-pur2 register bits al ong with their reset value. 1514131211109 87654321 0 reserved d1ur res. -rw- table 78. cgc-pur2 bit assignment cgc-pur2 bit affected peripheral reset status d1ur atapi-kernel under reset .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 359/401 cgc emulation register 2 (cgc-emu2) address: 0xf000_2c14 reset value: 0x001f this register configures the status of clock gating for each of the peripheral kernel requiring a dedicated clock, while the application program execution is stopped due to a debug request. each peripheral can be configured to stop wo rking as the user code reaches a breakpoint. bits 15:3 = reserved. these bits must be always written to 0. bits 2:1 = dxem: dedicated peripheral x clock during emulation 0: peripheral x dedicated clock is gated off at a debug request, regardless from the state of the corresponding dxco bit. 1: peripheral x dedicated clock gating status is unaffected by debug requests, and it is always determined by its corresponding dxco bit. bit 0 = reserved. this bit must be always written to 0. the following table lists the correspondence between each controllable peripheral and the cgc-emu2 register bits along with their reset value.. 1514131211109 87654321 0 reserved d2em d1em res. -rwrw- table 79. cgc-emu2 bit assignment cgc-emu2 bit affected peripheral reset status d1em atapi-kernel not affected by debug requests. d2em usb-kernel not affected by debug requests. .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 360/401 24.5 ahb error detection block description due to the specific implementation of arm720t ahb interface, any ahb transfer resulting in an error response from the addressed slave, is not detected directly by the core. detecting these events is particularly helpful duri ng application software debug, when due to an incorrect configuration some inconsistent memory access can be attempted. in order to detected these events a specific block is implemented, which monitors ahb activity and generates a fiq request to the core, storing the value of the address which caused the error response to be triggered. here are the few registers by which this block operation can be configured and used. ahb error pending (aerr_p) address: 0xf000_3000 reset value: 0x0000_0000 this register stores the pending bit which is set by hardware at the occurrence of an ahb error. the register is read-clear in the sens e that application software can only write ?0? into this bit, to acknowledge the detected error and re-enable ahb bus monitoring. writing ?1? into this register has no effect. bits 31:1 = reserved. these bits must be always written to 0. bit 0 = ae_p: ahb error pending 0: no ahb error detected. 1: an ahb transfer resulted into an error response. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved ae_p -rc .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 361/401 ahb error mask (aerr_m) address: 0xf000_3004 reset value: 0x0000_0000 this register allows application software to mask the fiq interrupt generation upon the detection of any ahb error, when such feature is not required. the block will still detect faulty transfers on the system bus, just the inter rupt generation is disabled. this register is read-write. bits 31:1 = reserved. these bits must be always written to 0. bit 0 = ae_m: ahb error mask 0: ahb error interrupts masked. 1: ahb error interrupts enabled. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 reserved - 1514131211109 87654321 0 reserved ae_m -rw .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 362/401 ahb error faulty address (aerr_fa) address: 0xf000_3008 reset value: 0x0000_0000 this register stores the address of the locati on whose access caused the ahb error response to be generated. when an ahb error is detected, the address of the faulty location is saved into this register and the ae_p bit in aerr_p register is set, causing a fiq interrupt request to be issued if ae_m bit in aerr_m register is set as well. as long as the ae_p bit is not clear by application software, this register will keep the stored address even if further ahb error response occur. this is a read-only register. bits 31:0 = aerr_fa: ahb error faulty address 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 aerr_fa[31:0] r 1514131211109 87654321 0 aerr_fa[31:0] r .com .com .com .com .com 4 .com u datasheet
STR720 - miscellanea registers (gcr - cgc - ahb_err) 363/401 24.5.1 register map in the following tables a summary of all system configuration register and ahb error detection block is reported. refer also to table 20 on page 49 and table 21 on page 50 . table 80. configuration register map addr. register name 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 e000 1000 agcr1 reserved adc_ stop res. adc_ off f000 0c00 sgcr1 reserved cache _conf reserved eic_ sres p7as brm f000 0c04 sgcr2 reserved ext_ boot f000 0c08 sgcr3 reserved st3_sel reserved f000 2c00 cgc-pgc1 reserved p11co p10co reserved p7co p6co p5co res. p3co p2co p1co p0co f000 2c04 cgc-pur1 reserved p11ur p10ur reserved p7ur p6ur p5ur res. p3ur p2ur p1ur p0ur f000 2c08 cgc-emu1 reserved p11em p10em reserved p7em p6em p5em res. p3em p2em p1em p0em f000 2c0c cgc-pgc2 reserved d2co d1co res. f000 2c10 cgc-pur2 reserved d1ur res. f000 2c14 cgc-emu2 reserved d2em d1em res. table 81. ahb error detector register map addr. register name 313029282726252423222120191817161514131211109876543210 f000 3000 aerr_p reserved ae _p f000 3004 aerr_m reserved ae _m f000 3008 aerr_fa aerr_fa[31:0] .com .com .com .com .com 4 .com u datasheet
STR720 - power reduction modes 364/401 25 power reduction modes the device contains a centralized clock management block (rccu) that provides the controlling software with a means to dynamically disable/enable the clocks to all the major blocks in the design. the power consumption of the device may thus be tailored to the required mode of operation. STR720 operating modes are completely under software control via the proper configuration of the rccu registers. this chapter describes each of them in detail. 25.1 run mode in this operating mode STR720 can be used at its maximum performance level, since main system clock can be programmed to reach the highest recommended frequency, either using directly clk input or using the on-chip pll. in the case in which on-chip pll is used, the following constraints must be taken into account. in the first place it must be considered that th e range of frequencies in which pll is able to lock goes from 9 mhz to 27 mhz. when clk input is driven with a signal whose frequency is above 27 mhz, div2 multiplexer must be always enabled for the on-chip pll to operate correctly. besides this, another constraint comes from the maximum limit of the internal pll vco frequency, which is required to be less than 1080 mhz. the value of vco oscillation frequency depends on the multiplication/division factors set in rccu configuration registers (m and d respectively) and the frequency of reference clock (clk or clk divided by 2 if div2 is enabled). the following formulas describe this relationship. depending on pll configuration. the possible system frequencies generated in run mode can be summarized by the following table, calculated for a generic 16 mhz clock signal supplied to clk input. in composing the table, pll configuration leading to the smaller current consumption have been chosen. table 82. run mode system frequencies (clk=16 mhz) pll multiplier / divider ahb / s-apb [mhz] a-apb min (f/16) a-apb max (f/2) atapi pll_off/byp 16.00 1.00 8.00 8.00 pll_byp 16.00 1.00 8.00 8.00 10 / 4 40.00 2.50 20.00 20.00 21 / 8 42.00 2.63 21.00 21.00 11 / 4 44.00 2.75 22.00 22.00 23 / 8 46.00 2.88 23.00 23.00 ... ... ... ... ... f vco 2 f ref m ?? = f out f vco 2 d ? ----------- = .com .com .com .com .com 4 .com u datasheet
STR720 - power reduction modes 365/401 after reset the rcc u is configured in run mode with pll switched off, pll_byp enabled and div2 disabled, so that the main system frequency at start-up is equal to clk input. to select the actual operating system frequency, the div2 multiplexer should be enabled first if the input clock frequency requires it, then pll should be switched on after having programmed its multiplying factor. the signal generated by pll can be selected as clock source disabling the pll_byp multiplexer but this operation should be performed only when pll is stable (about 200 s). a lock status bit can be used to detect pll status and switch to its clock only when lock condition is reached. any change of pll lock condition is registered in dedicated interrupt pending flags. if application requires to take immediate actions when pll lock condition is lost or achieved, an automatic pll bypass can be enforced each time the lock condition changes, switching to reference clock as soon as lock condition is lost and switching back to pll clock when lock condition is regained. this mechanism can be enabled by setting the autobyp_en flag. the pll should be switched-off before changing the multiply factor, using the reference clock during this transitory phase. for more detail about pll management see section 13.3.2: pll management on page 140 . during run mode, most of STR720 peripherals clocks can be independently switched on and off using pcg register s inside a-apb bridge, cgc block registers and a few sgcr1 register bits. in this way only the peripherals whose functionalities are required by the system need to be clocked, so the actual power consumption of the whole STR720 device can be adapted by software, according to application requirements and the exact current consumption is heavily dependent on which blocks are active and for how long. at system reset all of controlled peripherals are kept under reset with their clock signals switched off, except eic, emi and dramc which are required for system start-up. it is up to application software to enable the required peripherals. the following table summarizes the peripherals whose clock and reset lines can be controlled: 29 / 8 58.00 3.63 29.00 29.00 15 / 4 60.00 3.75 30.00 30.00 31 / 8 62.00 3.88 31.00 31.00 8 / 2 64.00 4.00 32.00 32.00 33 / 8 66.00 4.13 33.00 33.00 17 / 4 68.00 4.25 34.00 22.67 35 / 8 70.00 4.38 35.00 23.33 table 82. run mode system frequencies (clk=16 mhz) pll multiplier / divider ahb / s-apb [mhz] a-apb min (f/16) a-apb max (f/2) atapi .com .com .com .com .com 4 .com u datasheet
STR720 - power reduction modes 366/401 table 83. peripheral clock and reset gating block clock & reset gating reset status block clock & reset gating reset status arm720 not available on dmac cgc: p2co, p2ur off data ram not available on ide block cgc: d1co, d1ur off ide interface cgc: p3co, p3ur off sdramc cgc: p1co, p1ur on emi cgc: p0co, p0ur on s-apb bridge not available on a-apb bridge not available on agcr not available on sgcr not available on rccu not available on cgc not available on wiu cgc: p10co, p10ur off eic cgc: p5co, p5ur on gpio - p3 cgc: p6co, p6ur off gpio - p4 cgc: p7co, p7ur off usb a-apb: p11co, p11ur cgc: d2co off uart1 a-apb: p5co, p5ur off can a-apb: p10co, p10ur off uart2 a-apb: p6co, p6ur off eft1 a-apb: p7co, p7ur off bspi1 a-apb: p3co, p3ur off eft2 a-apb: p8co, p8ur off bspi2 a-apb: p4co, p4ur off wdg not available on gpio - p2 a-apb: p2co, p2ur off adc a-apb: p7co, p7ur off adc analog agcr1: adc_mdon off rtc-apb cgc: p11co, p11ur off .com .com .com .com .com 4 .com u datasheet
STR720 - power reduction modes 367/401 25.2 idle mode in this operating mode, main system clock is derived from clk input dividing it by 32. in this way the whole system can still evolve, although at a very low rate, but power consumption will be greatly reduced. any setting for a-apb and atapi clock generation remains unchanged even if proper operation of the peripheral subsystem cannot be maintained due to the reduced operating frequency. application software can switch off any peripheral not required in this operating mode as much as disabling the pll (see section 13.3.2: pll management on page 140 ) and any other analog part whose functionality is not required. if for example an external clock of 16 mhz is applied to clk input, activating this operating mode results in a system frequency (ahb/s-apb clock) being either 250 khz or 500 k hz, depending if div2 multiplexer is enabled or not. no particular sequence must be used to enter or exit idle mode since interrupt detection is always active; only the external sdram banks should be put in self-refresh mode before entering idle mode, otherwise their contents will be lost due to the very long refresh interval. once in self-refresh mode, sdramc clock can be switched off safely. 25.3 slow mode in this operating mode, main system clock is taken directly from oscin pad, where the 32 khz oscillator used to supply rtc is connec ted. in this way system operations are virtually frozen due to the extremely low rate system frequency. as it happens in idle mode, any setting for a-apb and atapi clocks is not affected by entering in slow mode, so application software is responsible for switching off any part of the system which is not strictly required, especial ly the analog parts: pll, adc and also clock input receivers since main clock signal detecti on is not required in this mode, being based on the 32 khz oscillator. note before entering slow mode the a-apb clock frequency should be set to be ahb clock divided by 2 if the watchdog is configured to use the external low frequency clock source due to internal synchronizati on requirements of this clock signal which is derived from the same 32 khz oscillator. it must be noticed that when main clock is switched off also at the application board level, particular care must be observed when generating internal reset events (watchdog or software triggered) since the absence of that external clock prevents the correct synchronization of the internal reset signal deassertion. as a consequence when main external clock is switched off on the board, watchdog should be disabled or used as a plain timer and no software reset should be issued, since in both cases the exit from these reset events would not be properly synchronized. in case a software reset is required, main board clock should be restarted before generating it. .com .com .com .com .com 4 .com u datasheet
STR720 - power reduction modes 368/401 no other particular care must be used to enter or exit slow mode, although the same consideration mentioned in idle mode section about external sdram banks and dramc should be applied as well. 25.4 stop mode when it is required that system configuration is preserved without feeding any clock to the system, the stop mode functionality can be used, where only rtc section remains clocked and the rest of the system is completely frozen, thus reducing its consumption to the leakage current only. upon entering stop mode, a specific sequence must be executed by application software in order to leave the system in a state where consumption is minimum but it is still possible to wake the system up without resetting it and thus altering previous data and configuration. the code to enter stop mode should be written according to the following rough sequence: 1. switch off operation of all analog sections. 2. enter slow mode. as a consequence system clock is now 32 khz. 3. switch off pll to remove its power consumption (see section 13.3.2: pll management on page 140 ). 4. disable stop mode, clearing bit stop_en in rccu mskctl register, so that system remains alive even after wiu block rises stop mode request. 5. mask wake-up request from clk clock line, clearing bit 7 in wiu wumr register. this is to be sure that the clk clock, which is still ac tive at this time, cannot exit immediately from stop mode. 6. issue the stop sequence described in wiu section ( see ?wake-up interrupt unit (wiu)? on page 70. ). after this sequence is completed, the stop_req signal is activated so rccu will be ready to stop main clock signal. external devices can be notified that STR720 is about to enter stop mode by using the alternate function associated to p3.7 pad, so that they can react accordingly, for example switching off clk clock source. 7. if application does not require to use the ac tivity on clk clock line as wake-up event, stop mode could be entered now, jumping to step 9. otherwise it is necessary to poll bit 7 in wiu wupr register, each time clearing the bit, until it is read as ?0?, meaning that no more activity is present on clk clock line. 8. the wake-up request corresponding to clk clock line can now be unmasked, setting to ?1? bit 7 in wiu wumr register. 9. stop mode can now be enabled, setting bit stop_en in rccu mskctl register. from now on main system clock is frozen. note the change of pll lock condition, associated to interrupt/wake-up line number 6, cannot be used as wake-up event. selecting this input as the only wake-up source will stuck the system so as only a reset event can restore normal operations. warning : whenever a stop request is issued to the system, a few clock cycles are needed to actually enter stop mode. hence the execution of the instruction following the setting of stop_en bit in rccu might start before entering stop mode (consider the arm7 three-stage pipeline as well). in order to avoid to execute any valid instruction after a correct stop sequence and before entering the stop mode, it is mandatory to execute a dummy set of few instructions after the setting of stop_en bit. in particular at least six dummy instructions (e.g. mov r1, r1 ) shall be added after the end of stop sequence. again, if .com .com .com .com .com 4 .com u datasheet
STR720 - power reduction modes 369/401 exiting from stop mode an interrupt routine shall be serviced, another set of dummy instructions shall be added, to take into account of the latency period: this is evaluated in at least other three dummy instructions. this to consider that when stop mode entered, the pipeline content is frozen as well, and when the system restarts the first executed instruction was fetched and decoded before entering the stop mode itself. exiting stop mode can be triggered by two different sets of events: internal events generated on some STR720 peripheral pins (as uart reception line or usb wake-up signalling) or external events restoring clk clock line. all these events can be detected by wiu which will deactivate the stop_req signal as a response, thus removing the stop condition from rccu block. a guideline to write the code required to exit stop mode can be the following: 1. upon wake-up event, wiu removes stop_req signal notifying to the external devices that STR720 is about to exit stop mode. if the traced event is triggered by STR720 peripherals, this signal will be used by a possible external power manager to restore clk clock otherwise it will have been clk clock activity, restarted autonomously by the exter- nal power manager, which triggered STR720 wake-up. 2. stop_req deactivation restarts rccu operations, which awakes system clock in slow mode. 3. application software should now determine which wake-up source triggered the exit from stop mode, in order to take any consequent action. if clk clock activity is not there (see point 7 of previous sequence), a system dependent time interval must be waited so to allow a stable clk clock to be present on STR720 pads. 4. rccu can now be switched back in run mode, the pll enabled again and all the rest of system operation restored. 25.5 standby mode the minimum level of power consumption can be reached using standby mode, where not only main system clocks are stopped but also main power supply is removed from STR720 device, except the rtc section with its 32 khz oscillator, so that time can be still traced while most of the system is kept under reset condition. this extreme power saving mode can be exited re-initializing the whole device using rstin pad, thus losing any previous state and configuration while the real time clock counter is not affected. any action required by the system to enter safely standby mode has to be performed by application software, following a request arrived from an external power manager and acknowledging the enter in standby mode after having saved any required state information into an external storage area (for example an external flash device). a pair of gpio pins can be used to implement this protocol. as a response to STR720 entering in standby mode, the external power manager should activate rstin pad and then remove v dd supply, leaving only v ddrtc active. when the external power manager requires STR720 to exit standby mode, it should restore v dd supply to its nominal value always keeping rstin pad driven low so that a safe hardware reset sequence is triggered, and only after v dd supply is stable to its nominal value, rstin pad should be raised again. STR720 will start a reset sequence, eventually restoring its previous state using the informations saved into the external storage area, and system operation can restart. .com .com .com .com .com 4 .com u datasheet
STR720 - system reset 370/401 26 system reset 26.1 reset input pin this pin is used to force a system reset which initializes the device in a predefined state. activating this pin does not affect in any way the operation of either real-time-clock or on-chip emulation and debug sections, which are independently initialized by dedicated pins. to improve the noise immunity of the device, the reset input pin (rstin ) has a schmitt trigger input circuit with hysteresis and an on-ch ip rc filter is implemented. the filter is sized to filter out all spikes shorter than 50 ns. on the other hand, it is recommended to provide valid pulse on rstin with a duration of at least 500 ns to be sure that the asynchronous pulse is properly latched by system. this means that al l the pulses whose length is between 50 ns and 500 ns can either be filtered or recognized as valid, depending on the operating conditions and process variations. as a recommendation, the power-up rstin pulse should last for about 200 s in order to be sure that the internal current references used to supply the clock input pad are already settled to their nominal value. figure 68. recommended signa l to be applied on rstin pin 26.2 rtcrst input pin this pin is used to initialize real-time-clock section independently from the rest of the system. to improve the noise immunity of this critical input pin, rtcrst has a schmitt trigger input circuit with hysteresis and an on-chip rc filter is implemented, similar to the one described for reset input pin. the filter is size d to filter out all spikes shorter than 50 ns and minimum rtcrst pulse duration is recommended to be longer than 500 ns. this means that all the pulses whose length is between 50 ns and 500 ns can either be filtered or recognized as valid, depending on the operating conditions and process variations. as a recommendation, the power-up rtcrst pulse should last for about 1 s in order to be sure that 32 khz oscillator is has completed its star t-up phase and settled to its nominal oscillation frequency and amplitude. v rstin 0.3 v dd 0.7 v dd v dd 500 ns minimum (200 s power-up) .com .com .com .com .com 4 .com u datasheet
STR720 - system reset 371/401 26.3 jtrst input pin this pin is used to initialize on-chip emulation and debug logic independently from the rest of the system. to improve the noise immunity of this critical input pin, jtrst has a schmitt trigger input circuit with hysteresis and an on-chip rc filter is implemented, similar to the one described for reset input pin. the filter is size d to filter out all spikes shorter than 50 ns and minimum jtrst pulse duration is recommended to be longer than 500 ns. this means that all the pulses whose length is between 50 ns and 500 ns can either be filtered or recognized as valid, depending on the operating conditions and process variations. 26.4 power-on/off and stand-by entry/exit at power-on or stand-by exit, it is recommended to held low rstin pin to guarantee a proper initialization of STR720 system and avoid malfun ctions of the rtc logic. in particular, when v dd and v dd3 are still too low to allow the internal logic to work properly, the system must be mantained under reset status, forcing a hw reset through the rstin pin. in this way the system sees a hw reset and the flag register (clk_flag in rccu module) assumes the corresponding configuration (all reset flags cleared). to avoid unpredictable current injection and power consumption, it is recommended to have the v dd3 value always greater than v dd during the power-on phase, as illustrated in next figure 69 on page 371 . the distinction between power-on reset and hardwa re system reset consists in the fact that typical hardware reset sequences do not affect real-time-clock section, leaving rtc running while rest of the system is restarted. this happens also when system enters and exit stand-by mode. on the contrary a power-on reset will see both system and rtc section being initialized. in order to distinguish between a power-on reset and a hardware system reset (or figure 69. power-on supply sequence v dd3 v dd rstin reset pin driven low .com .com .com .com .com 4 .com u datasheet
STR720 - system reset 372/401 exit from stand-by mode) a check on rtc alarm registers can be done (see rtca registers in chapter 14: real time clock (rtc) on page 150 ). these registers are reset to all-1 state, representing a time in the far future wh ich is likely to be useless for any application using the alarm feature. hence application softw are can use these registers as a flag to detect rtc reset events, thus distinguishing between a plain system reset (rtca registers keep their value) and a power-on reset (rtca registers are initialized). similarly during power-off sequence or stand-by entry, rstin pin should be driven low before switching off power supply, as depicted in next figure 70 on page 372 . figure 70. power-off supply sequence v dd3 v dd rstin reset pin driven low .com .com .com .com .com 4 .com u datasheet
STR720 - package mechanical data 373/401 27 package mechanical data figure 71. pqfp208 package outline table 84. pqfp208 package mechanical data dim mm inches dim mm inches min typ max min typ max min typ max min typ max a 4.10 0.161 d3 25.50 1.004 a1 0.25 0.010 e 0.50 0.020 a2 3.40 3.20 3.60 0.134 0.126 0.142 e 30.60 1.205 b 0.17 0.27 0.007 0.011 e1 28.00 1.102 c 0.09 0.20 0.003 0.008 e3 25.50 1.004 d 30.60 1.205 l 0.45 0.60 0.75 0.018 0.024 0.029 d1 28.00 1.102 l1 1.30 0.051 k 0(min), 3.5(typ), 7(max) .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 374/401 28 electrical characteristics 28.1 parameter conditions unless otherwise specified, all voltages are referred to v ss . 28.1.1 minimum and maximum values unless otherwise specified the minimum and maximum values are guaranteed in the worst conditions of ambient temperature, supply voltage and frequencies by tests in production on 100% of the devices with an ambient temperature at t a = 25c and t a = 85c. data based on characterization results, design simulation and/or technology characteristics are indicated in the table footnotes and are not tested in production. based on characterization, the minimum and maximum values refer to sample tests and represent the mean value plus or minus three times the standard deviation (mean 3 ). 28.1.2 typical values unless otherwise specified, typical data are based on t a =25c, v dd3 = 3.3 v, v dd =1.8v. they are given only as design guidelines and are not tested. typical adc accuracy values are determined by characterization of a batch of samples from a standard diffusion lot over the full temperature range, where 95% of the devices have an error less than or equal to the value indicated (mean 2 ) . 28.1.3 typical curves unless otherwise specified, all typical curves ar e given only as design guidelines and are not tested. 28.1.4 loading capacitor the loading conditions used for pin parameter measurement are shown in figure 72 . figure 72. pin loading conditions c l str7 pin .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 375/401 28.1.5 pin input voltage the input voltage measurement on a pin of the device is described in figure 73 . 28.2 absolute maximum ratings this product contains devices to protect the inputs against damage due to high static voltages, however it is advisable to take normal precautions to avoid application of any voltage higher than the specified maximum rated voltages. for proper operation it is recommended that v in and v out be higher than v ss and lower than v dd3 . reliability is enhanced if unused inputs are connected to an appropriate logic voltage level (v dd , v dd3 or v ss ). stresses exceeding above listed recommended ?absolute maximum ratings? may cause permanent damage to the device. this is a stress rating only and functional operation of the figure 73. pin input voltage table 85. voltage characteristics symbol parameter value unit min max v dd3 voltage on v dd3 pins with respect to ground (v ss ) -0.3 +3.6 v v dd voltage on v dd pins with respect to ground (v ss ) -0.3 +2.0 v v ddrtc voltage on v ddrtc pin with respect to ground (v ss ) -0.3 +2.0 v v ddpll voltage on v ddpll pin with respect to ground (v ss ) -0.3 +2.0 v v sspll voltage on v sspll pin with respect to ground (v ss )v ss v ss v v dd3p voltage on v dd3p pin with respect to ground (v ss ) -0.3 +3.6 v v ssp voltage on v ssp pin with respect to ground (v ss )v ss v ss v a vdd voltage on a vdd pin with respect to ground (v ss )-0.3 +3.6v a gnd voltage on a gnd pin with respect to ground (v ss )v ss v ss v v in voltage on any pin with respect to ground (v ss )-0.3v dd3 +0.3 v i ov input current on any pin during overload condition -10 + 10 ma i tov absolute sum of all input cu rrents during overload condition | 75 | ma t st storage temperature -55 +150 c esd esd susceptibility (human body model) 2000 v v in str7 pin .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 376/401 device at these or any other conditions above those indicated in the operational sections of this specification is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. during overload conditions (v in >v dd or v in STR720 - electrical characteristics 377/401 28.3.2 static latch-up (lu) a supply overvoltage (applied to each power supply pin) and a current injection (applied to each input, output and configurable i/o pin) are performed on each sample. after the test dc parametric and functional testing is perform ed. this test conforms to the eia/jesd 78 ic latch-up standard. 28.4 operating conditions the following values are recommended to meet device functional specification. 1. for details on operating conditions related to clk input buffer refer to section 28.7 on page 380 . 2. for details on operating conditions related to pll refer to section 28.10 on page 387 . 3. for details on operating conditions related to a/d converter refer to section 28.11 on page 389 . table 89. electrical sensitivity symbol parameter conditions jedec level lu static latch-up class ta=+25c a table 90. recommended operating conditions symbol parameter value unit min. max v dd3 3.3v operating digital supply voltage for the i/o pads. 3.0 3.6 v v dd 1.8v operating digital supply volt age for core circuitry. 1.6 2.0 v v ddrtc 1.8v operating digital suppl y voltage for rtc logic. 1.6 v dd v v dd3p 3.3v operating supply volt age for clk input buffer. 1) 3.0 3.6 v v ddpll 1.8 v operating supply vo ltage for internal pll. 2) 1.6 2.0 v a vdd operating analog supply vo ltage for a/d converter. 3) v dd3 -0.3 v dd3 -0.3 v f sys operating main clock frequenc y (core, ahb, s-apb) - 70 mhz f apb operating peripheral cl ock frequency (a-apb) - 35 mhz t a ambient temperature under bias ?40 +85 c .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 378/401 28.5 thermal characteristics the average chip-junction temperature, t j , in degrees celsius, may be calculated using the following equation: t j = t a + (p d x ja )(1) where: ? t a is the ambient temperature in c, ? ja is the package junction-to- ambient thermal resistance, in c/w, ?p d is the sum of p int and p i/o (p d = p int + p port ), ?p int is the product of i dd and v dd , expressed in watt. this is the chip internal power, ?p port represents the power dissipation on input and output pins; user determined. p port is going to be significant when the device is configured to drive continuously external memories and/or modules, otherwise p port < p int and it might be neglected. an approximate relationship between p d and t j (if p port is neglected) is given by: p d = k / (t j + 273c) (2) therefore (solving equations 1 and 2): k = p d x (t a + 273c) + ja x p d 2 (3) where: ? k is a constant for the particular part, which may be determined from equation (3) by mea- suring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j may be obtained by solving equations (1) and (2) iteratively for any value of t a . 1. the power dissipation is obtained from the formula p d =p int +p port where: p int is the chip internal power (i dd xv dd ) p port is the port power dissipation determined by the user. 2. the average chip-junction temperature can be obtained from the formula t j = t a + p d x ja . table 91. thermal characteristics symbol description value unit min max ja thermal resistance junction-ambient pqfp 208 - 28 x 28 x 3.4mm / 0.5 mm pitch -48c/w p d power dissipation (1) pqfp208 - 28 x 28 x 3.4mm / 0.5 mm pitch --mw t j junction temperature (2) --c .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 379/401 28.6 supply current characteristics measurements are done in the following conditions: ? program executed from internal ram, cpu running with ram access. ? in run mode measurement all internal peri pherals are clocked but not used. a-apb clock runs at half ahb clock frequency. in all other mode measurements all peripherals are switched off. ? all i/o pins in input mode with a static value at v dd3 or v ss (no load). ? pll switched off (for pll current characteristics see section 28.10 on page 387 ). this implies that i/o related current is not considered in these figures. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design characterization performed on sample devices, not tested in production. following figure 74 illustrates the dependency between system clock frequency in mhz and v dd current consumption in ma, measured in typical conditions and in the indicated range. table 92. current consum ption characteristics symbol parameter test conditions (1) value unit min typ max i dd_run v dd run mode current @70 mhz system clock - 48 - ma i dd_idle v dd idle mode current @1.6 mhz system clock - 1.25 - ma i dd_slp v dd slow mode current @32 khz system clock - 17 - a i dd_stp v dd stop mode current @0 mhz system clock - 16 - a i ddrtc v ddrtc all modes current @32 khz rtc clock - 3 - a i stb standby mode current 0 v for the system and io power supply, 1.8 v for rtc running on 32 khz oscillator -3.5- a i dd (f) v dd current function (1) system clock frequency f be- tween 10 and 25 mhz. - 0.706 f sys - 2.229 -ma .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 380/401 28.7 clock and timing characteristics 28.7.1 internal clock characteristics application software controls STR720 internal clocks by configuring rccu registers and setting pll related parameters (see chapter 13: reset and clock control unit (rccu) on page 138 ). the values hereafter reported defines the limit for internal frequencies that must be respected by clock configuration. figure 74. supply current versus system frequency table 93. internal clock limits symbol parameter conditions value unit min typ max f cpu cpu, ahb and s-apb clock frequency -5070mhz f apb a-apb clock frequency f cpu / 16 - f cpu / 2 mhz i dd [ma] f sys [mhz] 10 20 75 50 25 40 30 50 60 70 0 0 i dd (25c) .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 381/401 28.7.2 clk pad characteristics (external clock source) these pads are used to provide clock signal to STR720 system from an external clock source. since their electrical characteristics are differ ent from normal i/o pads they are hereafter reported in a specific table. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design guidelines and validation, not te sted in production. table 94. dc clk pad characteristics symbol parameter test conditions (1) value unit min typ max v dd3p supply voltage for clk input buffer. 3.14 3.30 3.47 v v ref reference voltage for clk input signal (2) v ref =(v dd3p -1)*0.9 60 mv 1.87 2.1 2.28 v v ref_r recommended reference volt- age for clk input signal 1.6 - 2.0 v v ihp (clk) main clk clock (clk) input high level (2) see figure 75 v ref + 0.2 - - v v ilp (clk) main clk clock (clk) input low level (2) see figure 75 --v ref - 0.2 v table 95. ac clk pad characteristics symbol parameter conditions value unit min typ max t w(hp) t w(lp) main clk clock (clk) high or low time (2) see figure 75 14.29 - - ns t r(p) t f(p) main clk clock (clk) rise or fall time (2) see figure 75 --7 ns i l clk input leakage current v ss v in v dd3p --1 a i dd3p_r v dd3p run/idle mode cur- rent -2.75-ma i dd3p_s v dd3p slow/stop mode current - - 10 na .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 382/401 28.7.3 pll characteristics STR720 implements a pll which combines di fferent levels of frequency dividers with a voltage controlled oscillator (vco) working as frequency multiplier. on chip pll is used to generate system clock from an external reference clock signal. its characteristics in term of generated clock accuracy depends heavily on the input signal and power supply quality. in the following table, jitter is intended as the difference of the t max and t min , where t max is maximum time period of the pll output clock and t min is the minimum time period of the pll output clock. the value is expressed as ratio with respect to the average/nominal time period of pll output clock. jitter at the pll output can be due to the many different reasons, the major contributors being noise on input reference clock and noise on pll supply (internally or externally generated). pll acts like a low pass filter for any jitter in the input clock. input clock jitter with the frequencies within the pll loop bandwidth is passed to the pll output and higher frequency jitter (frequency > pll bandwidth) is attenuated @20db/decade. this is the reason why, depending on input clock noise spectral char acteristics, jitter performance can be better when pll output is used as system clock than when pll is bypassed. digital supply noise adds deterministic components to the pll output jitter, independent on multiplication factor. its effects is strongly reduced thanks to particular care used in the physical implementation and integration of the pll module inside the device. particular care is thus recommended in board design for what concerns v ddpll and clock routing. figure 75. typical application with external clock source f ck v ilp v ihp t r(p) t f(p) t w(hp) t w(lp) i l 90% 10% v ref clk STR720 v ref external clock source .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 383/401 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design guidelines and validation, not te sted in production. 3. data based on design characterization performed on sample devices, not tested in production. 28.7.4 32 khz real-time clock oscillator the rtc block can be driven by a crystal oscillator. in the application, the crystal and the load capacitors have to be placed as close as possib le to the oscillator pins in order to minimize output distortion and start-up stabilization time. refer to the crystal manufacturer for more details (frequency, package, accuracy, etc.). a recommended configuration is shown on figure 76 and detailed on table 97 whose values have been checked using standard crystals. table 96. pll characteristics symbol parameter test conditions (1) value unit min typ max v ddpll supply voltage for pll 1.6 1.80 2.0 v f ref pll reference clock frequency (2) 9-27mhz f vco pll vco clock frequency (2) - - 1080 mhz t lock pll lock-in time 80 116 200 s t jitter peak-to-peak pll jitter val- ue (3) (t max -t min ) / t out v ref = 1.64 v ? v clk = 400 mv f clk = 49.1 mhz div2 enabled,m=11, d=4. -2.93.5% jitter standard deviation pll jitter value (3) (t) / t out same as above. -0.50.7% i ddpll_r v ddpll run mode current same as above - 1.3 1.4 ma i ddpll_o v ddpll off current - - 20 na figure 76. crystal oscillator typical application c d c g oscin oscout r d STR720 .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 384/401 the electrical characteristics of STR720 oscillator are reported in table 98 . 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design characterization done with ael crystal (n. 4065), not tested in production table 97. crystal oscillator recommanded characteristics symbol parameter conditions value unit min typ max f oscin crystal frequency - 32.678 - khz f tol crystal frequency tolerance -30 - +30 ppm r d serial drain resistor - 220 - k ? c g , c d recommended load capaci- tors versus crystal load capac- itance r d = 220 k ? c l =9 pf including board-stray capaci- tances -15-pf r d = 220 k ? c l = 12.5 pf including board-stray capaci- tances -22-pf table 98. oscillator electrical characteristics symbol parameter test conditions (1) value unit min typ max v ddrtc supply voltage for pll 1.71 1.80 1.89 v g m oscillator transconductance 14 30 44 a/v t setup oscillator start-up time (2) stable v dd 400 500 1000 ms v q operating point voltage - 956 -mv v osc output voltage amplitude (2) c l = 12 pf, r d = 220 k ? - 788 - mv(rms) r osc oscillation allowance (2) c l = 12 pf, r d = 220 k ? 500 - - k ? f offset static frequency deviation ( ? f/ f) (2) c l = 12 pf, r d = 220 k ? - +4.0 - ppm .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 385/401 28.8 ac and dc characteristics the parameters listed in the following tables represent the electrical characteristics of STR720 general purpose i/o pins and external memory interfaces (emi and sdram). on table 99 the static characteristics are reported. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified . in the following table the dynamic characteristics of general purpose i/o pins and external memory interfaces (emi and sdram are reported). for a description of external memory table 99. dc electrical characteristics symbol parameter test conditions (1) value unit min. typ max v ih input high level ttl p2(15,14,12:0), p3(12:0), p4(4:0), p6(31:0), p7(45,44,15:0), jtdi, jtck, jtms 2.0 - - v input high level ttl schmitt trigger (p2.13) 2.0 - - v v il input low level ttl p2(15,14,12:0), p3(12:0), p4(4:0), p6(31:0), p7(45,44,15:0), jtdi, jtck, jtms --0.8v input low level ttl schmitt trigger(p2.13) --0.8v v hys input hysteresis ttl schmitt trigger (p2.13) 0.4 - - v v oh output high level standard p2(15:0), p3(12:0), p4(3:0) push pull, i oh = 2 ma v dd3 - 0.8 - - v output high level: p4(4),p7(43:0), jtdo, jtck push pull, i oh = 4 ma v dd3 - 0.8 - - v output high level: p6(59:47,45:0) push pull, i oh = 8 ma v dd3 - 0.8 - - v v ol output low level standard p2(15:0), p3(12:0), p4(3:0) push pull, i ol = 2 ma - - 0.4 v output low level: p4(4),p7(43:0), jtdo, jtck push pull, i ol = 4 ma - - 0.4 v output low level: p6(59:47,45:0) push pull, i ol = 8 ma - - 0.4 v r wpu weak pull-up resistor p2(15:0) -15-k ? r wpd weak pull-down resistor p3(12:0), p4(3:0) -15-k ? i leak input leakage current - - 1 a .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 386/401 interface timing characteristics, see section 28.12: external memory bus timing on page 393 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design guidelines and validation, not te sted in production. 28.9 asynchronous reset input characteristics all reset input pins implement a low-pass glitch filter which improves their noise immunity and prevents system from malfunctioning as it w ould happen if they got activated inappropriately. the electrical characteri stics of these special pins, both static and dynamic, are reported in table 101 . it must be noted that input characteristics of rstin ad rtcrst are different from standard i/os, due to the fact that they are supplied at 1.8 v by v ddrtc and they have to tolerate 3.3 v input signals even when no such voltage is applied to STR720 device (standby mode). 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. table 100. ac electrical characteristics symbol parameter test conditions (1) value unit min. typ max t tr output transition time (10%-90% and 90%-10%) p2(15:0), p3(12:0), p4(3:0) (2) c l = 50pf - - 5 ns output transition time (10%-90% and 90%-10%) p4(4),p7(43:0), jtdo, jtck (2) c l = 50pf - - 2.5 ns output transition time (10%-90% and 90%-10%) p6(59:47,45:0) (2) c l = 30pf - - 1 ns table 101. reset pads input filter characteristics symbol parameter test conditions (1) value unit min typ max v il input low level ttl schmitt trigger (jtrst) --0.8v input low level schmitt trigger (rstin , rtcrst ) 0.43 0.5 0.65 v v ih input high level ttl schmitt trigger (jtrst) 2.0 - - v input high level schmitt trigger (rstin , rtcrst ) 0.72 0.9 0.98 v v hys input hysteresis ttl schmitt trigger (jtrst) 0.4 - - v input hysteresis schmitt trig- ger (rstin , rtcrst ) ---v t frs input filtered pulse jtrst , rstin , rtcrst - - 50 ns t nfr input not filtered pulse jtrst , rstin , rtcrst 500 - - ns .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 387/401 28.10 usb - universal bus interface in order to implement a correct usb interfac e, a few external components are required to be compliant to the protocol electrical characteristi cs. a possible application scheme is depicted in figure 77 and detailed in table 102 . hereafter the electrical characteristics of STR720 usb interface are reported. these values are measured with a specific setup following usb standard recommendations and summed up in the ?test condition? column of the table, where r s is the series resistor value and c l the capacitive load to gnd connected to each usb pad. figure 77. usb typical application table 102. usb typical application recommendations symbol parameter conditions value unit min typ max r s series resistor accuracy: 5% 25.65 27 28.35 ? r pu line pull-up resistor accuracy: 5% 1.425 1.500 1.575 k ? v term line termination voltage 3.0 3.3 3.6 v v ihu usb clock signal input high level same as p2.10 gpio 2 - - v v ilu usb clock signal input low level same as p2.10 gpio - - 0.8 v f cku usb clock signal frequency accuracy: 0.25% 47.88 48.00 48.12 mhz table 103. usb dc characteristics symbol parameter test conditions (1) value unit min typ max v il single-ended receiver low level input voltage --0.8v v ih single-ended receiver high level input voltage 2.0 - - v v hyst single-ended receiver hysteresis - 400 0 mv v di differential input sensitiv ity |usbdp - usbdm| 200 - - mv v cm differential common mode range (2) includes vdi range 0.8 - 2.5 v STR720 usbdp (p2.15) usbclk (p2.10) r s r s usbdm (p2.14) r pu v term d + d - usb clock source f cku .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 388/401 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design guidelines and validation, not te sted in production. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design guidelines and validation, not te sted in production. v ol low level output voltage measured with pull-up of 1.425 k ? to 3.6 v 0.0 - 0.3 v v oh high level output voltage measured with pull-down of 14.25 k ? to gnd 2.8 - 3.6 v v crs output signal crossover volt- age excluding the first transition from idle state 1.3 - 2.0 v table 104. usb full-speed ac characteristics symbol parameter test conditions (1) value unit min typ max t fr rise time r s = 27 ? , c l = 50 pf. see figure 78 . 4 - 20 ns t ff fall time r s = 27 ? , c l = 50 pf. see figure 78 . 4 - 20 ns t frfm differential rise and fall time matching (t fr / t ff ) excluding the first transition from idle state 90 - 111.11 % z drv driver output resistance (2) r s = 27 ?. 28 - 44 ? figure 78. usb data signal rise and fall time table 103. usb dc characteristics symbol parameter test conditions (1) value unit min typ max differential data lines t fr t ff crossover points v crs v ss 90% 10% .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 389/401 28.11 s-d adc characteristics the static electrical characteristics of a/d converter are reported in table 105 . in the subsequent sections, parameters related to input circuit and a/d converter performance are listed. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. as long as clk pad is used to provide system clock, eit her directly or thorugh pll, a consumption will be observed on a vdd pad, due to clk pad reference current generators. only when STR720 is put in slow mode (32 khz) or stop mode (no clock) clk pad reference current generators can be switched off and the minimum a vdd consump- tion can be achieved. 3. v ain may exceed a gnd or a vdd up to the absolute maximum ratings. howeve r, the conversion result in these cases will be meaningless. data based on desi gn guidelines, not tested in production. 28.11.1 adc analog input pins to improve the accuracy of the a/d converter, the first recommendation is to properly connect decoupling capacitors on a vdd pin, so to reduce as much as possible the amount of noise introduced through the analog supply voltage pin. subsequently it is definitively necessary for analog input pins to have low ac impedance. connecting a capacitor with good high frequency characteristics at the input pin of the device, can be effective: the capacitor should be as large as possible, ideally infinite. this capacitor contributes to attenuate noise present on the input pin; moreover, it sources charge during the sampling phase, when the analog signal source is a high-impedance source. on each analog input pin an anti-aliasing filter is required so to avoid that components beyond the sampling frequency are folded back into the actual signal bandwidth. due to the structure of sigma-delta adc, these components cannot be removed by software post-processing of the acquired samples, so it is of fundamental importance to remove them before feeding the signal to the analog input pin. an anti-aliasing filter can be obtained in general by using a series resistance with a capacitor on the input pin (simple rc filter), though other more complex solutions with better band rejection char acteristics can be used. the rc filtering may be limited according to the value of source im pedance of the transducer or circuit supplying the analog signal to be measured. table 105. adc static characteristics symbol parameter test conditions (1) value unit min. typ max a vdd analog supply voltage for adc with reference to a vss pin 3.0 3.30 3.6 v a idd a vdd operating mode current - 1.8 - ma a idd_o a vdd off current adc off but clk pad active (2) ---ma a idd_s a vdd standby/stop current adc off and clk pad not used (2) --1 a v ain analog input voltage see note (3) 0 - 2.5 v i aleak analog input leakage current - - 200 na .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 390/401 here you can find an equivalent circuit of adc input pin modeling the behaviour during the sampling phase. just after the sampling phase is over, the charge on pin capacitors has to be restored by the signal voltage source. this can be modeled as a current requested by adc input pin depending on the frequency with which the pin is sampled by adc (which is not the signal sampling frequency due to the oversampling architecture of sigma-delta converters). equivalent input circuit modeling this aspect can be depicted as illustrated in figure 80 . figure 79. adc input pin equivalent circuit during sampling figure 80. adc input pin equivalent circuit r f c f r s r l r sw c p2 c s v dd sampling source filter current limiter external circuit internal circuit scheme r s source impedance r f filter resistance c f filter capacitance r l current limiter resistance r sw channel selection switch impedance r ad sampling switch impedance c p pin capacitance (two contributions, c p1 and c p2 ) c s sampling capacitance c p1 r ad channel selection v a r f c f r s r l r in v cm source filter current limiter external circuit internal circuit scheme r in equivalent input resistance v cm common mode voltage v a .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 391/401 where r in can be defined by the following formula. all parameters required to describe adc input pads are reported in the following table. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. data based on design guidelines, not tested in production. 3. data based on design characterization performed on sample devices, not tested in production. 4. data based on design guidelines and validation, not te sted in production. table 106. adc input characteristics symbol parameter test conditions (1) value unit min. typ max c in analog input capacitance (2) see figure 79 . c in = c p1 +c p2 +c s --5pf f mod modulator frequency (3) (oversampling clock) --4mhz k equivalent analog input resistor constant (4) see figure 80 . in single channel mode value must be divided by 4. 1728 2160 2592 k ?? mhz r in equivalent analog input resistance (4) see figure 80 . f mod = 4 mhz, round-robin mode. - 540 - k ? v cm common mode voltage (2) 1.19 1.25 1.31 v f ain analog input bandwidth (2) (f mod /4096) f mod = 4 mhz - - 976 hz t s conversion time f mod = 4 mhz 128 ns r in k 1 f mod -------------- - ? = .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 392/401 28.11.2 adc performance in the following sections the performance figures used to represent adc characteristics are reported in table 107 and briefly explained in the subsequent sections. 1. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 2. full range 80 hz sine wave input, f mod = 2 mhz 3. data based on design guidelines and validation, not te sted in production. 4. data based on design guidelines, not tested in production. 28.11.2.1 signal to noise ratio and distortion (sinad) the acquired samples are processed to calculate their fft, after being windowed using a four-term blackman-harris function so to avoid spread of the fundamental harmonic due to the non-periodic captured components. on the fft further processing is performed so to calculate the ratio between the power of input sine wave fundamental component and the sum of the noise power plus the power of all harmonic components except the fundamental. this parameter can be also referred to as thd+n. 28.11.2.2 effective number of bits (enob) this paramer is calculated based upon the measured sinad value, as the number of bits of an ideal converter having an a signal-to-noise ratio equal to the sinad of the real adc under measurement. the ideal signal-to-noi se ratio can be expressed as: thus the effective number of bits can be determined using the following formula: table 107. adc performance symbol parameter test conditions (1), (2) value unit min. typ max sinad signal/noise and distortion 68 71 - db enob effective number of bits (resolution) 11 11.5 - bit inl integral non-linearity (3) measured on 11 bit samples. - 0.5 - lsb dnl differential non-linearity (3) measured on 11 bit samples. - 0.5 - lsb thd total harmonic distortion 71 79 - db pbr pass-band ripple (4) --0.1db snr ideal 1.76 6.02 n bits ? + = enob sinad 1.76 ? 6.02 ---------------------------------- = .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 393/401 28.11.2.3 integral non-linearity (inl) this parameter expresses the deviation between the actual a/d convertion characteristics and the ideal one by evaluating the distance between the center of the actual convertion step and the center of the bisector line, which is obtai ned by drawing a straight line from 1/2 lsb before the first step of real characteristic to 1/2 lsb after its last step. 28.11.2.4 differential non-linearity (dnl) this parameter again expresses the deviation between actual and ideal a/d convertion characteristics. this time the size of actual step with respect to the ideal one (1 ideal lsb) is compared. 28.11.2.5 total harmonic distortion (thd) the fft computed on the acquired samples is processed so to calculated the ratio between the power of input sine wave fundamental component and the power of all other harmonic components. 28.11.2.6 pass-band ripple (pbr) this parameter defines the characteristics of a/d converter transfer function from analog input pin to the generated sample values. 28.12 external memory bus timing the signal composing the external memory interface are collected on port 7 and as such all their dc electrical characteristics are reported in table 99 . the following tables and figures report the timing characteristics of read and write cycles. table 108. emi read cycle timing characteristics symbol parameter (1) test conditions (2), (3) value (4) unit min typ max t rpr1 read pulse time for erd in 8/16-bit word access depends on emi configu- ration. (5) 2t c - x 9t c + x ns t rpc1 read pulse time for ecsx in 8/ 16-bit word access depends on emi configu- ration. (5) 2t c - x 9t c + x ns t rpr2 read pulse time for erd in 32-bit word access depends on emi configu- ration. (5) 4t c - x 18t c + x ns t rpc2 read pulse time for ecsx in 32-bit word access depends on emi configu- ration. (5) 4t c - x 18t c + x ns t rsp read sampling point t c - x t c + x ns t rds read data setup time ns t rdh read data hold time ns t rasr read address setup time to erd t c - x t c + x ns t rasc read address setup time to ecsx t c - x t c + x ns t rah read address hold time ns .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 394/401 1. see figure 81 and figure 82 for a definition of these parameters. 2. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 3. data based on design guidelines, not tested in production. 4. t c is cpu clock period expressed in ns. for exam ple if cpu clock is set to run at 50 mhz, t c =20ns. 5. actual duration is configurable. see chapter 11: external memory interface (emi) on page 115 . figure 81. emi read cycle timing (8-bit or 16-bit word) figure 82. emi read cycle timing (32-bit word) ecsx ewex eadd[21:0] edata[15:0] erd (input) address data input wait cycle wait cycle wait cycle t rds t rdh t rasr t rah note : this diagram shows the timing of 3 wait-state cycle read access. t rpr1 t sp t rasc t rpc1 wait cycle ecsx ewex eadd[21:1] edata[15:0] erd (input) address data input wait cycle t rds t rdh t rasc t rah t rpr2 t sp eadd[0] t sp data input t rds t rdh t rpc1 note : this diagram shows the timing of 1wait-state cycle read access. t rpc2 t rasr .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 395/401 1. see figure 83 and figure 84 for a definition of these parameters. 2. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 3. data based on design guidelines, not tested in production. 4. t c is cpu clock period expressed in ns. for exam ple if cpu clock is set to run at 50 mhz, t c =20ns. 5. actual duration is configurable. see chapter 11: external memory interface (emi) on page 115 . table 109. emi write cycle timing characteristics symbol parameter (1) test conditions (2), (3) value (4) unit min typ max t wpc1 write pulse time for ecsx in 8/ 16-bit word access depends on emi configura- tion. (5) 2t c - x 9t c + x ns t wpw1 write pulse time for ewex in 8/ 16-bit word access depends on emi configura- tion. (5) t c - x 8t c + x ns t wpc2 write pulse time for ecsx in 32-bit word access depends on emi configura- tion. (5) 4t c - x 18t c + x ns t wdh write data hold time t c - x t c +x ns t wasc write address setup time to ecs t c - x t c +x ns t wasw write address setup time to ewex t c - x t c +x ns t wasd write address setup time to eda- ta t c - x t c +x ns t wwt wen turnaround time t c - x t c +x ns t wah write address hold time ns figure 83. emi write cycle timing (8-bit or 16-bit word) ecsx erd eadd[21:0] address wait cycle wait cycle wait cycle t wasc t wah note : this diagram shows the timing of 3 wait-state cycle write access. t wpw1 ewex edata[15:0] (output) data output t wdh t wasw t wasd t wpc1 .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 396/401 28.13 sdram interface timing the signals composing sdram interface are collected on port 6 and as such all their dc electrical characteristics are reported in table 99 . the following tables and figures report the timing characteristics of read and write cycles, both as single and burst accesses. figure 84. emi write cycle timing (32-bit word) table 110. sdram read cycle timing characteristics symbol parameter (1) test conditions (2) value (4) unit min typ max t sch sdram clock high pulse time - 0.5t c -ns t scl sdram clock low pulse time - 0.5t c -ns t scad sdram clock high to address valid ---ns t sccs sdram clock high to chip select - - - ns t scra sdram clock high to ras ---ns t scca sdram clock high to cas ---ns t scwe sdram clock high to we ---ns t sds sdram data read setup (3) ---ns t sdh sdram data read hold (3) ---ns t scda sdram clock high to data valid - - - ns t scbl sdram clock high to bls ---ns t sccke sdram clock high to cken - - - ns t sraca sdram ras to cas delay (3) depends on sdram config- uration. (5) t c -8t c ns wait cycle ecsx erd eadd[21:1] address wait cycle t wasc t wah note : this diagram shows the timing of 1 wait-state cycle write access. t wpw1 ewex edata[15:0] (output) data output t wdh t wasw t wasd t wpc2 eadd[0] data output t wpw1 t wdh t wwt t wpc1 .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 397/401 1. see figure 85 , figure 86 and figure 87 for a definition of these parameters. 2. v dd (all) = 1.80 v 10%, v dd3 (all) = 3.30 v 10%, t a = -40 / +85 c unless otherwise specified. 3. data based on design guidelines, not tested in production. 4. t c is cpu clock period expressed in ns. for exam ple if cpu clock is set to run at 50 mhz, t c =20ns. 5. actual duration is configurable. see chapter 10: dram controller (dramc) on page 101 . in the following figures the timing diagrams are represented, where also the extent of the software configurable access timing is depicted. t scada sdram cas to data valid delay (cas latency) (3) depends on sdram config- uration. (5) t c -3t c ns tsprd sdram precharge delay (3) depends on sdram config- uration. (5) 0-7t c ns figure 85. sdram single read access table 110. sdram read cycle timing characteristics symbol parameter (1) test conditions (2) value (4) unit min typ max delay ras-cas latency cas t sch miclk mia[13:11] bank mia[10:0] row col mcs [x] misa / ras miaa / cas mid[32:0] data miwe delay precharge t scl t scad t sccs t scra t scca t scwe t sds t sdh activate bank read precharge bank note : this diagram shows the timing with ras-cas delay, cas latency and precharge delay all set to 1 wait-state. .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 398/401 in figure 86 a sample of 4-beat burst read access is depicted, to show how access gets more efficient in the case of a burst read. the timing parameters of burst read access are the same of single read access. figure 86. sdram burst read access delay ras-cas latency cas miclk mia[13:11] bank mia[10:0] row col0 mcs [x] misa / ras miaa / cas mid[32:0] data0 miwe col1 col2 col3 data1 data2 data3 note : this diagram shows the timing with ras-cas delay, cas latency set to 1 wait-state and no precharge delay. activate bank read precharge bank read read read .com .com .com .com .com 4 .com u datasheet
STR720 - electrical characteristics 399/401 the next two figures represent the write access timing, here considered in the single write case since burst write is performed using the same timing characteristics, and the entry in self-refresh (power-save) mode where micken signal is used. figure 87. sdram single write access delay ras-cas latency cas miclk mia[13:11] bank mia[10:0] row col mcs [x] misa / ras miaa / cas mid[32:0] data miwe delay precharge activate bank write precharge bank note : this diagram shows the timing with ras-cas delay, cas latency and precharge delay all set to 1 wait-state. mibls [3:0] value (output) t scda t scbl .com .com .com .com .com 4 .com u datasheet
STR720 - revision history 400/401 29 revision history date version comments 30 jul 03 1.2 preliminary distribution 22 mar 04 2 initial release 05 apr 04 3 modifed ?reset management? on page 139 15 apr 04 3.1 corrected pdf links in table of contents 21 dec 04 4.0 revision number incremented from 3.1 to 4.0 due to internal document manage- ment system change modified page layout updated device summary on page 1 removed section 4.12 cpg1 package pi n configuration and section 5.20 embed- ded trace macrocell renamed sleep mode to slow mode updated adc, can, usb, rtc, eft, dmac and atapi sections .com .com .com .com .com 4 .com u datasheet
STR720 - revision history 401/401 notes: information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publicati on are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics prod ucts are not authorized for use as critical components in life support devices or systems without express written approval of stmicroelectro nics. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners ? 2004 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia ? belgium - brazil - canada - china ? czech republic - finland - france - germany - hong kong - india - israel - ital y - japan - malaysia - malta - morocco - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com .com .com .com .com 4 .com u datasheet


▲Up To Search▲   

 
Price & Availability of STR720

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X