Part Number Hot Search : 
4502B IRFB3207 IRF630 MC1450 BUW32 1N4732 SE5561 GBU8005
Product Description
Full Text Search
 

To Download ST10F28012 Datasheet File

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


  Datasheet File OCR Text:
  this is information on a product in full production. august 2012 doc id 8673 rev. 3 1/239 1 st10f280 16-bit mcu with mac unit, 512 kbyte flash memory and 18 kbyte ram datasheet ? production data features high performance cpu with dsp functions ? 16-bit cpu with 4-stage pipeline. ? 50ns instruction cycle time at 40mhz cpu clock ? multiply/accumulate unit (mac) 16 x 16-bit multiplication, 40-bit accumulator ? repeat unit ? enhanced boolean bit manipulation facilities ? additional instructions to support hll and operating systems ? single-cycle context switching support memory organization ? 512kb on-chip flash memory single voltage with erase/program controller ? 100k erasing/programming cycles ? 20 year data retention time ? up to 16mb linear address space for code and data (5mb with can) ? 2kb on-chip internal ram (iram) ? 16kb extension ram (xram) fast and flexible bus ? programmable external bus characteristics for different address ranges ? 8-bit or 16-bit external data bus ? multiplexed or demultiplexed external address/data buses ? five programmable chip-select signals ? hold-acknowledge bus arbitration support interrupt ? 8-channel peripheral event controller for single cycle, interrupt driven data transfer ? 16-priority-level interrupt system with 56 sources, sample-rate down to 25ns two multi-functional general purpose timer units with 5 timers two 16-channel capture/compare units a/d converter ? 2x16-channel 10-bit ?4.85 s conversion time ? one timer for adc channel injection 8-channel pwm unit serial channels ? synchronous/async serial channel ? high-speed synchronous channel fail-safe protection ? programmable watchdog timer ? oscillator watchdog two can 2.0b interfaces operating on one or two can busses (30 or 2x15 message objects) on-chip bootstrap loader clock generation ?on-chip pll ? direct or prescaled clock input up to 143 general purpose i/o lines ? individually programmable as input, output or special function ? programmable threshold (hysteresis) idle and power down modes maximum cpu frequency 40mhz package pbga 208 balls (23 x 23 x 1.96 mm - pitch 1.27 mm) single voltage supply: 5 v 10% (embedded regulator for 3.3 v core supply) temperature range: -40c to 125c pbga208 (23 x 23 x 1.96 - pitch 1.27 mm) (plastic bold grid array) order code: st10f280-jt3 www.st.com
contents st10f280 2/239 doc id 8673 rev. 3 contents 1 description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2 ball data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4 memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.1 visibility of xbus peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5 internal flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.2 operational overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.2.1 read mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.2.2 instructions and commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.2.3 status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.4 erase operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.5 erase suspend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.6 in-system programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.7 read/write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.8 power supply, reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.3 architectural description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.3.1 read mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.3.2 command mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.3.3 flash status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.3.4 flash protection register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.3.5 instructions description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.3.6 reset processing and initial state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.4 flash memory configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.5 application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.5.1 handling of flash addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.5.2 basic flash access control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.5.3 programming examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.6 bootstrap loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.6.1 entering the bootstrap loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
st10f280 contents doc id 8673 rev. 3 3/239 5.6.2 memory configuration after reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.6.3 loading the startup code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.6.4 exiting bootstrap loader mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.6.5 choosing the baud rate for the bsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 6 central processing unit (cpu) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.1 multiplier-accumulator unit (mac) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.1.1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 6.2 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.3 mac coprocessor specific instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 7 external bus controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.1 programmable chip select timing control . . . . . . . . . . . . . . . . . . . . . . . . . 63 7.2 ready programmable polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8 interrupt system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 8.1 external interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 8.2 interrupt registers and vectors location list . . . . . . . . . . . . . . . . . . . . . . . . 68 8.3 interrupt control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 8.4 exception and error traps list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 9 capture/compare (capcom) units . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 10 general purpose timer unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 10.1 gpt1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 10.2 gpt2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 11 pwm module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 11.1 standard pwm module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 11.2 new pwm module: xpwm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 11.2.1 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 11.2.2 xpwm module registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 11.2.3 xpwm control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 11.2.4 interrupt request generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 11.2.5 xpwm output signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 11.2.6 xpolar register (polarity of the xpwm channel) . . . . . . . . . . . . . . . . 92
contents st10f280 4/239 doc id 8673 rev. 3 12 parallel ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 12.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 12.1.1 open drain mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 12.1.2 input threshold control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 12.1.3 output driver control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 12.1.4 alternate port functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 12.2 port 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 12.2.1 alternate functions of port 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 12.3 port 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 12.3.1 alternate functions of port 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 12.4 port 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 12.4.1 alternate functions of port 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 12.5 port 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 12.5.1 alternate functions of port 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 12.6 port 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 12.6.1 alternate functions of port 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 12.7 port 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 12.7.1 alternate functions of port 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 12.8 port 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 12.8.1 alternate functions of port 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 12.9 port 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 12.9.1 alternate functions of port 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 12.10 port 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 12.10.1 alternate functions of port 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 12.11 xport 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 12.12 xport 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 12.12.1 alternate functions of xport 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 12.12.2 new disturb protection on analog inputs . . . . . . . . . . . . . . . . . . . . . . . 139 13 a/d converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 13.1 a/d converter module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 13.2 multiplexage of two blocks of 16 analog inputs . . . . . . . . . . . . . . . . . . . 140 13.3 xtimer peripheral (trigger for adc channel injection) . . . . . . . . . . . . . 141 13.3.1 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 13.3.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
st10f280 contents doc id 8673 rev. 3 5/239 13.3.3 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 14 serial channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 14.1 asynchronous / synchronous serial interface (asco) . . . . . . . . . . . . . 148 14.1.1 asco in asynchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 14.1.2 asco in synchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 14.2 high speed synchronous serial channel (ssc) . . . . . . . . . . . . . . . . . . . 152 14.2.1 baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 15 can modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 15.1 memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 15.1.1 can1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 15.1.2 can2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 15.2 can bus configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 15.2.1 single can bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 15.2.2 multiple can bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 15.3 register and message object organization . . . . . . . . . . . . . . . . . . . . . . 157 15.4 can interrupt handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 15.4.1 bit timing configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 15.4.2 mask registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 15.5 the message object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 15.6 arbitration registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 16 watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 17 system reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 17.1 asynchronous reset (long hardware reset) . . . . . . . . . . . . . . . . . . . . . . 171 17.1.1 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 17.1.2 hardware reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 17.1.3 exit of asynchronous reset state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 17.2 synchronous reset (warm reset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 17.2.1 exit of synchronous reset state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 17.3 software reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 17.4 watchdog timer reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 17.5 rstout pin and bidirectional reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 17.6 reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
contents st10f280 6/239 doc id 8673 rev. 3 18 power reduction modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 18.1 idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 18.2 power down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 18.2.1 protected power down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 18.2.2 interruptable power down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 19 special function register overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 19.1 identification registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 19.2 system configuration registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 20 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 20.1 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 20.2 parameter interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 20.3 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 20.3.1 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 20.3.2 conversion timing control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 20.4 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 20.4.1 test waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 20.4.2 definition of internal timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 20.4.3 clock generation modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 20.4.4 prescaler operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 20.4.5 direct drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 20.4.6 oscillator watchdog (owd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 20.4.7 phase locked loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 20.4.8 external clock drive xtal1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 20.4.9 memory cycle variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 20.4.10 multiplexed bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 20.4.11 demultiplexed bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 20.4.12 clkout and ready . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 20.4.13 external bus arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 20.4.14 high-speed synchronous serial interface (ssc) timing . . . . . . . . . . . . 231 21 package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 21.1 ecopack ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 21.2 pbga 208 (23 x 23 x 1.96 mm) mechanical data . . . . . . . . . . . . . . . . . 235
st10f280 contents doc id 8673 rev. 3 7/239 22 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 23 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
list of tables st10f280 8/239 doc id 8673 rev. 3 list of tables table 1. ball description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 table 2. 512 kbyte flash memory block organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 table 3. instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 4. instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 table 5. mac coprocessor specific instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 table 6. pointer post-modification combinations for idxi and rwn . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 7. mac registers referenced as ?coreg? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 8. interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 table 9. exceptions or error conditions that can arise during run-time. . . . . . . . . . . . . . . . . . . . . . . 74 table 10. compare modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 11. capcom timer input frequencies, resolution and periods . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 12. gpt1 timer input frequencies, resolution and periods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 table 13. gpt2 timer input frequencies, resolution and period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 table 14. pwm unit frequencies and resolution at 40mhz cpu clock . . . . . . . . . . . . . . . . . . . . . . . . 81 table 15. xpwm module channel specific register addresses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 table 16. xpwm frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 table 17. pocon registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 table 18. port 2 alternate function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 table 19. port 3 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 table 20. port 4 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 table 21. port 5 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 table 22. port 6 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 table 23. port 7 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 table 24. port 8 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 table 25. xport 10 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 table 26. the different counting modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 table 27. timer registers mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 table 28. commonly used baud rates by reload value and deviation errors . . . . . . . . . . . . . . . . . . 150 table 29. commonly used baud rates by reload value and deviation errors . . . . . . . . . . . . . . . . . . 152 table 30. synchronous baud rate and reload values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 table 31. intid values and corresponding interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 table 32. functions of complementary bit of message control register . . . . . . . . . . . . . . . . . . . . . . 166 table 33. wdtcon bits value on different resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 table 34. wdtrel reload value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 table 35. reset event definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 table 36. port0 latched configuration for the different resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 table 37. port0 bit latched into the different registers after reset . . . . . . . . . . . . . . . . . . . . . . . . . 179 table 38. special function registers listed by name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 table 39. x registers listed by name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 table 40. stack size selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 table 41. absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 table 42. dc characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 table 43. a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 table 44. adc sampling and conversion timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 table 45. cpu frequency generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 table 46. external clock drive xtal1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 table 47. memory cycle variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 table 48. multiplexed bus characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
st10f280 list of tables doc id 8673 rev. 3 9/239 table 49. demultiplexed bus characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 table 50. clkout and ready characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 table 51. external bus arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 table 52. ssc master timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 table 53. ssc slave timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 table 54. pbga 208 (23 x 23 x 1.96 mm) mechanical data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 table 55. device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 table 56. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
list of figures st10f280 10/239 doc id 8673 rev. 3 list of figures figure 1. logic symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 figure 2. ball configuration (bottom view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 figure 3. block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 4. st10f280 on-chip memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 figure 5. bootstrap loader sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 figure 6. hardware provisions to activate the bsl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 figure 7. memory configuration after reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 figure 8. baud rate deviation between host and st10f280 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 figure 9. cpu block diagram (mac unit not included) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 figure 10. mac unit architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 figure 11. chip select delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 figure 12. capcom unit block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 figure 13. block diagram of capcom timers t0 and t7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 figure 14. block diagram of capcom timers t1 and t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 figure 15. block diagram of gpt1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 figure 16. block diagram of gpt2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 figure 17. block diagram of pwm module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 figure 18. sfrs and port pins associated with the xpwm module. . . . . . . . . . . . . . . . . . . . . . . . . . . 82 figure 19. xpwm channel block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 figure 20. operation and output waveform in mode 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 figure 21. operation and output waveform in mode 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 figure 22. operation and output waveform in burst mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 figure 23. operation and output waveform in single shot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 figure 24. xpwm output signal generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 figure 25. sfrs associated with the parallel ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 figure 26. xbus registers associated with the parallel ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 figure 27. output drivers in push/pull mode and in open drain mode . . . . . . . . . . . . . . . . . . . . . . . . . 95 figure 28. hysteresis for special input thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 figure 29. port 0 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 figure 30. block diagram of a port 0 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 figure 31. port 1 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 figure 32. block diagram of a port 1 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 figure 33. port 2 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 figure 34. block diagram of a port 2 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 figure 35. port 3 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 figure 36. block diagram of port 3 pin with alternate input or alternate output function . . . . . . . . . . 114 figure 37. block diagram of pins p3.15 (clkout) and p3.12 (bhe/wrh) . . . . . . . . . . . . . . . . . . . 115 figure 38. port 4 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 figure 39. block diagram of a port 4 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 figure 40. block diagram of p4.4 and p4.5 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 19 figure 41. block diagram of p4.6 and p4.7 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 20 figure 42. port 5 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 figure 43. block diagram of a port 5 pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 figure 44. port 6 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 figure 45. block diagram of port 6 pins with an alternate output function . . . . . . . . . . . . . . . . . . . . . 126 figure 46. port 7 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 figure 47. block diagram of port 7 pins p7.3...p7.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 9 figure 48. block diagram of port 7 pins p7.7...p7.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 0
st10f280 list of figures doc id 8673 rev. 3 11/239 figure 49. port 8 i/o and alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 figure 50. block diagram of port 8 pins p8.7...p8.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 figure 51. port10 i/o and alternate functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 39 figure 52. block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 figure 53. xtimer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 figure 54. xadcinj timer output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 figure 55. external connection for adc channel injection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 figure 56. asynchronous mode of serial channel asc0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 figure 57. synchronous mode of serial channel asc0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 figure 58. synchronous serial channel ssc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 figure 59. single can bus multiple interfaces - multiple transceivers. . . . . . . . . . . . . . . . . . . . . . . 156 figure 60. single can bus dual interfaces - single transceiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 figure 61. connection to two different can buses (e.g. for gateway application). . . . . . . . . . . . . . . 157 figure 62. can module address map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 figure 63. bit timing definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 figure 64. message object address map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 figure 65. asynchronous reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 figure 66. synchronous warm reset (short low pulse on rstin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 figure 67. synchronous warm reset (long low pulse on rstin) . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 figure 68. internal (simplified) reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 figure 69. minimum external reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 figure 70. external reset hardware circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 figure 71. external rc circuit on rpd pin for exiting power down mode with external interrupt . . . 183 figure 72. simplified power down exit circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 figure 73. power down exit sequence when using an external interrupt (pll x 2) . . . . . . . . . . . . . . 184 figure 74. supply / idle current as a function of operating frequency . . . . . . . . . . . . . . . . . . . . . . . . 207 figure 75. input / output waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 figure 76. float waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 figure 77. generation mechanisms for the cpu clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 figure 78. approximated maximum pll jitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4 figure 79. external clock drive xtal1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 figure 80. external memory cycle: multiplexed bus, with / without read / write delay, normal ale. . 218 figure 81. external memory cycle: multiplexed bus, with / without read / write delay, extended ale219 figure 82. external memory cycle: multiplexed bus, with / without read / write delay, normal ale, read / write chip select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 figure 83. external memory cycle: multiplexed bus, with / without read / write delay, extended ale, read / write chip select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 figure 84. external memory cycle: demultiplexed bus, with / without read / write delay, normal ale224 figure 85. external memory cycle: demultiplexed bus, with / without read / write delay, extended ale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 figure 86. external memory cycle: demultiplexed bus, with / without read / write delay, normal ale, read / write chip select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 figure 87. external memory cycle: demultiplexed bus, no read / write delay, extended ale, read /write chip select. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 figure 88. clkout and ready . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 figure 89. external bus arbitration, releasing the bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 0 figure 90. external bus arbitration, (regaining the bus) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1 figure 91. ssc master timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 figure 92. ssc slave timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 figure 93. package outline pbga 208 (23 x 23 x 1.96 mm) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
description st10f280 12/239 doc id 8673 rev. 3 1 description the st10f280 is a new derivative of the stmicroelectronics ? st10 family of 16-bit single- chip cmos microcontrollers. it combines high cpu performance (up to 20 million instructions per second) with high peripheral functionality and enhanced i/o-capabilities. it also provides on-chip high-speed single voltage flash memory, on-chip high-speed ram, and clock generation via pll. st10f280 is processed in 0.35 m cmos technology. the mcu core and the logic is supplied with a 5v to 3.3v on chip voltage regulator. the part is supplied with a single 5v supply and i/os work at 5v. the device is upward compatible with the st10f269 device, with the following set of differences: two supply pins (dc1,dc2) on the pbga-208 package are used for decoupling the internally generated 3.3v core logic supply. do not connect these two pins to 5.0v external supply. instead, these pins should be connected to a decoupling capacitor (ceramic type, value 330nf). the a/d converter characteristics stay identical but 16 new input channel are added. a bit in a new register (xadcmux) control the multiplexage between the first block of 16 channel (on port5) and the second block (on xport10). the conversion result registers stay identical and the software management can determine the block in use. a new dedicated timer controls now the adc channel injection mode on the input cc31 (p7.7). the output of this timer is visible on a dedicated pin (xadcinj) to emulate this new functionality. a second xpwm peripheral (4 new channels) is added. four dedicated pins are reserved for the outputs (xpwm[0:3]) a new general purpose i/o port named xport9 (16 bits) is added. due to the bit addressing management, it will be different from other standard general purpose i/o ports.
st10f280 description doc id 8673 rev. 3 13/239 figure 1. logic symbol 84!, 234). 84!, 234/54 .-) %! 2%!$9 !,% 2$ 72 72, 0ort  bit 0o rt  bit 0o rt  bit 0o rt  bit 0o rt  bit 0o rt  bit 0o rt  bit 6 $$ 6 33 0o rt  bit 0ort  bit 6 !2%& 6 !'.$ 80ort  bit 807-  bit 8!$#).* 80ort  bit $# $# $ecouplingcapacitorforinternalregulator 34& ("1($'5
ball data st10f280 14/239 doc id 8673 rev. 3 2 ball data the st10f280 package is a pbga of 23 x 23 x 1.96 mm. the pitch of the balls is 1.27 mm. the signal assignment of the 208 balls is described in figure 2 for the configuration and in ta b l e 1 for the ball signal assignment. this package has 25 additional thermal balls. figure 2. ball configuration (bottom view) k7 v ss k8 v ss k9 v ss j7 v ss j8 v ss j9 v ss h7 v ss h8 v ss h9 v ss g7 v ss g8 v ss g9 v ss k10 v ss k11 v ss j10 v ss j11 v ss h10 v ss h11 v ss g10 v ss g11 v ss v ss v ss v ss v ss v ss u1 u2 v aref u3 v agnd u4 u5 u6 u7 u8 u9 u10 v ss u11 dc2 u12 u13 u14 u15 u16 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 r1 r2 r3 r4 r14 r15 r16 m1 m2 m3 m15 m16 m17 l1 v ss l2 l3 l15 l16 l17 v dd k1 v dd k2 k3 k15 k16 k17 v ss j1 j2 j3 j15 j16 j17 h1 h2 h3 h15 h16 h17 g1 g2 g3 g15 g16 g17 f1 f2 f3 f15 f16 f17 e1 e2 e3 e15 e16 e17 v ss d1 d2 d3 d15 d16 d17 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 a1 a2 a3 a4 rstin a5 xtal1 a6 xtal2 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a b c d e f g h j k l m n p r t a b c d e f g h j k l m n p r t 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 u17 t17 r17 c17 b17 a17 u u v ss dc1 v dd m4 l4 k4 j4 h4 g4 e4 d4 m14 l14 k14 j14 h14 g14 e14 d14 p15 p16 p17 p14 d5 d6 d7 d8 d9 d10 d11 d12 d13 p5 p6 p7 p8 p9 p10 p11 p12 p13 n1 n2 n3 n4 f4 f14 l7 l8 l9 l10 l11 v dd v dd v ss v dd v ss v dd v ss v dd v ss v ss v dd v ss v dd p3.15 v dd v ss rpd xp10.3 xp10.2 xp10.1 xp10.0 xp10.4 xp10.5 xp10.6 xp10.7 xp10.11 xp10.8 p5.6 p5.10 p5.14 xp10.9 xp10.10 xp10.13 xp10.12 p5.1 p5.3 p5.7 p5.11 p5.15 xp10.14 p5.0 p5.2 p5.4 p5.8 p5.12 xp10.15 p5.5 p5.9 p5.13 xpwm.0 xpwm.1 xpwm.2 xpwm.3 p6.0 p6.1 p6.2 p6.3 p6.4 p6.5 p6.6 p6.7 p8.0 p8.1 p8.2 p8.3 p8.4 p8.5 p8.6 p8.7 p7.0 p7.1 p7.2 p7.3 p7.4 p7.5 p7.6 p7.7 xadcinj p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 p3.13 p4.0 p4.1 p4.2 p4.3 p4.4 p4.5 p4.6 p4.7 rd wr ready ale ea p0.0 p0.1 p0.2 p0.3 p0.4 p0.5 p0.6 p0.7 p0.8 p0.9 p0.10 p0.11 p0.12 p0.13 p0.14 p0.15 xp9.0 xp9.1 xp9.2 xp9.3 xp9.4 xp9.5 xp9.6 xp9.7 xp9.8 xp9.9 xp9.10 xp9.11 xp9.12 xp9.13 xp9.14 xp9.15 p1.0 p1.1 p1.2 p1.3 p1.4 p1.5 p1.6 p1.7 p1.8 p1.9 p1.10 p1.11 p1.12 p1.13 p1.14 p1.15 v ss rstout nmi v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss r5 r6 r7 r8 r9 r10 r11 r12 r13 n15 n16 n17 n14 p1 p2 p3 p4
st10f280 ball data doc id 8673 rev. 3 15/239 table 1. ball description symbol ball number type function p6.0 ? p6.7 i/o port 6 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 6 outputs can be configured as push/pull or open drain drivers. the following port 6 pins also serve for alternate functions: e4 o p6.0 cs0 chip select 0 output d3 o p6.1 cs1 chip select 1 output b1 o p6.2 cs2 chip select 2 output c1 o p6.3 cs3 chip select 3 output d2 o p6.4 cs4 chip select 4 output e3 i p6.5 hold external master hold request input f4 o p6.6 hlda hold acknowledge output d1 o p6.7 breq bus request output p8.0 ? p8.7 i/o port 8 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 8 outputs can be configured as push/pull or open drain drivers. the input threshold of port 8 is selectable (ttl or special). the following port 8 pins also serve for alternate functions: e2 i/o p8.0 cc16io capcom2: cc16 capture input / compare output f3 i/o p8.1 cc17io capcom2: cc17 capture input / compare output f2 i/o p8.2 cc18io capcom2: cc18 capture input / compare output g3 i/o p8.3 cc19io capcom2: cc19 capture input / compare output g2 i/o p8.4 cc20io capcom2: cc20 capture input / compare output h4 i/o p8.5 cc21io capcom2: cc21 capture input / compare output h3 i/o p8.6 cc22io capcom2: cc22 capture input / compare output h2 i/o p8.7 cc23io capcom2: cc23 capture input / compare output
ball data st10f280 16/239 doc id 8673 rev. 3 p7.0 ? p7.7 i/o port 7 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 7 outputs can be configured as push/pull or open drain drivers. the input threshold of port 7 is selectable (ttl or special). the following port 7 pins also serve for alternate functions: j4 o p7.0 pout0 pwm channel 0 output j3 o p7.1 pout1 pwm channel 1 output j2 o p7.2 pout2 pwm channel 2 output j1 o p7.3 pout3 pwm channel 3 output k2 i/o p7.4 cc28io capcom2: cc28 capture input / compare output k3 i/o p7.5 cc29io capcom2: cc29 capture input / compare output k4 i/o p7.6 cc30io capcom2: cc30 capture input / compare output l2 i/o p7.7 cc31io capcom2: cc31 capture input / compare output xp10.0 ? xp10.15 i xport 10 is a 16-bit input-only port with schmitt-trigger characteristics. the pins of xport10 also serve as the analog input channels (up to 16) for the a/d converter, where xp10.x equals anx (analog input channel x). m4 m3 m2 m1 n4 n3 n2 n1 p4 p3 p2 p1 r2 r1 t1 u1 i i i i i i i i i i i i i i i i xp10.0 xp10.1 xp10.2 xp10.3 xp10.4 xp10.5 xp10.6 xp10.7 xp10.8 xp10.9 xp10.10 xp10.11 xp10.12 xp10.13 xp10.14 xp10.15 table 1. ball description (continued) symbol ball number type function
st10f280 ball data doc id 8673 rev. 3 17/239 p5.0 ? p5.15 i port 5 is a 16-bit input-only port with schmitt-trigger characteristics. the pins of port 5 also serve as the analog input channels (up to 16) for the a/d converter, where p5.x equals anx (analog input channel x), or they serve as timer inputs: t2 i p5.0 r3 i p5.1 t3 i p5.2 r4 i p5.3 t4 i p5.4 u4 i p5.5 p5 i p5.6 r5 i p5.7 t5 i p5.8 u5 i p5.9 p6 i p5.10 t6eud gpt2 timer t6 external up / down control input r6 i p5.11 t5eud gpt2 timer t5 external up / down control input t6 i p5.12 t6in gpt2 timer t6 count input u6 i p5.13 t5in gpt2 timer t5 count input p7 i p5.14 t4eud gpt1 timer t4 external up / down control input r7 i p5.15 t2eud gpt1 timer t2 external up / down control input table 1. ball description (continued) symbol ball number type function
ball data st10f280 18/239 doc id 8673 rev. 3 p2.0 ? p2.15 i/o port 2 is a 16-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 2 outputs can be configured as push/pull or open drain drivers. the input threshold of port 2 is selectable (ttl or special). the following port 2 pins also serve for alternate functions: t7 i/o p2.0 cc0io capcom: cc0 capture input / compare output p8 i/o p2.1 cc1io capcom: cc1 capture input / compare output r8 i/o p2.2 cc2io capcom: cc2 capture input / compare output t8 i/o p2.3 cc3io capcom: cc3 capture input / compare output t9 i/o p2.4 cc4io capcom: cc4 capture input / compare output p9 i/o p2.5 cc5io capcom: cc5 capture input / compare output r9 i/o p2.6 cc6io capcom: cc6 capture input / compare output u9 i/o p2.7 cc7io capcom: cc7 capture input / compare output t10 i/o i p2.8 cc8io capcom: cc8 capture input / compare output, ex0in fast external interrupt 0 input r10 i/o i p2.9 cc9io capcom: cc9 capture input / compare output, ex1in fast external interrupt 1 input p10 i/o i p2.10 cc10io capcom: cc10 capture input / compare output, ex2in fast external interrupt 2 input t11 i/o i p2.11 cc11io capcom: cc11 capture input / compare output, ex3in fast external interrupt 3 input r11 i/o i p2.12 cc12io capcom: cc12 capture input / compare output, ex4in fast external interrupt 4 input u12 i/o i p2.13 cc13io capcom: cc13 capture input / compare output, ex5in fast external interrupt 5 input p11 i/o i p2.14 cc14io capcom: cc14 capture input / compare output, ex6in fast external interrupt 6 input t12 i/o i i p2.15 cc15io capcom: cc15 capture input / compare output, ex7in fast external interrupt 7 input t7in capcom2 timer t7 count input table 1. ball description (continued) symbol ball number type function
st10f280 ball data doc id 8673 rev. 3 19/239 p3.0 - p3.13, p3.15 i/o port 3 is a 15-bit (p3.14 is missing) bidirectional i/o port. it is bit- wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 3 outputs can be configured as push/pull or open drain drivers. the input threshold of port 3 is selectable (ttl or special). the following port 3 pins also serve for alternate functions: r12 i p3.0 t0in capcom timer t0 count input t13 o p3.1 t6out gpt2 timer t6 toggle latch output p12 i p3.2 capin gpt2 register caprel capture input r13 o p3.3 t3out gpt1 timer t3 toggle latch output t14 i p3.4 t3eud gpt1 timer t3 external up / down control input p13 i p3.5 t4in gpt1 timer t4 input for count / gate / reload / capture r14 i p3.6 t3in gpt1 timer t3 count / gate input p14 i p3.7 t2in gpt1 timer t2 input for count / gate / reload / capture r15 i/o p3.8 mrst ssc master-receive / slave-transmit i/o r16 i/o p3.9 mtsr ssc master-transmit / slave-receive o/i n14 i/o p3.10 txd0 asc0 clock / data output (asynchronous / synchronous) p15 o p3.11 rxd0 asc0 data input (asynchronous) or i/o (synchronous) p16 o p3.12 bhe external memory high byte enable signal, wrh external memory high byte write strobe m14 i/o p3.13 sclk ssc master clock output / slave clock input t17 o p3.15 clkout system clock output (= cpu clock) table 1. ball description (continued) symbol ball number type function
ball data st10f280 20/239 doc id 8673 rev. 3 p4.0 ? p4.7 i/o port 4 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. the input threshold is selectable (ttl or special). p4.6 & p4.7 outputs can be configured as push-pull or open-drain drivers. in case of an external bus configuration, port 4 can be used to output the segment address lines: n16 o p4.0 a16 least significant segment address line m15 o p4.1 a17 segment address line l14 o p4.2 a18 segment address line m16 o p4.3 a19 segment address line l15 o i p4.4 a20 segment address line can2_rxd can2 receive data input l16 o i p4.5 a21 segment address line can1_rxd can1 receive data input k14 o o p4.6 a22 segment address line, can_txd can1_txd can1 transmit data output k15 o o p4.7 a23 most significant segment address line can2_txd can2 transmit data output rd j14 o external memory read strobe. rd is activated for every external instruction or data read access. wr /wrl j15 o external memory write strobe. in wr -mode this pin is activated for every external data write access. in wrl -mode this pin is activated for low byte data write accesses on a 16-bit bus, and for every data write access on an 8-bit bus. see wrcfg in register syscon for mode selection. ready/ ready j16 i ready input. the active level is programmable. when the ready function is enabled, the selected inactive level at this pin during an external memory access will force the insertion of memory cycle time waitstates until the pin returns to the selected active level. ale j17 o address latch enable output. can be used for latching the address into external memory or an address latch in the multiplexed bus modes. ea h17 i external access enable pin. a low level at this pin during and after reset forces the st10f280 to begin instruction execution out of external memory. a high level forces execution out of the internal flash memory. table 1. ball description (continued) symbol ball number type function
st10f280 ball data doc id 8673 rev. 3 21/239 port0: p0l.0 - p0l.7, p0h.0 - p0h.7 i/o port0 consists of the two 8-bit bidirectional i/o ports p0l and p0h. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high- impedance state. in case of an external bus configuration, port0 serves as the address (a) and address/data (ad) bus in multiplexed bus modes and as the data (d) bus in demultiplexed bus modes. demultiplexed bus modes: data path width: 8-bit 16-bit p0l.0 ? p0l.7: d0 - d7 d0 - d7 p0h.0 ? p0h.7: i/o d8 - d15 multiplexed bus modes: data path width: 8-bit 16-bit p0l.0 ? p0l.7: ad0 - ad7 ad0 - ad7 p0h.0 ? p0h.7: a8 - a15 ad8 - ad15 h16 i/o p0l.0 h15 i/o p0l.1 h14 i/o p0l.2 g16 i/o p0l.3 g15 i/o p0l.4 g14 i/o p0l.5 f16 i/o p0l.6 e17 i/o p0l.7 f15 i/o p0h.0 e16 i/o p0h.1 f14 i/o p0h.2 d17 i/o p0h.3 e15 i/o p0h.4 d16 i/o p0h.5 c17 i/o p0h.6 e14 i/o p0h.7 table 1. ball description (continued) symbol ball number type function
ball data st10f280 22/239 doc id 8673 rev. 3 xport9.0 - xport9.15 i/o xport 9 is a 16-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. xport 9 outputs can be configured as push/pull or open drain drivers. d15 i/o xport9.0 c16 i/o xport9.1 d14 i/o xport9.2 c15 i/o xport9.3 b16 i/o xport9.4 d13 i/o xport9.5 c14 i/o xport9.6 b15 i/o xport9.7 a15 i/o xport9.8 b14 i/o xport9.9 c13 i/o xport9.10 d12 i/o xport9.11 b13 i/o xport9.12 c12 i/o xport9.13 d11 i/o xport9.14 b12 i/o xport9.15 table 1. ball description (continued) symbol ball number type function
st10f280 ball data doc id 8673 rev. 3 23/239 port1: p1l.0 - p1l.7, p1h.0 - p1h.7 i/o port1 consists of the two 8-bit bidirectional i/o ports p1l and p1h. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high- impedance state. port1 is used as the 16-bit address bus (a) in demultiplexed bus modes and also after switching from a demultiplexed bus mode to a multiplexed bus mode. the following port1 pins also serve for alternate functions: c11 i/o p1l.0 b11 i/o p1l.1 d10 i/o p1l.2 c10 i/o p1l.3 b10 i/o p1l.4 a10 i/o p1l.5 d9 i/o p1l.6 c9 i/o p1l.7 c8 i/o p1h.0 d8 i/o p1h.1 a7 i/o p1h.2 b7 i/o p1h.3 c7 i p1h.4 cc24io capcom2: cc24 capture input d7 i p1h.5 cc25io capcom2: cc25 capture input c5 i p1h.6 cc26io capcom2: cc26 capture input c6 i p1h.7 cc27io capcom2: cc27 capture input xtal1 a5 i xtal1: input to the oscillator amplifier and input to the internal clock generator xtal2 a6 o xtal2: output of the oscillator amplifier circuit. to clock the device from an external source, drive xtal1, while leaving xtal2 unconnected. minimum and maximum high/low and rise/fall times specified in the ac characteristics must be observed. rstin a3 i reset input with schmitt-trigger characteristics. a low level at this pin for a specified duration while the oscillator is running resets the st10f280. an internal pull-up resistor permits power-on reset using only a capacitor connected to v ss . in bidirectional reset mode (enabled by setting bit bdrsten in syscon register), the rstin line is pulled low for the duration of the internal reset sequence. rstout b4 o internal reset indication output. this pin is set to a low level when the part is executing either a hardware, a software or a watchdog timer reset. rstout remains low until the einit (end of initialization) instruction is executed. table 1. ball description (continued) symbol ball number type function
ball data st10f280 24/239 doc id 8673 rev. 3 nmi c4 i non-maskable interrupt input. a high to low transition at this pin causes the cpu to vector to the nmi trap routine. if bit pwdcfg = ?0? in syscon register, when the pwrdn (power down) instruction is executed, the nmi pin must be low in order to force the st10f280 to go into power down mode. if nmi is high and pwdcfg =?0?, when pwrdn is executed, the part will continue to run in normal mode. if not used, pin nmi should be pulled high externally. xpwm.0 d4 o xpwm channel 0 output xpwm.1 c3 o xpwm channel 1 output xpwm.2 b2 o xpwm channel 2 output xpwm.3 c2 o xpwm channel 3 output xadcinj l3 o output trigger for adc channel injection v aref u2 - reference voltage for the a/d converter. v agnd u3 - reference ground for the a/d converter. rpd m17 i/o timing pin for the return from powerdown circuit and synchronous/asynchronous reset selection. dc1 g1 o 3.3v decoupling pin: a decoupling capacitor of ~330 nf must be connected between this pin and nearest v ss pin. dc2 u11 o 3.3v decoupling pin: a decoupling capacitor of ~330 nf must be connected between this pin and v ss nearest pin. v dd a2 a9 a12 a14 e1 k1 u8 u15 p17 l17 g17 - digital supply voltage: + 5 v during normal operation, idle mode and power down mode table 1. ball description (continued) symbol ball number type function
st10f280 ball data doc id 8673 rev. 3 25/239 v ss a1 a4 a8 a11 a13 a16 a17 b3 b5 b6 b8 b9 b17 d5 d6 f1 f17 g4 h1 k16 k17 l1 l4 n15 n17 r17 t15 t16 u7 u10 u13 u14 u16 u17 - digital ground. table 1. ball description (continued) symbol ball number type function
functional description st10f280 26/239 doc id 8673 rev. 3 3 functional description the architecture of the st10f280 combines advantages of both risc and cisc processors and an advanced peripheral subsystem. the block diagram gives an overview of the different on-chip components and the high bandwidth internal bus structure of the st10f280. figure 3. block diagram 0#!.?4x$ 0#!.?4x$ 0#!.?2x$ 0#!.?2x$ 0ort 0ort 0ort 0ort 0ort 0ort 0ort '04 '04 !3#usart "2' #05 #oreand-!#5nit )nte rnal 2!- 7atchdog )nterrupt#ontroller      0%#   #!. 0ort 0ort %xternal"us  "it!$# "2' 33# 07- #!0#/- #!0#/-  /scillator #ontroller    +"yte and0,, &lash-emo ry 84!, 84!, +"yte      6 6oltage 2egulator +"yte 82!- #!. 80/24  807-  84)-%2 04riggerfor!$#  80/24   8!$#).* channelinjection %xternalconnexion ("1($'5
st10f280 memory organization doc id 8673 rev. 3 27/239 4 memory organization the memory space of the st10f280 is configured in a unified memory architecture. code memory, data memory, registers and i/o ports are organized within the same linear address space of 16m bytes. the entire memory space can be accessed byte-wise or word-wise. particular portions of the on-chip memory have additionally been made directly bit addressable. flash: 512k bytes of on-chip single voltage flash memory. iram: 2k bytes of on-chip internal ram (dual-port) is provided as a storage for data, system stack, general purpose register banks and code. the register bank can consist of up to 16 word-wide (r0 to r15) and/or byte-wide (rl0, rh0, ?, rl7, rh7) general purpose registers. base address is 00?f600h, upper address is 00?fdffh. xram: 16k bytes of on-chip extension ram (single port xram) is provided as a storage for data, user stack and code. the xram is a single bank, connected to the internal xbus and are accessed like an external memory in 16-bit demultiplexed bus-mode without waitstate or read/write delay (50ns access at 40mhz cpu clock). byte and word access is allowed. the xram address range is 00?8000h - 00?bfffh if enabled (xpen set bit 2 of syscon register-, and xramen set bit 2 of xpercon register-). if bit xramen or xpen is cleared, then any access in the address range 00?8000h 00?bfffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register as the xram appears like external memory, it cannot be used for the st10f280?s system stack or register banks. the xram is not provided for single bit storage and therefore is not bit addressable. sfr/esfr : 1024 bytes (2 * 512 bytes) of address space is reserved for the special function register areas. sfrs are word-wide registers which are used for controlling and monitoring functions of the different on-chip units. can1: address range 00?ef00h 00?efffh is reserved for the can1 module access. the can1 is enabled by setting xpen bit 2 of the syscon register and bit 0 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16- bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. can2: address range 00?ee00h 00?eeffh is reserved for the can2 module access. the can2 is enabled by setting xpen bit 2 of the syscon register and bit 1 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16- bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. in order to meet the needs of designs where more memory is required than is provided on chip, up to 16m bytes of external ram and/or rom can be connected to the microcontroller. if one or the two can modules are used, port 4 can not be programmed to output all 8 segment address lines. thus, only 4 segment address lines can be used, reducing the external memory space to 5m bytes (1m byte per cs line). xpwm: address range 00?ec00h 00?ecffh is reserved for the xpwm module access. the xpwm is enabled by setting xpen bit 2 of the syscon register and bit 4 of the new xpercon register. accesses to the xpwm module use demultiplexed addresses and a 16-
memory organization st10f280 28/239 doc id 8673 rev. 3 bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. xport9, xtimer, xport10, xadcmux: address range 00?c000h 00?c3ffh is reserved for the xport9, xport10, xtimer and xadcmux peripherals access. the xport9, xtimer, xport10, xadcmux are enabled by setting xpen bit 2 of the syscon register and the bit 3 of the new xpercon register. accesses to the xport9, xtimer, xport10 and xadcmux modules use a 16-bit demultiplexed bus mode without waitstate or read/write delay (50ns access at 40mhz cpu clock). byte and word access is allowed. 4.1 visibility of xbus peripherals the xbus peripherals can be separately selected for being visible to the user by means of corresponding selection bits in the xpercon register. if not selected (not activated with xpercon bit) before the global enabling with xpen-bit in syscon register, the corresponding address space, port pins and interrupts are not occupied by the peripheral, thus the peripheral is not visible and not available. syscon register is described in section 19.2: system configuration registers .
st10f280 memory organization doc id 8673 rev. 3 29/239 figure 4. st10f280 on-chip memory mapping              # &&&& 3&2"ytes  ?)( &$&& )2!-+"ytes  ?)
"locks andmayberemappedfromsegmenttosegment bysetting393#/. 2/-3before%).)4 2!- 3&2and8 pheripheralsare mappedintotheaddressspace 6hjphqw 6hjphqw 6hjphqw 6hjphqw 6hjphqw 'dwd 3djh 1xpehu $evroxwh 0hpru\ $gguhvv  &&& %3&2"ytes  ?) %&&& #!."ytes ?( )  %%&& #!."ytes ?( (  #&& 80/2484)-%2 ?&  %#&& 807- ?(& "lock+"ytes ,qwhuqdo )odvk 0hpru\ "lock+"ytes "lock+"ytes     #    "lock+"ytes "lock+"ytes "lock+"ytes "lock+"ytes "lock
"lock
"lock
$ata0age.umberand!bsolute-emory!ddressarehexadecimalva lues    "lock+"ytes 6hjphqw    "&&& 82!-+"ytes 80/24 8!$#-58 ("1($'5
memory organization st10f280 30/239 doc id 8673 rev. 3 xpercon address: 0xf024h / 12h esfr reset: 0x--05h type: r/w note: when both can and xpwm are disabled via xpercon setting, then any access in the address range 00?ec00h 00?efffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register. p4.4 and p4.7 can be used as general purpose i/o when can2 is not enabled, and p4.5 and p4.6 can be used as general purpose i/o when can1 is not enabled. the default xper selection after reset is: xcan1 is enabled, xcan2 is disabled, xram is enabled, xport9, xtimer, xport10, xpwm, xadcmux are disabled. register xpercon cannot be changed after the global enabling of xperipherals, i.e. after setting of bit xpen in syscon register. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - - - - xpwmen xperconen3 xramen can2en can1en r/w r/w r/w r/w r/w can1en can1 enable bit 0: accesses to the on-chip can1 xperipheral and its functions are disabled. p4.5 and p4.6 pins can be used as general purpose i/os. address range 00?ef00h- 00?efffh is only directed to external memory if can2en and xpwm bits are cleared also. 1: the on-chip can1 xperipheral is enabled and can be accessed. can2en can2 enable bit 0: accesses to the on-chip can2 xperipheral and its functions are disabled. p4.4 and p4.7 pins can be used as general purpose i/os. address range 00?ee00h- 00?eeffh is only directed to external memory if can1en and xpwm bits are cleared also. 1: the on-chip can2 xperipheral is enabled and can be accessed. xramen xram enable bit 0: accesses to the on-chip 16k byte xram are disabled, external access performed. 1: the on-chip 16k byte xram is enabled and can be accessed. xperconen3 xport9, xtimer, xport10, xadcmux enable bit 0: accesses to the xport9, xtimer, xport10, xadcmux peripherals are disabled, external access performed. 1: the on-chip xport9, xtimer, xport10, xadcmux peripherals are enabled and can be accessed. xpwmen xpwm enable bit 0: accesses to the on-chip xpwm are disabled, external access performed. address range 00?ec00h-00?ecffh is only directed to external memory if can1en and can2en are ?0? also 1: the on-chip xpwm is enabled and can be accessed.
st10f280 internal flash memory doc id 8673 rev. 3 31/239 5 internal flash memory 5.1 overview 512k byte on-chip flash memory two possibilities of flash mapping into the cpu address space flash memory can be used for code and data storage 32-bit, zero waitstate read access (50ns cycle time at f cpu = 40mhz) erase-program controller (epc) similar to m29f400b stm?s stand-alone flash memory ? word-by-word programmable (16 s typical) ? data polling and toggle protocol for epc status ? internal power-on detection circuit memory erase in blocks ? one 16k byte, two 8k byte, one 32k byte, seven 64k byte blocks ? each block can be erased separately (1.5 second typical) ? chip erase (8.5 second typical) ? each block can be separately protected against programming and erasing ? each protected block can be temporary unprotected ? when enabled, the read protection prevents access to data in flash memory using a program running out of the flash memory space. access to data of internal flash can only be performed with an inner protected program erase suspend and resume modes ? read and program another block during erase suspend single voltage operation, no need of dedicated supply pin low power consumption: ? 45ma max. read current ? 60ma max. program or erase current ? automatic stand-by-mode (50 a maximum) 100,000 erase-program cycles per block, 20 year data retention time operating temperature: -40 to +125 o c 5.2 operational overview 5.2.1 read mode in standard mode (the normal operating mode) the flash appears like an on-chip rom with the same timing and functionality. the flash module offers a fast access time, allowing zero waitstate access with cpu frequency up to 40mhz. instruction fetches and data operand reads are performed with all addressing modes of the st10f280 instruction set. in order to optimize the programming time of the internal flash, blocks of 8k bytes, 16k bytes, 32k bytes, 64k bytes can be used. but the size of the blocks does not apply to the whole memory space, see details in ta b l e 2 .
internal flash memory st10f280 32/239 doc id 8673 rev. 3 5.2.2 instructions and commands all operations besides normal read operations are initiated and controlled by command sequences written to the flash command interface (ci). the command interface (ci) interprets words written to the flash memory and enables one of the following operations: read memory array program word block erase chip erase erase suspend erase resume block protection block temporary unprotection code protection commands are composed of several write cycles at specific addresses of the flash memory. the different write cycles of such command sequences offer a fail-safe feature to protect against an inadvertent write. a command only starts when the command interface has decoded the last write cycle of an operation. until that last write is performed, flash memory remains in read mode note: as it is not possible to perform write operations in the flash while fetching code from flash, the flash commands must be written by instructions executed from internal ram or external memory. command write cycles do not need to be consecutively received, pauses are allowed, save for block erase command. during this operation all erase confirm commands must be sent to complete any block erase operation before time-out period expires (typically 96 s). command sequencing must be followed exactly. any invalid combination of commands will reset the command interface to read mode. table 2. 512 kbyte flash memory block organization block addresses (segment 0) addresses (segment 1) size (kbyte) 0 1 2 3 4 5 6 7 8 9 10 00?0000h to 00?3fffh 00?4000h to 00?5fffh 00?6000h to 00?7fffh 01?8000h to 01?ffffh 02?0000h to 02?ffffh 03?0000h to 03?ffffh 04?0000h to 04?ffffh 05?0000h to 05?ffffh 06?0000h to 06?ffffh 07?0000h to 07?ffffh 08?0000h to 08?ffffh 01?0000h to 01?3fffh 01?4000h to 01?5fffh 01?6000h to 01?7fffh 01?8000h to 01?ffffh 02?0000h to 02?ffffh 03?0000h to 03?ffffh 04?0000h to 04?ffffh 05?0000h to 05?ffffh 06?0000h to 06?ffffh 07?0000h to 07?ffffh 08?0000h to 08?ffffh 16 8 8 32 64 64 64 64 64 64 64
st10f280 internal flash memory doc id 8673 rev. 3 33/239 5.2.3 status register this register is used to flag the status of the memory and the result of an operation. this register can be accessed by read cycles during the erase-program controller (epc) operation. 5.2.4 erase operation this flash memory features a block erase architecture with a chip erase capability too. erase is accomplished by executing the six cycle erase command sequence. additional command write cycles can then be performed to erase more than one block in parallel. when a time-out period elaps (96 s) after the last cycle, the erase-program controller (epc) automatically starts and times the erase pulse and executes the erase operation. there is no need to program the block to be erased with ?0000h? before an erase operation. termination of operation is indicated in the flash status register. after erase operation, the flash memory locations are read as 'ffffh? value. 5.2.5 erase suspend a block erase operation is typically executed within 1.5 second for a 64k byte block. erasure of a memory block may be suspended, in order to read data from another block or to program data in another block, and then resumed. 5.2.6 in-system programming in-system programming is fully supported. no special programming voltage is required. because of the automatic execution of erase and programming algorithms, write operations are reduced to transferring commands and data to the flash and reading the status. any code that programs or erases flash memory locations (that writes data to the flash) must be executed from memory outside the on-chip flash memory itself (on-chip ram or external memory). a boot mechanism is provided to support in-system programming. it works using serial link via usart interface and a pc compatible or other programming host. 5.2.7 read/write protection the flash module supports read and write protection in a very comfortable and advanced protection functionality. if read protection is installed, the whole flash memory is protected against any "external" read access; read accesses are only possible with instructions fetched directly from program flash memory. for update of the flash memory a temporary disable of flash read protection is supported. the device also features a block write protection. software locking of selectable memory blocks is provided to protect code and data. this feature will disable both program and erase operations in the selected block(s) of the memory. block protection is accomplished by block specific lock-bit which are programmed by executing a four cycle command sequence. the locked state of blocks is indicated by specific flags in the according block status registers. a block may only be temporarily unlocked for update (write) operations. with the two possibilities for write protection whole memory or block specific a flexible installation of write protection is supported to protect the flash memory or parts of it from unauthorized programming or erase accesses and to provide virus-proof protection for all system code blocks. all write protection also is enabled during boot operation.
internal flash memory st10f280 34/239 doc id 8673 rev. 3 5.2.8 power supply, reset the flash module uses a single power supply for both read and write functions. internally generated and regulated voltages are provided for the program and erase operations from 5v supply. once a program or erase cycle has been completed, the device resets to the standard read mode. at power-on, the flash memory has a setup phase of some microseconds (dependent on the power supply ramp-up). during this phase, flash can not be read. thus, if ea pin is high (execution will start from flash memory), the cpu remains in reset state until the flash can be accessed. 5.3 architectural description the flash module distinguishes two basic operating modes, the standard read mode and the command mode. the initial state after power-on and after reset is the standard read mode. 5.3.1 read mode the flash module enters the standard operating mode, the read mode: after reset command after every completed erase operation after every completed programming operation after every other completed command execution few microseconds after a cpu-reset has started after incorrect address and data values of command sequences or writing them in an improper sequence after incorrect write access to a read protected flash memory the read mode remains active until the last command of a command sequence is decoded which starts directly a flash array operation, such as: erase one or several blocks program a word into flash array protect / temporary unprotect a block. in the standard read mode read accesses are directly controlled by the flash memory array, delivering a 32-bit double word from the addressed position. read accesses are always aligned to double word boundaries. thus, both low order address bit a1 and a0 are not used in the flash array for read accesses. the high order address bit a18/a17/a16 define the physical 64k bytes segment being accessed within the flash array. 5.3.2 command mode every operation besides standard read operations is initiated by commands written to the flash command register. the addresses used for command cycles define in conjunction with the actual state the specific step within command sequences. with the last command of a command sequence, the erase-program controller (epc) starts the execution of the command. the epc status is indicated during command execution by: status register ready/busy signal
st10f280 internal flash memory doc id 8673 rev. 3 35/239 5.3.3 flash status register the flash status register is used to flag the status of the flash memory and the result of an operation. this register can be accessed by read cycles during the program-erase controller operations. the program or erase operation can be controlled by data polling on bit fsb.7 of status register, detection of toggle on fsb.6 and fsb.2, or error on fsb.5 and erase timeout on fsb.3 bit. any read attempt in flash during epc operation will automatically output these five bits. the epc sets bit fsb.2, fsb.3, fsb.5, fsb.6 and fsb.7. other bit are reserved for future use and should be masked. flash status address: see note for address type: r 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------fsb.7fsb.6fsb.5-fsb.3fsb.2-- rrr rr fsb.7 flash status bit 7: data polling bit programming operation: this bit outputs the complement of the bit 7 of the word being programmed, and after completion, will output the bit 7 of the word programmed. erasing operation: outputs a ?0? during erasing, and ?1? after erasing completion. if the block selected for erasure is (are) protected, fsb.7 will be set to ?0? for about 100 s, and then return to the previous addressed memory data value. fsb.7 will also flag the erase suspend mode by switching from ?0? to ?1? at the start of the erase suspend. during program operation in erase suspend mode, fsb.7 will have the same behaviour as in normal program execution outside the suspend mode. fsb.6 flash status bit 6: toggle bit programming or erasing operations: successive read operations of flash status register will deliver complementary values. fsb.6 will toggle each time the flash status register is read. the program operation is completed when two successive reads yield the same value. the next read will output the bit last programmed, or a ?1? after erase operation fsb.6 will be set to?1? if a read operation is attempted on an erase suspended block. in addition, an erase suspend/resume command will cause fsb.6 to toggle. fsb.5 flash status bit 5: error bit this bit is set to ?1? when there is a failure of program, block or chip erase operations.this bit will also be set if a user tries to program a bit to ?1? to a flash location that is currently programmed with ?0?. the error bit resets after read/reset instruction. in case of success, the error bit will be set to ?0? during program or erase and then will output the bit last programmed or a ?1? after erasing fsb.3 flash status bit 3: erase time-out bit this bit is cleared by the epc when the last block erase command has been entered to the command interface and it is awaiting the erase start. when the time-out period is finished, after 96 s, fsb.3 returns back to ?1?.
internal flash memory st10f280 36/239 doc id 8673 rev. 3 note: the address of flash status register is the address of the word being programmed when programming operation is in progress, or an address within block being erased when erasing operation is in progress. 5.3.4 flash prot ection register the flash protection register is a non-volatile register that contains the protection status. this register can be read by using the read protection status (rp) command, and programmed by using the dedicated set protection command. flash protection register (pr) type: r/w 5.3.5 instructions description twelve instructions dedicated to flash memory accesses are defined as follow: read/reset (rd). the read/reset instruction consist of one write cycle with data xxf0h. it can be optionally preceded by two ci enable coded cycles (data xxa8h at address 1554h + fsb.2 flash status bit 2: toggle bit this toggle bit, together with fsb.6, can be used to determine the chip status during the erase mode or erase suspend mode. it can be used also to identify the block being erased suspended. a read operation will cause fsb.2 to toggle during the erase mode. if the flash is in erase suspend mode, a read operation from the erase suspended block or a program operation into the erase suspended block will cause fsb.2 to toggle. when the flash is in program mode during erase suspend, fsb.2 will be read as ?1? if address used is the address of the word being programmed. after erase completion with an error status, fsb.2 will toggle when reading the faulty sector. 151413121110987654 3 2 10 cp----bp10bp9bp8bp7bp6bp5bp4bp3bp2bp1bp0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bpx block x protection bit (x = 0...10) ?0?: the block protection is enabled for block x. programming or erasing the block is not possible, unless a block temporary unprotection command is issued. 1?: the block protection is disabled for block x. bit is ?1? by default, and can be programmed permanently to ?0? using the set protection command but then cannot be set to ?1? again. it is therefore possible to temporally disable the block protection using the block temporary unprotection instruction. cp code protection bit ?0?: the flash code protection is enabled. read accesses to the flash for execution not performed in the flash itself are not allowed, the returned value will be 009bh, whatever the content of the flash is. 1?: the flash code protection is disabled: read accesses to the flash from external or internal ram are allowed bit is ?1? by default, and can be programmed permanently to ?0? using the set protection command but then cannot be set to ?1? again. it is therefore possible to temporarily disable the code protection using the code temporary unprotection instruction.
st10f280 internal flash memory doc id 8673 rev. 3 37/239 data xx54h at address 2aa8h). any successive read cycle following a read/reset instruction will read the memory array. a wait cycle of 10s is necessary after a read/reset command if the memory was in program or erase mode. program word (pw). this instruction uses four write cycles. after the two cl enable coded cycles, the program word command xxa0h is written at address 1554h. the following write cycle will latch the address and data of the word to be programmed. memory programming can be done only by writing 0's instead of 1's, otherwise an error occurs. during programming, the flash status is checked by reading the flash status bit fsb.2, fsb.5, fsb.6 and fsb.7 which show the status of the epc. fsb.2, fsb.6 and fsb.7 determine if programming is on going or has completed, and fsb.5 allows a check to be made for any possible error. block erase (be). this instruction uses a minimum of six command cycles. the erase enable command xx80h is written at address 1554h after the two-cycle ci enable sequence. the erase confirm code xx30h must be written at an address related to the block to be erased preceded by the execution of a second ci enable sequence. additional erase confirm codes must be given to erase more than one block in parallel. additional erase confirm commands must be written within a defined time-out period. the input of a new block erase command will restart the time-out period. when this time-out period has elapsed, the erase starts. the status of the internal timer can be monitored through the level of fsb.3, if fsb.3 is ?0?, the block erase command has been given and the timeout is running; if fsb.3 is ?1?, the timeout has expired and the epc is erasing the block(s). if the second command given is not an erase confirm or if the coded cycles are wrong, the instruction aborts, and the device is reset to read mode. it is not necessary to program the block with 0000h as the epc will do this automatically before the erasing to ffffh. read operations after the epc has started, output the flash status register. during the execution of the erase by the epc, the device accepts only the erase suspend and read/reset instructions. data polling bit fsb.7 returns ?0? while the erasure is in progress, and ?1? when it has completed. the toggle bit fsb.2 and fsb.6 toggle during the erase operation. they stop when erase is completed. after completion, the error bit fsb.5 returns ?1? if there has been an erase failure because erasure has not completed even after the maximum number of erase cycles have been executed by the epc, in this case, it will be necessary to input a read/reset to the command interface in order to reset the epc. chip erase (ce) . this instruction uses six write cycles. the erase enable command xx80h, must be written at address 1554h after ci-enable cycles. the chip erase command xx10h must be given on the sixth cycle after a second ci-enable sequence. an error in command sequence will reset the ci to read mode. it is not necessary to program the block with 0000h as the epc will do this automatically before the erasing to ffffh. read operations after the epc has started output the flash status register. during the execution of the erase by the epc, data polling bit fsb.7 returns ?0? while the erasure is in progress, and ?1? when it has completed. the fsb.2 and fsb.6 bit toggle during the erase operation. they stop when erase is finished. the fsb.5 error bit returns "1" in case of failure of the erase operation. the error flag is set after the maximum number of erase cycles have been executed by the epc. in this case, it will be necessary to input a read/reset to the command interface in order to reset the epc. erase suspend (es). this instruction can be used to suspend a block erase operation by giving the command xxb0h without any specific address. no ci-enable cycles is required. erase suspend operation allows reading of data from another block and/or the programming in another block while erase is in progress. if this command is given during the time-out
internal flash memory st10f280 38/239 doc id 8673 rev. 3 period, it will terminate the time-out period in addition to erase suspend. the toggle bit fsb.6, when monitored at an address that belongs to the block being erased, stops toggling when erase suspend command is effective, it happens between 0.1 s and 15 s after the erase suspend command has been written. the flash will then go in normal read mode, and read from blocks not being erased is valid, while read from block being erased will output fsb.2 toggling. during a suspend phase the only instructions valid are erase resume and program word. a read / reset instruction during erase suspend will definitely abort the erase and result in invalid data in the block being erased. erase resume (er). this instruction can be given when the memory is in erase suspend state. erase can be resumed by writing the command xx30h at any address without any cl- enable sequence. program during erase suspend. the program word instruction during erase suspend is allowed only on blocks that are not erase-suspended. this instruction is the same than the program word instruction. set protection (sp). this instruction can be used to enable both block protection (to protect each block independently from accidental erasing-programming operation) and code protection (to avoid code dump). the set protection command must be given after a special ci-protection enable cycles (see instruction table). the following write cycle, will program the protection register. to protect the block x (x = 0 to 10), the data bit x must be at ?0?. to protect the code, bit 15 of the data must be ?0?. enabling block or code protection is permanent and can be cleared only by stm. block temporary unprotection and code temporary unprotection instructions are available to allow the customer to update the code. note: the new value programmed in protection register will only become active after a reset. bit that are already at ?0? in protection register must be confirmed at ?0? also in data latched during the 4th cycle of set protection command, otherwise an error may occur. read protection status (rp). this instruction is used to read the block protection status and the code protection status. to read the protection register (see ta b l e 3 ), the ci- protection enable cycles must be executed followed by the command xx90h at address x2a54h. the following read cycles at any odd word address will output the block protection status. the read/reset command xxf0h must be written to reset the protection interface. note: after a modification of protection register (using set protection command), the read protection status will return the new pr value only after a reset. block temporary unprotection (btu). this instruction can be used to temporary unprotect all the blocks from program / erase protection. the unprotection is disabled after a reset cycle. the block temporary unprotection command xxc1h must be given to enable block temporary unprotection. the command must be preceded by the ci-protection enable cycles and followed by the read/reset command xxf0h. set code protection (scp). this kind of protection allows the customer to protect the proprietary code written in flash. if installed and active, flash code protection prevents data operand accesses and program branches into the on-chip flash area from any location outside the flash memory itself. data operand accesses and branches to flash locations are only and exclusively allowed for instructions executed from the flash memory itself. every read or jump to flash performed from another memory (like internal ram, external memory) while code protection is enabled, will give the opcode 009bh related to trap #00 illegal instruction. the ci-protection enable cycles must be sent to set the code protection. by writing data 7fffh at any odd word address, the code protected status is stored in the flash protection register (pr). protection is permanent and cannot be cleared by the user.
st10f280 internal flash memory doc id 8673 rev. 3 39/239 it is possible to temporarily disable the code protection using code temporary unprotection instruction. note: bits that are already at ?0? in protection register must be confirmed at ?0? also in data latched during the 4th cycle of set protection command, otherwise an error may occur. code temporary unprotection (ctu). this instruction must be used to temporary disable code protection. this instruction is effective only if executed from flash memory space. to restore the protection status, without using a reset, it is necessary to use a code temporary protection instruction. system reset will reset also the code temporary unprotected status. the code temporary unprotection command consists of the following write cycle: mov mem, rn ; this instruction must be executed from flash memory space where mem is an absolute address inside memory space, rn is a register loaded with data 0ffffh. code temporary protection (ctp). this instruction allows to restore code protection. this operation is effective only if executed from flash memory and is necessary to restore the protection status after the use of a code temporary unprotection instruction. the code temporary protection command consists of the following write cycle: mov mem, rn ; this instruction must be executed from flash memory space where mem is an absolute address inside memory space, rn is a register loaded with data 0fffbh. note that code temporary unprotection instruction must be used when it is necessary to modify the flash with protected code (scp), since the write/erase routines must be executed from a memory external to flash space. usually, the write/erase routines, executed in ram, ends with a return to flash space where a ctp instruction restore the protection. table 3. instructions instruction mne cycle 1 st cycle 2 nd cycle 3 rd cycle 4 th cycle 5 th cycle 6 th cycle 7 th cycle read/reset rd 1+ addr. (1) x (2) read memory array until a new write cycle is initiated data xxf0h read/reset rd 3+ addr. (1) x1554h x2aa8h xxxxxh read memory array until a new write cycle is initiated data xxa8h xx54h xxf0h program word pw 4 addr. (1) x1554h x2aa8h x1554h wa (3) read data polling or toggle bit until program completes. data xxa8h xx54h xxa0h wd (4) block erase be 6 addr. (1) x1554h x2aa8h x1554h x1554h x2aa8h ba ba? (5) data xxa8h xx54h xx80h xxa8h xx54h xx30h xx30h chip erase ce 6 addr. (1) x1554h x2aa8h x1554h x1554h x2aa8h x1554h note (6) data xxa8h xx54h xx80h xxa8h xx54h xx10h erase suspend es 1 addr. (1) x (2) read until toggle stops, then read or program all data needed from block(s) not being erased then resume erase. data xxb0h
internal flash memory st10f280 40/239 doc id 8673 rev. 3 generally, command sequences cannot be written to flash by instructions fetched from the flash itself. thus, the flash commands must be written by instructions, executed from internal ram or external memory. command cycles on the cpu interface need not to be consecutively received (pauses allowed). the cpu interface delivers dummy read data for not used cycles within command sequences. all addresses of command cycles shall be defined only with register-indirect addressing mode in the according move instructions. direct addressing is not allowed for command sequences. address segment or data page pointer are taken into account for the command address value. erase resume er 1 addr. (1) x (2) read data polling or toggle bit until erase completes or erase is suspended another time. data xx30h set block/code protection sp 4 addr. (1) x2a54h x15a8h x2a54h any odd word address (7) data xxa8h xx54h xxc0h wpr (8) read protection status rp 4 addr. (1) x2a54h x15a8h x2a54h any odd word address (7) read protection register until a new write cycle is initiated. data xxa8h xx54h xx90h read pr block temporary unprotection btu 4 addr. (1) x2a54h x15a8h x2a54h x (2) data xxa8h xx54h xxc1h xxf0h code temporary unprotection ctu 1 addr. (1) mem (9) write cycles must be executed from flash. data ffffh code temporary protection ctp 1 addr. (1) mem (9) write cycles must be executed from flash. data fffbh 1. address bit a14, a15 and above are don?t care for coded address inputs. 2. x = do not care. 3. wa = write address: address of memory location to be programmed. 4. wd = write data: 16-bit data to be programmed. 5. optional, additional blocks addresses must be entered within a time-out delay (96 s) after last write entry, timeout status can be verified through fsb.3 value. when full command is ent ered, read data polling or toggle bit until erase is completed or suspended 6. read data polling or toggle bit until erase completes. 7. odd word address = 4n-2 where n = 0, 1, 2, 3..., ex. 0002h, 0006h... 8. wpr = write protection register. to protect code, bit 15 of wpr must be ?0?. to protect block n (n=0,1,...), bit n of wpr must be ?0?. bit that are already at ?0? in protection register must also be ?0? in wpr, else a writing error will occurs (it i s not possible to write a ?1? in a bi t already program med at ?0?). 9. mem = any address inside the flash memory space. absolute addressing mode must be used (mov mem, rn), and instruction must be executed from flash memory space. table 3. instructions (continued) instruction mne cycle 1 st cycle 2 nd cycle 3 rd cycle 4 th cycle 5 th cycle 6 th cycle 7 th cycle
st10f280 internal flash memory doc id 8673 rev. 3 41/239 5.3.6 reset processing and initial state the flash module distinguishes two kinds of cpu reset types the lengthening of cpu reset: is not reported to external devices by bidirectional pin is not enabled in case of external start of cpu after reset. 5.4 flash memory configuration the default memory configuration of the st10f280 memory is determined by the state of the ea pin at reset. this value is stored in the internal rom enable bit (named romen) of the syscon register. when romen = 0, the internal flash is disabled and external rom is used for startup control. flash memory can later be enabled by setting the romen bit of syscon to 1. the code performing this setting must not run from a segment of the external rom to be replaced by a segment of the flash memory, otherwise unexpected behaviour may occur. for example, if external rom code is located in the first 32k bytes of segment 0, the first 32k bytes of the flash must then be enabled in segment 1. this is done by setting the roms1 bit of syscon to 0 before or simultaneously with setting of romen bit. this must be done in the externally supplied program before the execution of the einit instruction. if program execution starts from external memory, but access to the flash memory mapped in segment 0 is later required, then the code that performs the setting of romen bit must be executed either in the segment 0 but above address 00?8000h, or from the internal ram. bit roms1 only affects the mapping of the first 32k bytes of the flash memory. all other parts of the flash memory (addresses 01?8000h 08?ffffh) remain unaffected. the sgtdis segmentation disable / enable must also be set to 0 to allow the use of the full 512k bytes of on-chip memory in addition to the external boot memory. the correct procedure on changing the segmentation registers must also be observed to prevent an unwanted trap condition: instructions that configure the internal memory must only be executed from external memory or from the internal ram. an absolute inter-segment jump (jmps) instruction must be executed after flash enabling, to the next instruction, even if this next instruction is located in the consecutive address. whenever the internal memory is disabled, enabled or remapped, the dpps must be explicitly (re)loaded to enable correct data accesses to the internal memory and/or external memory. 5.5 application examples 5.5.1 handling of flash addresses all command, block, data and register addresses to the flash have to be located within the active flash memory space. the active space is that address range to which the physical flash addresses are mapped as defined by the user. when using data page pointer (dpp)
internal flash memory st10f280 42/239 doc id 8673 rev. 3 for block addresses make sure that address bit a15 and a14 of the block address are reflected in both lsbs of the selected dpps. note: for command instructions, address bit a14, a15, a16, a17 and a18 are don?t care. this simplify a lot the application software, because it minimize the use of dpp registers when using command in the command interface. direct addressing is not allowed for command sequence operations to the flash. only register-indirect addressing can be used for command, block or write-data accesses. 5.5.2 basic flash access control when accessing the flash all command write addresses have to be located within the active flash memory space. the active flash memory space is that logical address range which is covered by the flash after mapping. when using data page pointer (dpp) for addressing the flash, make sure that address bit a15 and a14 of the command addresses are reflected in both lsbs of the selected data page pointer (a15 dppx.1 and a14 dppx.0). in case of the command write addresses, address bit a14, a15 and above are ?don?t care?. thus, command writes can be performed by only using one dpp register. this allows to have a simpler and more compact application software. another advantageous possibility is to use the extended segment instruction for addressing. note: the direct addressing mode is not allowed for write access to the flash address/command register. be aware that the c compiler may use this kind of addressing. for write accesses to flash module always the indirect addressing mode has to be selected. the following basic instruction sequences show examples for different addressing possibilities. principle example of address generation for flash commands and registers: when using data page pointer (dpp0 is this example) mov dpp0,#08h ;adjust data page pointers according to the ;addresses: dpp0 is used in this example, thus ;address must have a14 and a15 bit set to ?0?. mov rw m ,#address ;address could be a dedicated command sequence ;address 2aa8h, 1554h ... ) or the flash write ;address mov rw n ,#data ;data could be a dedicated command sequence data ;(xxa0h,xx80h ... ) or data to be programmed mov [rw m ],rw n ; indirect addressing when using the extended segment instruction: mov rw m ,#address ;address could be a dedicated command sequence ;address (2aa8h, 1554h ... ) or the flash write ;address mov rw o ,#data ;data could be a dedicated command sequence data ;(xxa0h,xx80h ... ) or data to be programmed mov rw n ,#segment ;the value of segment represents the segment ;number and could be 0, 1, 2, 3 or 4 (depending ;on sector mapping) for 256kbyte flash.
st10f280 internal flash memory doc id 8673 rev. 3 43/239 exts rw n ,#length ;the value of rwn determines the 8-bit segment ;valid for the corresponding data access for any ;long or indirect address in the following(s) ;instruction(s). length defines the number of ;the effected instruction(s) and has to be a value ;between 1...4 mov [rw m ],rw o ; indirect addressing with segment number from ;exts 5.5.3 programming examples most of the microcontroller programs are written in the c language where the data page pointers are automatically set by the compiler. but because the c compiler may use the not allowed direct addressing mode for flash write addresses, it is necessary to program the organizational flash accesses (command sequences) with assembler in-line routines which use indirect addressing. example 1: performing the command read/reset we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1. according to the usual way of st10 data addressing with data page pointers, address bit a15 and a14 of a 16-bit command write address select the data page pointer (dpp) which contains the upper 10-bit for building the 24-bit physical data address. address bit a13...a0 represent the address offset. as the bit a14...a18 are "don?t care" when written a flash command in the command interface (ci), we can choose the most convenient dppx register for address handling. the following examples are making usage of dpp0. we just have to make sure, that dpp0 points to active flash memory space. to be independent of mapping of sector 0 we choose for all dpps which are used for flash address handling, to point to segment 2. for this reason we load dpp0 with value 08h (00 0000 l000b). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) scxt dppo, #08h ;push data page pointer 0 and load it to point to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #0f0h ;load register r7 with read/reset command mov [r5], r7 ;command cycle 3. address is don?t care pop dpp0 ;restore dpp0 value in the example above the 16-bit registers r5 and r6 are used as auxiliary registers for indirect addressing.
internal flash memory st10f280 44/239 doc id 8673 rev. 3 example 2: performing a program word command we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1.the data to be written is loaded in register r13, the address to be programmed is loaded in register r11/r12 (segment number in r11, segment offset in r12). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) sxct dppo, #08h ;push data page pointer 0 and load it to point to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #0a0h ;load register r7 with program word command mov [r5], r7 ;command cycle 3 pop dpp0 ;restore dpp0: following addressing to the flash ;will use extended instructions ;r11 contains the segment to be programmed ;r12 contains the segment offset address to be ;programmed ;r13 contains the data to be programmed exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r13 ;command cycle 4: the epc starts execution of ;programming command data_polling: exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 mov r6, r7 ;save it in r6 register ;check if fsb.7 = data.7 (i.e. r7.7 = r13.7) xor r7, r13 jnb r7.7, prog_ok ;check if fsb.5 = 1 (programming error) jnb r6.5, data_polling ;programming error: verify is flash programmed ;data is ok exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 ;check if fsb.7 = data.7 xor r7, r13 jnb r7.7, prog_ok ;programming failed: flash remains in write ;operation. ;to go back to normal read operations, a read/reset
st10f280 internal flash memory doc id 8673 rev. 3 45/239 ;command ;must be performed prog_error: mov r7, #0f0h ;load register r7 with read/reset command exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;address is don?t care for read/reset command ... ;here place specific error handling code ... ... ;when programming operation finished succesfully, ;flash is set back automatically to normal read mode prog_ok: .... .... example 3: performing the block erase command we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1.the registers r11/r12 contain an address related to the block to be erased (segment number in r11, segment offset in r12, for example r11 = 01h, r12= 4000h will erase the block 1 first 8k byte block). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) sxct dppo, #08h ;push data page pointer 0 and load it to point ;to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #080h ;load register r7 with block erase command mov [r5], r7 ;command cycle 3 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 4 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 5 pop dpp0 ;restore dpp0: following addressing to the flash ;will use extended instructions ;r11 contains the segment of the block to be erased ;r12 contains the segment offset address of the ;block to be erased mov r7, #030h ;load register r7 with erase confirm code exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;command cycle 6: the epc starts execution of
internal flash memory st10f280 46/239 doc id 8673 rev. 3 ;erasing command erase_polling: exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 ;check if fsb.7 = ?1? (i.e. r7.7 = ?1?) jb r7.7, erase_ok ;check if fsb.5 = 1 (erasing error) jnb r7.5, erase_polling ;programming failed: flash remains in write ;operation. ;to go back to normal read operations, a read/reset ;command ;must be performed erase_error: mov r7, #0f0h ;load register r7 with read/reset command exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;address is don?t care for read/reset command ... ;here place specific error handling code ... ... ;when erasing operation finished succesfully, ;flash is set back automatically to normal read mode erase_ok: .... .... 5.6 bootstrap loader the built-in bootstrap loader (bsl) of the st10f280 provides a mechanism to load the startup program through the serial interface after reset. in this case, no external memory or internal flash memory is required for the initialization code starting at location 00?0000h (see figure 5 ). the bootstrap loader moves code/data into the internal ram, but can also transfer data via the serial interface into an external ram using a second level loader routine. rom memory (internal or external) is not necessary, but it may be used to provide lookup tables or ?core- code? like a set of general purpose subroutines for i/o operations, number crunching, system initialization, etc. the bootstrap loader can be used to load the complete application software into romless systems, to load temporary software into complete systems for testing or calibration, or to load a programming routine for flash devices. the bsl mechanism can be used for standard system startup as well as for special occasions like system maintenance (firmer update) or end-of-line programming or testing.
st10f280 internal flash memory doc id 8673 rev. 3 47/239 5.6.1 entering the bootstrap loader the st10f280 enters bsl mode when pin p0l.4 is sampled low at the end of a hardware reset. in this case the built-in bootstrap loader is activated independent of the selected bus mode. the bootstrap loader code is stored in a special boot-rom. no part of the standard mask memory or flash memory area is required for this. after entering bsl mode and the respective initialization the st10f280 scans the rxd0 line to receive a zero byte, one start bit, eight ?0? data bits and one stop bit. from the duration of this zero byte it calculates the corresponding baud rate factor with respect to the current cpu clock, initializes the serial interface asc0 accordingly and switches pin txd0 to output. using this baud rate, an identification byte is returned to the host that provides the loaded data. this identification byte identifies the device to be booted. identification byte is d5h for the st10f280. figure 5. bootstrap loader sequence 234). 48$ )nternal"oot-emory"3, routine "yteusersoftware   2x$ #30)0   0,  "3,initializationtime  :ero"ytestart"it eight@data"its stop"it se ntbyhost  )dentification"yte$h sentby34&  "ytesofcodedata sentbyhost  #aution48$isonlydrivenacertaintimeafterreception ofthezero"yte  )nternal"oot2/-   ("1($'5
internal flash memory st10f280 48/239 doc id 8673 rev. 3 when the st10f280 has entered bsl mode, the following configuration is automatically set (values that deviate from the normal reset values, are marked ): in this case, the watchdog timer is disabled, so the bootstrap loading sequence is not time limited. pin txd0 is configured as output, so the st10f280 can return the identification byte. even if the internal flash is enabled, no code can be executed out of it. the hardware that activates the bsl during reset may be a simple pull-down resistor on p0l.4 for systems that use this feature upon every hardware reset. a switchable solution (via jumper or an external signal) can be used for systems that only temporarily use the bootstrap loader (see figure 6 ). after sending the identification byte the asc0 receiver is enabled and is ready to receive the initial 32 bytes from the host. a half duplex connection is therefore sufficient to feed the bsl. 5.6.2 memory confi guration after reset the configuration (and the accessibility) of the st10f280?s memory areas after reset in bootstrap-loader mode differs from the standard case. pin ea is not evaluated when bsl mode is selected, and accesses to the internal flash area are partly redirected, while the st10f280 is in bsl mode (see figure 7 ). all code fetches are made from the special boot- rom, while data accesses read from the internal user flash. data accesses will return undefined values on romless devices. the code in the boot-rom is not an invariant feature of the st10f280. user software should not try to execute code from the internal flash area while the bsl mode is still active, as these fetches will be redirected to the boot-rom. the boot-rom will also ?move? to segment 1, when the internal flash area is mapped to segment 1 (see figure 7 ). watchdog timer: disabled register syscon: 0e00h context pointer cp: fa00h register stkun: fa40h stack pointer sp: fa40h register stkov: fa0ch 0<->c register s0con: 8011h register buscon0: acc. to startup configuration register s0bg: acc. to ?00? byte p3.10 / txd0: ?1? dp3.10: ?1?
st10f280 internal flash memory doc id 8673 rev. 3 49/239 figure 6. hardware provisions to activate the bsl figure 7. memory configuration after reset 5.6.3 loading the startup code after sending the identification byte the bsl enters a loop to receive 32 bytes via asc0. these byte are stored sequentially into locations 00?fa40h through 00?fa5fh of the internal ram. so up to 16 instructions may be placed into the ram area. to execute the loaded code the bsl then jumps to location 00?fa40h, which is the first loaded instruction. the bootstrap loading sequence is now terminated, the st10f280 remains in bsl mode, however. most probably the initially loaded routine will load additional code or data, as an average application is likely to require substantially more than 16 instructions. this second receive loop may directly use the pre-initialized interface asc0 to receive data and store it to arbitrary user-defined locations. this second level of loaded code may be the final application code. it may also be another, more sophisticated, loader routine that adds a transmission protocol to enhance the integrity 16 mbytes 16 mbytes 16 mbytes bsl mode active yes (p0l.4=?0?) yes (p0l.4=?0?) no (p0l.4=?1?) ea pin high low access to application code fetch from internal flash area test-flash access test-flash access user flash access data fetch from internal flash area user flash access user flash access user flash access 2 0/, k : #i rcuit 0/, 0/, .ormal"oot "3 , %xternal 3ignal 2 0/, k : #ircuit ("1($'5 iram 1 0 user flash test flash segment 2 255 access to: external bus disabled internal enabled flash 1 0 user flash test flash segment 2 255 access to: external bus enabled internal enabled flash iram 1 0 user flash segment 2 255 access: depends on reset config ea , port0 depends on reset config ea , port0 iram
internal flash memory st10f280 50/239 doc id 8673 rev. 3 of the loaded code or data. it may also contain a code sequence to change the system configuration and enable the bus interface to store the received data into external memory. this process may go through several iterations or may directly execute the final application. in all cases the st10f280 will still run in bsl mode, that means with the watchdog timer disabled and limited access to the internal flash area. all code fetches from the internal flash ar ea (00?0000h...00?7fffh or 01?0000h...01?7fffh, if mapped to segment 1) are redirected to the special boot-rom. data fetches access will access the internal boot-rom of the st10f280, if any is available, but will return undefined data on romless devices. 5.6.4 exiting bootstrap loader mode in order to execute a program in normal mode, the bsl mode must be terminated first. the st10f280 exits bsl mode upon a software reset (ignores the level on p0l.4) or a hardware reset (p0l.4 must be high). after a reset the st10f280 will start executing from location 00?0000h of the internal flash or the external memory, as programmed via pin ea . 5.6.5 choosing the baud rate for the bsl the calculation of the serial baud rate for asc0 from the length of the first zero byte that is received, allows the operation of the bootstrap loader of the st10f280 with a wide range of baud rates. however, the upper and lower limits have to be kept, in order to insure proper data transfer. the st10f280 uses timer t6 to measure the length of the initial zero byte. the quantization uncertainty of this measurement implies the first deviation from the real baud rate, the next deviation is implied by the computation of the s0brl reload value from the timer contents. the formula below shows the association: for a correct data transfer from the host to the st10f280 the maximum deviation between the internal initialized baud rate for asc0 and the real baud rate of the host should be below 2.5%. the deviation (f b , in percent) between host baud rate and st10f280 baud rate can be calculated via the formula below: note: function (f b ) does not consider the tolerances of oscillators and other devices supporting the serial communication. this baud rate deviation is a nonlinear function depending on the cpu clock and the baud rate of the host. the maxima of the function (f b ) increase with the host baud rate due to the b st10f280 f cpu 32 s0brl 1 + () ----------------------------------------------- - = s0brl t6 36 ? 72 ------------------- - = t6 9 4 -- - f cpu b host ----------------- = , f b b contr b host ? b contr -------------------------------------------- 100 = % , f b 2.5 %
st10f280 internal flash memory doc id 8673 rev. 3 51/239 smaller baud rate pre-scaler factors and the implied higher quantization error (see figure 8 ). the minimum baud rate (b low in the figure 8 ) is determined by the maximum count capacity of timer t6, when measuring the zero byte, and it depends on the cpu clock. using the maximum t6 count 2 16 in the formula the minimum baud rate can be calculated. the lowest standard baud rate in this case would be 1200 baud. baud rates below b low would cause t6 to overflow. in this case asc0 cannot be initialized properly. the maximum baud rate (b high in the figure 8 ) is the highest baud rate where the deviation still does not exceed the limit, so all baud rates between b low and b high are below the deviation limit. the maximum standard baud rate that fulfills this requirement is 19200 baud. higher baud rates , however, may be used as long as the actual deviation does not exceed the limit. a certain baud rate (marked ?i? in figure 8 ) may violate the deviation limit, while an even higher baud rate (marked ?ii? in figure 8 ) stays very well below it. this depends on the host interface. figure 8. baud rate deviation between host and st10f280 " ,ow  & " " (igh ) )) " (/34 ("1($'5
central processing unit (cpu) st10f280 52/239 doc id 8673 rev. 3 6 central processing unit (cpu) the cpu includes a 4-stage instruction pipeline, a 16-bit arithmetic and logic unit (alu) and dedicated sfrs. additional hardware has been added for a separate multiply and divide unit, a bit-mask generator and a barrel shifter. most of the st10f280?s instructions can be executed in one instruction cycle which requires 50ns at 40mhz cpu clock. for example, shift and rotate instructions are processed in one instruction cycle independent of the number of bits to be shifted. multiple-cycle instructions have been optimized: branches are carried out in 2 cycles, 16 x 16 bit multiplication in 5 cycles and a 32/16 bit division in 10 cycles. the jump cache reduces the execution time of repeatedly performed jumps in a loop, from 2 cycles to 1 cycle. the cpu uses a bank of 16 word registers to run the current context. this bank of general purpose registers (gpr) is physically stored within the on-chip internal ram (iram) area. a context pointer (cp) register determines the base address of the active register bank to be accessed by the cpu. the number of register banks is only restricted by the available internal ram space. for easy parameter passing, a register bank may overlap others. a system stack of up to 1024 bytes is provided as a storage for temporary data. the system stack is allocated in the on-chip ram area, and it is accessed by the cpu via the stack pointer (sp) register. two separate sfrs, stkov and stkun, are implicitly compared against the stack pointer value upon each stack access for the detection of a stack overflow or underflow. figure 9. cpu block diagram (mac unit not included)  )nternal 2! - +"yte 'eneral 0urpose 2egisters 2 2 -$( -$ , "arrel 3hift -ul$iv (7 "it -ask'en !,5  "it #0 30 34 +/6 34+5 . %xec5nit )nstr0tr  3tage 0ipeline 037 393#/ . "53#/. "5 3#/. "5 3#/. "5 3#/. "53#/. !$$23%, !$$23% , !$$23% , !$$23% , $ata 0g0trs #ode3eg0tr #0 5 +"yte &lash memory   "an k n "ank i "ank  ("1($'5
st10f280 central processing unit (cpu) doc id 8673 rev. 3 53/239 the system configuration register syscon this bit-addressable register provides general system configuration and control functions. the reset value for register syscon depends on the state of the port0 pins during reset. syscon address: 0xff12h / 89h sfr reset: 0x0xx0h type: r/w 1. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stksz roms1 sgtdis romen bytdis clken wrcfg cscfg pwdcfg owddis bdrsten xpen visible xper-share r/w r/w r/w r/w (1) 1. these bit are set directly or indirectly according to port0 and ea pin configuration during reset sequence. register syscon cannot be changed after execution of the einit instruction. r/w (1) r/w r/w (1) r/w r/w r/w r/w r/w r/w r/w xpen xbus peripheral enable bit 0: accesses to the on-chip x-peripherals and their functions are disabled 1: the on-chip x-peripherals are enabled and can be accessed. bdrsten bidirectional reset enable 0: rstin pin is an input pin only. sw reset or wdt reset have no effect on this pin 1: rstin pin is a bidirectional pin. this pin is pulled low during 1024 tcl during reset sequence. owddis oscillator watchdog disable control 0: oscillator watchdog (owd) is enabled. if pll is bypassed, the owd monitors xtal1 activity. if there is no activity on xtal1 for at least 1 s, the cpu clock is switched automatically to pll?s base frequency (2 to 10mhz). 1: owd is disabled. if the pll is bypassed, the cpu clock is always driven by xtal1 signal. the pll is turned off to reduce power supply current. pwdcfg power down mode configuration control 0: power down mode can only be entered during pwrdn instruction execution if nmi pin is low, otherwise the instruction has no effect. to exit power down mode, an external reset must occurs by asserting the rstin pin. 1: power down mode can only be entered during pwrdn instruction execution if all enabled fast external interrupt exxin pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin. cscfg chip select configuration control 0: latched chip select lines: csx change 1 tcl after rising edge of ale 1: unlatched chip slect lines: csx change with rising edge of ale
central processing unit (cpu) st10f280 54/239 doc id 8673 rev. 3 6.1 multiplier-accumulator unit (mac) the mac co-processor is a specialized co-processor added to the st10 cpu core in order to improve the performances of the st10 family in signal processing algorithms. signal processing needs at least three specialized units operating in parallel to achieve maximum performance: a multiply-accumulate unit, an address generation unit, able to feed the mac unit with 2 operands per cycle, a repeat unit, to execute series of multiply-accumulate instructions. the existing st10 cpu has been modified to include new addressing capabilities which enable the cpu to supply the new co-processor with up to 2 operands per instruction cycle. this new co-processor (so-called mac) contains a fast multiply-accumulate unit and a repeat unit. the co-processor instructions extend the st10 cpu instruction set with multiply, multiply- accumulate, 32-bit signed arithmetic operations. a new transfer instruction comov has also been added to take benefit of the new addressing capabilities. 6.1.1 features enhanced addressing capabilities new addressing modes including a double indirect addressing mode with pointer post- modification. parallel data move: this mechanism allows one operand move during multiply- accumulate instructions without penalty. new transfer instructions costore (for fast access to the mac sfrs) and comov (for fast memory to memory table transfer). multiply-accumulate unit one-cycle execution for all mac operations. 16 x 16 signed/unsigned parallel multiplier. 40-bit signed arithmetic unit with automatic saturation mode. 40-bit accumulator. 8-bit left/right shifter. full instruction set with multiply and multiply-accumulate, 32-bit signed arithmetic and compare instructions. program control repeat unit: allows some mac co-processor instructions to be repeated up to 8192 times. repeated instructions may be interrupted. mac interrupt (class b trap) on mac condition flags.
st10f280 central processing unit (cpu) doc id 8673 rev. 3 55/239 figure 10. mac unit architecture 6.2 instruction set summary the ta b l e 4 lists the instructions of the st10f280. the various addressing modes, instruction operation, parameters for conditional execution of instructions, opcodes and a detailed description of each instruction can be found in the ?st10 family programming manual?. 2shudqg 2shudqg &rqwuro8qlw 5hshdw8qlw 67&38 ,qwhuuxsw &rqwuroohu 06: 05: 0$+ 0$/ 0&: &lags -!% -ux  bit,eft2ight 3hifter -ux -ux 3ign%xtend  x #oncatenation signedunsigned -ultiplier  bit3igned!rithmetic5nit h  h  h               3caler " !  '020ointers
)$8 0ointer )$8 0ointer 12'02/ffset2egister 12'02/ffset2egister 18)$8/ffset2egister 18)$8/ffset2egister ("1($'5
4ibsfexjuituboebse"-6 table 4. instruction set summary mnemonic description bytes add(b) add word (byte) operands 2 / 4 addc(b) add word (byte) operands with carry 2 / 4 sub(b) subtract word (byte) operands 2 / 4 subc(b) subtract word (byte) operands with carry 2 / 4 mul(u) (un)signed multiply direct gpr by direct gpr (16-16-bit) 2 div(u) (un)signed divide register mdl by direct gpr (16-/16-bit) 2 divl(u) (un)signed long divide reg. md by direct gpr (32-/16-bit) 2 cpl(b) complement direct word (byte) gpr 2 neg(b) negate direct word (byte) gpr 2
central processing unit (cpu) st10f280 56/239 doc id 8673 rev. 3 and(b) bitwise and, (word/byte operands) 2 / 4 or(b) bitwise or, (word/byte operands) 2 / 4 xor(b) bitwise xor, (word/byte operands) 2 / 4 bclr clear direct bit 2 bset set direct bit 2 bmov(n) move (negated) direct bit to direct bit 4 band, bor, bxor and/or/xor direct bit with direct bit 4 bcmp compare direct bit to direct bit 4 bfldh/l bitwise modify masked high/low byte of bit-addressable direct word memory with immediate data 4 cmp(b) compare word (byte) operands 2 / 4 cmpd1/2 compare word data to gpr and decrement gpr by 1/2 2 / 4 cmpi1/2 compare word data to gpr and increment gpr by 1/2 2 / 4 prior determine number of shift cycles to normalize direct word gpr and store result in direct word gpr 2 shl / shr shift left/right direct word gpr 2 rol / ror rotate left/right direct word gpr 2 ashr arithmetic (sign bit) shift right direct word gpr 2 mov(b) move word (byte) data 2 / 4 movbs move byte operand to word operand with sign extension 2 / 4 movbz move byte operand to word operand with zero extension 2 / 4 jmpa, jmpi, jmpr jump absolute/indirect/relative if condition is met 4 jmps jump absolute to a code segment 4 j(n)b jump relative if direct bit is (not) set 4 jbc jump relative and clear bit if direct bit is set 4 jnbs jump relative and set bit if direct bit is not set 4 calla, calli, callr call absolute/indirect/relative subroutine if condition is met 4 calls call absolute subroutine in any code segment 4 pcall push direct word register onto system stack and call absolute subroutine 4 trap call interrupt service routine via immediate trap number 2 push, pop push/pop direct word register onto/from system stack 2 scxt push direct word register onto system stack and update register with word operand 4 ret return from intra-segment subroutine 2 table 4. instruction set summary (continued) mnemonic description bytes
st10f280 central processing unit (cpu) doc id 8673 rev. 3 57/239 6.3 mac coprocessor specific instructions the following table gives an overview of the mac instruction set. all the mnemonics are listed with the addressing modes that can be used with each instruction. for each combination of mnemonic and addressing mode this table indicates if it is repeatable or not new addressing capabilities enable the cpu to supply the mac with up to 2 operands per instruction cycle. mac instructions: multiply, multiply-accumulate, 32-bit signed arithmetic operations and the comov transfer instruction have been added to the standard instruction set. full details are provided in the ?st10 family programming manual?. double indirect addressing requires two pointers. any gpr can be used for one pointer, the other pointer is provided by one of two specific sfrs idx0 and idx1. two pairs of offset registers qr0/qr1 and qx0/qx1 are associated with each pointer (gpr or idx i ). the gpr pointer allows access to the entire memory space, but idx i are limited to the internal dual-port ram, except for the comov instruction. rets return from inter-segment subroutine 2 retp return from intra-segment subroutine and pop direct word register from system stack 2 reti return from interrupt service subroutine 2 srst software reset 4 idle enter idle mode 4 pwrdn enter power down mode (supposes nmi -pin being low) 4 srvwdt service watchdog timer 4 diswdt disable watchdog timer 4 einit signify end-of-initialization on rstout-pin 4 atomic begin atomic sequence 2 extr begin extended register sequence 2 extp(r) begin extended page (and register) sequence 2 / 4 exts(r) begin extended segment (and register) sequence 2 / 4 nop null operation 2 table 4. instruction set summary (continued) mnemonic description bytes
central processing unit (cpu) st10f280 58/239 doc id 8673 rev. 3 table 5. mac coprocessor specific instructions mnemonic addressing modes repeatability comul rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no no no comulu comulus comulsu comul- comulu- comulus- comulsu- comul, rnd comulu, rnd comulus, rnd comulsu, rnd comac rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no ye s ye s comacu comacus comacsu comac- comacu- comacus- comacsu- comac, rnd comacu, rnd comacus, rnd comacsu, rnd comacr comacru comacrus rw n , rw m [idx i ? ], [rw n ? ] rw n , [rw m ? ] no no no comacrsu comacr, rnd comacru, rnd comacrus, rnd comacrsu, rnd conop [rw m ?] ye s [idx i ? ]yes [idx i ? ], [rw m ?] ye s
st10f280 central processing unit (cpu) doc id 8673 rev. 3 59/239 coneg -no coneg, rnd cornd costore rw n , coreg no [rw n ?] , coreg yes comov [idx i ? ], [rw m ?] ye s comacm [idx i ? ], [rw m ?] ye s comacmu comacmus comacmsu comacm- comacmu- comacmus- comacmsu- comacm, rnd comacmu, rnd comacmus, rnd comacmsu, rnd comacmr comacmru comacmrus comacmrsu comacmr, rnd comacmru, rnd comacmrus, rnd comacmrsu, rnd coadd rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no ye s ye s coadd2 cosub cosub2 cosubr cosub2r comax comin table 5. mac coprocessor specific instructions (continued) mnemonic addressing modes repeatability
central processing unit (cpu) st10f280 60/239 doc id 8673 rev. 3 the ta b l e 6 shows the various combinations of pointer post-modification for each of these 2 new addressing modes. in this document the symbols ?[rw n ? ]? and ?[idx i ? ]? refer to these addressing modes. coload rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] coload- no coload2 no coload2- no cocmp coshl rw m #data4 [rw m ?] ye s no ye s coshr coashr coashr, rnd coabs - rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no no no table 6. pointer post-modification combinations for idxi and rwn symbol mnemonic address pointer operation ?[idx i ? ]? stands for [idx i ](idx i ) (idx i ) (no-op) [idx i + ](idx i ) (idx i ) +2 (i=0,1) [idx i ](idx i ) (idx i )2 (i=0,1) [idx i + qx j ](idx i ) (idx i ) + (qx j ) (i, j =0,1) [idx i qx j ](idx i ) (idx i ) (qx j ) (i, j =0,1) ?[rw n ? ]? stands for [rwn] (rwn) (rwn) (no-op) [rwn + ] (rwn) (rwn) +2 (n=0-15) [rwn-] (rwn) (rwn)2 (k=0-15) [rwn + qr j ] (rwn) (rwn) + (qr j ) (n=0-15;j =0,1) [rwn qr j ] (rwn) (rwn) (qr j ) (n=0-15; j =0,1) table 7. mac registers referenced as ?coreg? registers description address in opcode msw mac-unit status word 00000b mah mac-unit accumulator high 00001b mas ?limited? mah /signed 00010b table 5. mac coprocessor specific instructions (continued) mnemonic addressing modes repeatability
st10f280 central processing unit (cpu) doc id 8673 rev. 3 61/239 mal mac-unit accumulator low 00100b mcw mac-unit control word 00101b mrw mac-unit repeat word 00110b table 7. mac registers referenced as ?coreg? (continued) registers description address in opcode
external bus controller st10f280 62/239 doc id 8673 rev. 3 7 external bus controller all of the external memory accesses are performed by the on-chip external bus controller. the ebc can be programmed to single chip mode when no external memory is required, or to one of four different external memory access modes: 16-/18-/20-/24-bit addresses 16-bit data, demultiplexed 16-/18-/20-/24-bit addresses 16-bit data, multiplexed 16-/18-/20-/24-bit addresses 8-bit data, multiplexed 16-/18-/20-/24-bit addresses 8-bit data, demultiplexed in demultiplexed bus modes addresses are output on port1 and data is input/output on port0 or p0l, respectively. in the multiplexed bus modes both addresses and data use port0 for input/output. timing characteristics of the external bus interface (memory cycle time, memory tri-state time, length of ale and read write delay) are programmable giving the choice of a wide range of memories and external peripherals. up to 4 independent address windows may be defined (using register pairs addrselx / busconx) to access different resources and bus characteristics. these address windows are arranged hierarchically where buscon4 overrides buscon3 and buscon2 overrides buscon1. all accesses to locations not covered by these 4 address windows are controlled by buscon0. up to 5 external cs signals (4 windows plus default) can be generated in order to save external glue logic. access to very slow memories is supported by a ?ready? function. a hold /hlda protocol is available for bus arbitration which shares external resources with other bus masters. the bus arbitration is enabled by setting bit hlden in register psw. after setting hlden once, pins p6.7...p6.5 (breq , hlda , hold ) are automatically controlled by the ebc. in master mode (default after reset) the hlda pin is an output. by setting bit dp6.7 to?1? the slave mode is selected where pin hlda is switched to input. this directly connects the slave controller to another master controller without glue logic. for applications which require less external memory space, the address space can be restricted to 1 mbyte, 256 kbyte or to 64 kbyte. port 4 outputs all 8 address lines if an address space of 16 mbytes is used, otherwise four, two or no address lines. chip select timing can be made programmable. by default (after reset), the csx lines change half a cpu clock cycle after the rising edge of ale. with the cscfg bit set in the syscon register the csx lines change with the rising edge of ale. the active level of the ready pin can be set by bit rdypol in the busconx registers. when the ready function is enabled for a specific address window, each bus cycle within the window must be terminated with the active level defined by bit rdypol in the associated buscon register.
st10f280 external bus controller doc id 8673 rev. 3 63/239 7.1 programmable chip select timing control the st10f280 allows the user to adjust the position of the csx lines changes. by default (after reset), the csx lines are changing half a cpu clock cycle (12.5 ns at f cpu = 40mhz) after the rising edge of ale. with the cscfg bit set in the syscon register, the csx lines are changing with the rising edge of ale, thus the csx lines are changing at the same time the address lines are changing. see section 19.2: system configuration registers for detailed description of syscon register. figure 11. chip select delay 7.2 ready programmable polarity the active level of the ready pin can be selected by software via the rdypol bit in the busconx registers. when the ready function is enabled for a specific address window, .ormal#3x 2$ !ddress0 !,% 3egment0 .ormal$emultiplexed "us#ycle !,%,engthen$emultiplexed "us#ycle 5nlatched#3x 72 2ead7rite $elay a t a $ a t a $ $ata $ata "530 "530 2ead7rite $elay ("1($'5
external bus controller st10f280 64/239 doc id 8673 rev. 3 each bus cycle within this window must be terminated with the active level defined by this rdypol bit in the associated buscon register. buscon0 address: 0xff0ch / 86h sfr reset: 0x0xx0h type: r/w buscon1 address: 0xff14h / 8ah sfr reset: 0x0000h type: r/w buscon2 address: 0xff16h / 8bh sfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen0 csren0 rdypol0 rdyen0 - busact0 alectl0 -btyp mttc0 rwdc0 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 1514131211109876543210 cswen1 csren1 rdypol1 rdyen1 - busact1 alectl1 -btyp mttc1 rwdc1 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen2 csren2 rdypol2 rdyen2 - busact2 alectl2 -btyp mttc2 rwdc2 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w
st10f280 external bus controller doc id 8673 rev. 3 65/239 buscon3 address: 0xff18h / 8ch sfr reset: 0x0000h type: r/w buscon4 address: 0xff1ah / 8dh sfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen3 csren3 rdypol3 rdyen3 - busact3 alectl3 -btyp mttc3 rwdc3 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen4 csren4 rdypol4 rdyen4 - busact4 alectl4 -btyp mttc4 rwdc4 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w rdypolx ready active level control 0: the active level on the ready pin is low, bus cycle terminates with a ?0? on ready pin, 1: the active level on the ready pin is high, bus cycle terminates with a ?1? on ready pin.
interrupt system st10f280 66/239 doc id 8673 rev. 3 8 interrupt system the interrupt response time for internal program execution is from 125ns to 300ns at 40mhz cpu clock. the st10f280 architecture supports several mechanisms for fast and flexible response to service requests that can be generated from various sources (internal or external) to the microcontroller. any of these interrupt requests can be serviced by the interrupt controller or by the peripheral event controller (pec). in contrast to a standard interrupt service where the current program execution is suspended and a branch to the interrupt vector table is performed, just one cycle is ?stolen? from the current cpu activity to perform a pec service. a pec service implies a single byte or word data transfer between any two memory locations with an additional increment of either the pec source or destination pointer. an individual pec transfer counter is implicitly decremented for each pec service except when performing in the continuous transfer mode. when this counter reaches zero, a standard interrupt is performed to the corresponding source related vector location. pec services are very well suited to perform the transmission or the reception of blocks of data. the st10f280 has 8 pec channels, each of them offers such fast interrupt-driven data transfer capabilities. an interrupt control register which contains an interrupt request flag, an interrupt enable flag and an interrupt priority bitfield is dedicated to each existing interrupt source. thanks to its related register, each source can be programmed to one of sixteen interrupt priority levels. once starting to be processed by the cpu, an interrupt service can only be interrupted by a higher prioritized service request. for the standard interrupt processing, each of the possible interrupt sources has a dedicated vector location. software interrupts are supported by means of the ?trap? instruction in combination with an individual trap (interrupt) number.
st10f280 interrupt system doc id 8673 rev. 3 67/239 8.1 external interrupts fast external interrupt inputs are provided to service external interrupts with high precision requirements. these fast interrupt inputs feature programmable edge detection (rising edge, falling edge or both edges). fast external interrupts may also have interrupt sources selected from other peripherals; for example the canx controller receive signal (canx_rxd) can be used to interrupt the system. this new function is controlled using the ?external interrupt source selection? register exisel. exisel address: 0xf1dah / edh esfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 exi7ss exi6ss exi5ss exi4ss exi3ss exi2ss exi1ss exi0ss r/w r/w r/w r/w r/w r/w r/w r/w exixss external interrupt x source selection (x=7...0) ?00?: input from associated port 2 pin. ?01?: input from ?alternate source?. ?10?: input from port 2 pin ored with ?alternate source?. ?11?: input from port 2 pin anded with ?alternate source?. exixss port 2 pin alternate source 0p2.8can1_rxd 1p2.9can2_rxd 2...7 p2.10...15 not used (zero)
interrupt system st10f280 68/239 doc id 8673 rev. 3 exicon e address: 0xf1c0h / e0h esfr reset: 0x0000h type: r/w 8.2 interrupt registers and vectors location list ta b l e 8 shows all the available st10f280 interrupt sources and the corresponding hardware-related interrupt flags, vectors, vector locations and trap (interrupt) numbers: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es r/w r/w r/w r/w r/w r/w r/w r/w exixes(x=7...0) external interrupt x edge selection field (x=7...0) 00: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. 01: interrupt on positive edge (rising) enter power down mode if exiin = ?0?, exit if exxin = ?1? (referred as ?high? active level) 10: interrupt on negative edge (falling) enter power down mode if exiin = ?1?, exit if exxin = ?0? (referred as ?low? active level) 11: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed. table 8. interrupt sources source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number capcom register 0 cc0ir cc0ie cc0int 00?0040h 10h capcom register 1 cc1ir cc1ie cc1int 00?0044h 11h capcom register 2 cc2ir cc2ie cc2int 00?0048h 12h capcom register 3 cc3ir cc3ie cc3int 00?004ch 13h capcom register 4 cc4ir cc4ie cc4int 00?0050h 14h capcom register 5 cc5ir cc5ie cc5int 00?0054h 15h capcom register 6 cc6ir cc6ie cc6int 00?0058h 16h capcom register 7 cc7ir cc7ie cc7int 00?005ch 17h capcom register 8 cc8ir cc8ie cc8int 00?0060h 18h capcom register 9 cc9ir cc9ie cc9int 00?0064h 19h capcom register 10 cc10ir cc10ie cc10int 00?0068h 1ah capcom register 11 cc11ir cc11ie cc11int 00?006ch 1bh capcom register 12 cc12ir cc12ie cc12int 00?0070h 1ch
st10f280 interrupt system doc id 8673 rev. 3 69/239 capcom register 13 cc13ir cc13ie cc13int 00?0074h 1dh capcom register 14 cc14ir cc14ie cc14int 00?0078h 1eh capcom register 15 cc15ir cc15ie cc15int 00?007ch 1fh capcom register 16 cc16ir cc16ie cc16int 00?00c0h 30h capcom register 17 cc17ir cc17ie cc17int 00?00c4h 31h capcom register 18 cc18ir cc18ie cc18int 00?00c8h 32h capcom register 19 cc19ir cc19ie cc19int 00?00cch 33h capcom register 20 cc20ir cc20ie cc20int 00?00d0h 34h capcom register 21 cc21ir cc21ie cc21int 00?00d4h 35h capcom register 22 cc22ir cc22ie cc22int 00?00d8h 36h capcom register 23 cc23ir cc23ie cc23int 00?00dch 37h capcom register 24 cc24ir cc24ie cc24int 00?00e0h 38h capcom register 25 cc25ir cc25ie cc25int 00?00e4h 39h capcom register 26 cc26ir cc26ie cc26int 00?00e8h 3ah capcom register 27 cc27ir cc27ie cc27int 00?00ech 3bh capcom register 28 cc28ir cc28ie cc28int 00?00f0h 3ch capcom register 29 cc29ir cc29ie cc29int 00?0110h 44h capcom register 30 cc30ir cc30ie cc30int 00?0114h 45h capcom register 31 cc31ir cc31ie cc31int 00?0118h 46h capcom timer 0 t0ir t0ie t0int 00?0080h 20h capcom timer 1 t1ir t1ie t1int 00?0084h 21h capcom timer 7 t7ir t7ie t7int 00?00f4h 3dh capcom timer 8 t8ir t8ie t8int 00?00f8h 3eh gpt1 timer 2 t2ir t2ie t2int 00?0088h 22h gpt1 timer 3 t3ir t3ie t3int 00?008ch 23h gpt1 timer 4 t4ir t4ie t4int 00?0090h 24h gpt2 timer 5 t5ir t5ie t5int 00?0094h 25h gpt2 timer 6 t6ir t6ie t6int 00?0098h 26h gpt2 caprel register crir crie crint 00?009ch 27h a/d conversion complete adcir adcie adcint 00?00a0h 28h a/d overrun error adeir adeie adeint 00?00a4h 29h asc0 transmit s0tir s0tie s0tint 00?00a8h 2ah asc0 transmit buffer s0tbir s0tbie s0tbint 00?011ch 47h table 8. interrupt sources (continued) source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number
interrupt system st10f280 70/239 doc id 8673 rev. 3 capcom register 13 cc13ir cc13ie cc13int 00?0074h 1dh capcom register 14 cc14ir cc14ie cc14int 00?0078h 1eh capcom register 15 cc15ir cc15ie cc15int 00?007ch 1fh capcom register 16 cc16ir cc16ie cc16int 00?00c0h 30h capcom register 17 cc17ir cc17ie cc17int 00?00c4h 31h capcom register 18 cc18ir cc18ie cc18int 00?00c8h 32h capcom register 19 cc19ir cc19ie cc19int 00?00cch 33h capcom register 20 cc20ir cc20ie cc20int 00?00d0h 34h capcom register 21 cc21ir cc21ie cc21int 00?00d4h 35h capcom register 22 cc22ir cc22ie cc22int 00?00d8h 36h capcom register 23 cc23ir cc23ie cc23int 00?00dch 37h capcom register 24 cc24ir cc24ie cc24int 00?00e0h 38h capcom register 25 cc25ir cc25ie cc25int 00?00e4h 39h capcom register 26 cc26ir cc26ie cc26int 00?00e8h 3ah capcom register 27 cc27ir cc27ie cc27int 00?00ech 3bh capcom register 28 cc28ir cc28ie cc28int 00?00f0h 3ch capcom register 29 cc29ir cc29ie cc29int 00?0110h 44h capcom register 30 cc30ir cc30ie cc30int 00?0114h 45h capcom register 31 cc31ir cc31ie cc31int 00?0118h 46h capcom timer 0 t0ir t0ie t0int 00?0080h 20h capcom timer 1 t1ir t1ie t1int 00?0084h 21h capcom timer 7 t7ir t7ie t7int 00?00f4h 3dh capcom timer 8 t8ir t8ie t8int 00?00f8h 3eh gpt1 timer 2 t2ir t2ie t2int 00?0088h 22h gpt1 timer 3 t3ir t3ie t3int 00?008ch 23h gpt1 timer 4 t4ir t4ie t4int 00?0090h 24h gpt2 timer 5 t5ir t5ie t5int 00?0094h 25h gpt2 timer 6 t6ir t6ie t6int 00?0098h 26h gpt2 caprel register crir crie crint 00?009ch 27h a/d conversion complete adcir adcie adcint 00?00a0h 28h a/d overrun error adeir adeie adeint 00?00a4h 29h asc0 transmit s0tir s0tie s0tint 00?00a8h 2ah asc0 transmit buffer s0tbir s0tbie s0tbint 00?011ch 47h table 8. interrupt sources (continued) source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number
st10f280 interrupt system doc id 8673 rev. 3 71/239 capcom register 13 cc13ir cc13ie cc13int 00?0074h 1dh capcom register 14 cc14ir cc14ie cc14int 00?0078h 1eh capcom register 15 cc15ir cc15ie cc15int 00?007ch 1fh capcom register 16 cc16ir cc16ie cc16int 00?00c0h 30h capcom register 17 cc17ir cc17ie cc17int 00?00c4h 31h capcom register 18 cc18ir cc18ie cc18int 00?00c8h 32h capcom register 19 cc19ir cc19ie cc19int 00?00cch 33h capcom register 20 cc20ir cc20ie cc20int 00?00d0h 34h capcom register 21 cc21ir cc21ie cc21int 00?00d4h 35h capcom register 22 cc22ir cc22ie cc22int 00?00d8h 36h capcom register 23 cc23ir cc23ie cc23int 00?00dch 37h capcom register 24 cc24ir cc24ie cc24int 00?00e0h 38h capcom register 25 cc25ir cc25ie cc25int 00?00e4h 39h capcom register 26 cc26ir cc26ie cc26int 00?00e8h 3ah capcom register 27 cc27ir cc27ie cc27int 00?00ech 3bh capcom register 28 cc28ir cc28ie cc28int 00?00f0h 3ch capcom register 29 cc29ir cc29ie cc29int 00?0110h 44h capcom register 30 cc30ir cc30ie cc30int 00?0114h 45h capcom register 31 cc31ir cc31ie cc31int 00?0118h 46h capcom timer 0 t0ir t0ie t0int 00?0080h 20h capcom timer 1 t1ir t1ie t1int 00?0084h 21h capcom timer 7 t7ir t7ie t7int 00?00f4h 3dh capcom timer 8 t8ir t8ie t8int 00?00f8h 3eh gpt1 timer 2 t2ir t2ie t2int 00?0088h 22h gpt1 timer 3 t3ir t3ie t3int 00?008ch 23h gpt1 timer 4 t4ir t4ie t4int 00?0090h 24h gpt2 timer 5 t5ir t5ie t5int 00?0094h 25h gpt2 timer 6 t6ir t6ie t6int 00?0098h 26h gpt2 caprel register crir crie crint 00?009ch 27h a/d conversion complete adcir adcie adcint 00?00a0h 28h a/d overrun error adeir adeie adeint 00?00a4h 29h asc0 transmit s0tir s0tie s0tint 00?00a8h 2ah asc0 transmit buffer s0tbir s0tbie s0tbint 00?011ch 47h table 8. interrupt sources (continued) source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number
interrupt system st10f280 72/239 doc id 8673 rev. 3 hardware traps are exceptions or error conditions that arise during run-time. they cause immediate non-maskable system reaction similar to a standard interrupt service (branching to a dedicated vector table location). the occurrence of a hardware trap is additionally signified by an individual bit in the trap flag register (tfr). except when another higher prioritized trap service is in progress, a hardware trap will interrupt any other program execution. hardware trap services cannot not be interrupted by standard interrupt or by pec interrupts. 8.3 interrupt control registers all interrupt control registers are identically organized. the lower 8 bit of an interrupt control register contain the complete interrupt status information of the associated source, which is required during one round of prioritization, the upper 8 bit of the respective register are reserved. all interrupt control registers are bit-addressable and all bit can be read or written via software. this allows each interrupt source to be programmed or modified with just one instruction. when accessing interrupt control registers through instructions which operate on word data types, their upper 8 bit (15...8) will return zeros, when read, and will discard written data. the layout of the interrupt control registers shown below applies to each xxic register, where xx stands for the mnemonic for the respective source. asc0 receive s0rir s0rie s0rint 00?00ach 2bh asc0 error s0eir s0eie s0eint 00?00b0h 2ch ssc transmit sctir sctie sctint 00?00b4h 2dh ssc receive scrir scrie scrint 00?00b8h 2eh ssc error sceir sceie sceint 00?00bch 2fh pwm channel 0...3 pwmir pwmie pwmint 00?00fch 3fh can1 interface xp0ir xp0ie xp0int 00?0100h 40h can2 interface xp1ir xp1ie xp1int 00?0104h 41h xpwm xp2ir xp2ie xp2int 00?0108h 42h pll unlock/owd xp3ir xp3ie xp3int 00?010ch 43h table 8. interrupt sources (continued) source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number
st10f280 interrupt system doc id 8673 rev. 3 73/239 xxic address: 0xyyyyh / zzh sfr area reset: 0x--00h type: r/w 8.4 exception and error traps list ta b l e 9 shows all of the possible exceptions or error conditions that can arise during run- time: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------xxirxxie ilvl glvl r/w r/w r/w r/w glvl group level defines the internal order for simultaneous requests of the same priority. 11: highest group priority 00: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. fh: highest priority level 0h: lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) 0: interrupt request is disabled 1: interrupt request is enabled xxir interrupt request flag 0: no request pending 1: this source has raised an interrupt request
interrupt system st10f280 74/239 doc id 8673 rev. 3 table 9. exceptions or error conditions that can arise during run-time exception condition trap flag trap vector vector location trap number trap priority (1) reset functions maximum hardware reset reset 00?0000h 00h iii software reset reset 00?0000h 00h iii watchdog timer overflow reset 00?0000h 00h iii class a hardware traps non-maskable interrupt nmi nmitrap 00?0008h 02h ii stack overflow stkof stotrap 00?0010h 04h ii stack underflow stkuf stutrap 00?0018h 06h ii class b hardware traps undefined opcode undopc btrap 00?0028h 0ah i protected instruction fault prtflt btrap 00?0028h 0ah i illegal word operand access illopa btrap 00?0028h 0ah i illegal instruction access illina btrap 00?0028h 0ah i illegal external bus access illbus btrap 00?0028h 0ah i mac trap mactrp btrap 00?0028h 0ah i minimum reserved [2ch ?3ch] [0bh ? 0fh] software traps trap instruction any [00?0000h? 00?01fch] in steps of 4h any [00h ? 7fh] current cpu priority 1. all the class b traps have the same trap number (and vector) and the same lower priority compare to the class a traps and to the resets. each class a traps has a dedicated trap number (and vector). they are prioritized in the second priority level. the resets have the highest priority level and the same trap number. the psw.ilvl cpu priority is forced to the hi ghest level (15) when these exceptions are serviced
st10f280 capture/comp are (capcom) units doc id 8673 rev. 3 75/239 9 capture/compare (capcom) units the st10f280 has two 16 channels capcom units as described in figure 12 . these support generation and control of timing sequences on up to 32 channels with a maximum resolution of 200ns at 40mhz cpu clock. the capcom units are typically used to handle high speed i/o tasks such as pulse and waveform generation, pulse width modulation (pmw), digital to analog (d/a) conversion, software timing, or time recording relative to external events. four 16-bit timers (t0/t1, t7/t8) with reload registers provide two independent time bases for the capture/compare register array (see figure 13 and figure 14 ). the input clock for the timers is programmable to several prescaled values of the internal system clock, or may be derived from an overflow/underflow of timer t6 in module gpt2. this provides a wide range of variation for the timer period and resolution and allows precise adjustments to application specific requirements. in addition, external count inputs for capcom timers t0 and t7 allow event scheduling for the capture/compare registers relative to external events. each of the two capture/compare register arrays contain 16 dual purpose capture/compare registers, each of which may be individually allocated to either capcom timer t0 or t1 (t7 or t8, respectively), and programmed for capture or compare functions. each of the 32 registers has one associated port pin which serves as an input pin for triggering the capture function, or as an output pin to indicate the occurrence of a compare event. figure 12 shows the basic structure of the two capcom units. figure 12. capcom unit block diagram 0in 4x )nput #ontrol  n n '044imer4 0in 4x). #05 #lock -ode #ontrol #apture or #ompare  #aptureinputs #ompareoutputs 0in 4y )nput #ontrol  n n '044imer4 /ver5nderflow #05 #lock 2eload2egister4x2%, #!0#/-4imer4x )nterrupt 2equest 3ixteen bit #apture#ompare 2egisters /ver5nderflow #!0#/-4imer4y 2eload2egister4y 2%,  #apture#ompare
)nterrupt2equests )nterrupt 2equest x  y  ("1($'5
capture/compare (capcom) units st10f280 76/239 doc id 8673 rev. 3 note: the capcom2 unit provides 16 capture inputs, but only 12 compare outputs. cc24i to cc27i are inputs only. figure 13. block diagram of capcom timers t0 and t7 figure 14. block diagram of capcom timers t1 and t note: when an external input signal is connected to the input lines of both t0 and t7, these timers count the input signal synchronously. thus the two timers can be regarded as one timer whose contents can be compared with 32 capture registers. when a capture/compare register has been selected for capture mode, the current contents of the allocated timer will be latched (captured) into the capture/compare register in response to an external event at the port pin which is associated with this register. in addition, a specific interrupt request for this capture/compare register is generated. either a positive, a negative, or both a positive and a negative external signal transition at the pin can be selected as the triggering event. the contents of all registers which have been selected for one of the five compare modes are continuously compared with the contents of the allocated timers. when a match occurs between the timer value and the value in a capture /compare register, specific actions will be taken based on the selected compare mode (see ta b l e ). 0in 8 4xl #05 #lock 4x2 -5 8 '044imer4 /ver5nderflow %dge3elect 4x). 4xl 4xl 4x- )nput #ontrol 2eload2egister4x2%, #!0#/-4imer4x 4x)2 )nterrupt 2equest x  ("1($'5 8 4xl #05 #lock 4x2 -58 '044imer4 /ver5nderflow 4x- 2eload2egister4x2%, #!0#/-4imer4x 4x)2 )nterrupt 2equest x  ("1($'5
st10f280 capture/comp are (capcom) units doc id 8673 rev. 3 77/239 the input frequencies f tx , for the timer input selector tx, are determined as a function of the cpu clocks. the timer input frequencies, resolution and periods which result from the selected pre-scaler option in txi when using a 40mhz cpu clock are listed in the ta b l e 1 1 . the numbers for the timer periods are based on a reload value of 0000h. note that some numbers may be rounded to 3 significant figures. table 10. compare modes compare modes function mode 0 interrupt-only compare mode; several compare interrupts per timer period are possible mode 1 pin toggles on each compare match; several compare events per timer period are possible mode 2 interrupt-only compare mode; only one compare interrupt per timer period is generated mode 3 pin set ?1? on match; pin reset ?0? on compare time overflow; only one compare event per timer period is generated double register mode two registers operate on one pin; pin toggles on each compare match; several compare events per timer period are possible. table 11. capcom timer input frequencies, resolution and periods f cpu = 40mhz timer input selection txi 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler for f cpu 8 16 32 64 128 256 512 1024 input frequency 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz 39.1khz resolution 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s 25.6s period 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms 1.678s
general purpose timer unit st10f280 78/239 doc id 8673 rev. 3 10 general purpose timer unit the gpt unit is a flexible multifunctional timer/counter structure which is used for time related tasks such as event timing and counting, pulse width and duty cycle measurements, pulse generation, or pulse multiplication. the gpt unit contains five 16-bit timers organized into two separate modules gpt1 and gpt2. each timer in each module may operate independently in several different modes, or may be concatenated with another timer of the same module. 10.1 gpt1 each of the three timers t2, t3, t4 of the gpt1 module can be configured individually for one of four basic modes of operation: timer, gated timer, counter mode and incremental interface mode. in timer mode, the input clock for a timer is derived from the cpu clock, divided by a programmable prescaler. in counter mode, the timer is clocked in reference to external events. pulse width or duty cycle measurement is supported in gated timer mode where the operation of a timer is controlled by the ?gate? level on an external input pin. for these purposes, each timer has one associated port pin (txin) which serves as gate or clock input. ta b l e 1 2 lists the timer input frequencies, resolution and periods for each pre-scaler option at 40mhz cpu clock. this also applies to the gated timer mode of t3 and to the auxiliary timers t2 and t4 in timer and gated timer mode. the count direction (up/down) for each timer is programmable by software or may be altered dynamically by an external signal on a port pin (txeud). in incremental interface mode, the gpt1 timers (t2, t3, t4) can be directly connected to the incremental position sensor signals a and b by their respective inputs txin and txeud. direction and count signals are internally derived from these two input signals so that the contents of the respective timer tx corresponds to the sensor position. the third position sensor signal top0 can be connected to an interrupt input. timer t3 has output toggle latches (txotl) which changes state on each timer over flow / underflow. the state of this latch may be output on port pins (txout) for time out monitoring of external hardware components, or may be used internally to clock timers t2 and t4 for high resolution of long duration measurements. in addition to their basic operating modes, timers t2 and t4 may be configured as reload or capture registers for timer t3. when used as capture or reload registers, timers t2 and t4 are stopped. the contents of timer t3 is captured into t2 or t4 in response to a signal at their associated input pins (txin). timer t3 is reloaded with the contents of t2 or t4 triggered either by an external signal or by a selectable state transition of its toggle latch t3otl. when both t2 and t4 are configured to alternately reload t3 on opposite state transitions of t3otl with the low and high times of a pwm signal, this signal can be constantly generated without software intervention.
st10f280 general purpose timer unit doc id 8673 rev. 3 79/239 figure 15. block diagram of gpt1 10.2 gpt2 the gpt2 module provides precise event control and time measurement. it includes two timers (t5, t6) and a capture/reload register (caprel). both timers can be clocked with an input clock which is derived from the cpu clock via a programmable prescaler or with external signals. the count direction (up/down) for each timer is programmable by software or may additionally be altered dynamically by an external signal on a port pin (txeud). concatenation of the timers is supported via the output toggle latch (t6otl) of timer t6 which changes its state on each timer overflow/underflow. the state of this latch may be used to clock timer t5, or it may be output on a port pin (t6out). the overflow / underflow of timer t6 can additionally be used to clock the capcom timers t0 or t1, and to cause a reload from the caprel register. the caprel register may capture the contents of timer t5 based on an external signal transition on the corresponding port pin (capin), and timer t5 may optionally be cleared after the capture procedure. this allows absolute time differences to be measured or pulse multiplication to be performed without software overhead. table 12. gpt1 timer input frequencies, resolution and periods f cpu = 40mhz timer input selection t2i / t3i / t4i 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler factor 8 16 32 64 128 256 512 1024 input freq 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz 39.1khz resolution 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s 25.6s period maximum 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms 1.678s  n n  n n 4%5$ 4). #05#lock #05#lock 4). 4%5$ 4 -ode control '044imer4 '044imer4 5$ )nterrupt 2equest 5$ '04#!02%, 44, 4oggle&& 4/54 #!0). 2eload )nterrupt 2equest to#!0#/- 4imers #apture #lear )nterrupt 2equest ("1($'5 4 -o de control
general purpose timer unit st10f280 80/239 doc id 8673 rev. 3 the capture trigger (timer t5 to caprel) may also be generated upon transitions of gpt1 timer t3 inputs t3in and/or t3eud. this is advantageous when t3 operates in incremental interface mode. ta b l e 1 3 lists the timer input frequencies, resolution and periods for each pre-scaler option at 40mhz cpu clock. this also applies to the gated timer mode of t6 and to the auxiliary timer t5 in timer and gated timer mode. figure 16. block diagram of gpt2 table 13. gpt2 timer input frequencies, resolution and period f cpu = 40mhz timer input selection t5i / t6i 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler factor 4 8 16 32 64 128 256 512 input freq 10mhz 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz resolution 100ns 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s period maximum 6.55ms 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms  n n  n n 4%5$ 4). #05#lock #05#lock 4). 4%5$ '044imer4 '044imer4 5$ )nterrupt 2equest 5$ '04#!02%, 44, 4oggle&& 4/54 #!0). 2eload )nterrupt 2equest to#!0#/- 4imers #apture #lear )nterrupt 2equest ("1($'5 4 -ode control 4 -o de control
st10f280 pwm module doc id 8673 rev. 3 81/239 11 pwm module 11.1 standard pwm module the pulse width modulation module can generate up to four pwm output signals using edge-aligned or centre-aligned pwm. in addition, the pwm module can generate pwm burst signals and single shot outputs. the ta b l e 1 4 shows the pwm frequencies for different resolutions. the level of the output signals is selectable and the pwm module can generate interrupt requests. figure 17. block diagram of pwm module 11.2 new pwm module: xpwm the new pulse width modulation (xpwm) module of the st10f280 is mapped on the xbus interface (address range 00?ec00h-00?ecffh) and allows the generation of up to 4 independent pwm signals.the xpwm is enabled by setting xpen bit 2 of the syscon register and bit 4 of the new xpercon register. the frequency range of these xpwm signals for a 40mhz cpu clock is from 9.6hz up to 20mhz for edge aligned signals. for center aligned signals the frequency range is 4.8hz up to 10mhz (see detailed description). the minimum values depend on the width (16 bit) and the resolution (clk/1 or clk/64) of table 14. pwm unit frequencies and resolution at 40mhz cpu clock mode 0 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 156.25khz 39.06khz 9.77khz 2.44hz 610.35hz cpu clock/64 1.6 s 2.44hz 610.35hz 152.58hz 38.15hz 9.54hz mode 1 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 78.12khz 19.53khz 4.88khz 1.22khz 305.17hz cpu clock/64 1.6 s 1.22khz 305.17hz 76.29hz 19.07hz 4.77hz 00x0eriod2egister #omparator 04x  bit5p$own#ounter 3ha dow2egister 07x0ulse7idth2egister )nput 2un #ontrol #lock #lock #omparator


5p$own #lea r#ontrol -atch /utput#ontrol -atch 7r ite#ontrol
5serreadablewriteableregister %nable 0/54x ("1($'5
pwm module st10f280 82/239 doc id 8673 rev. 3 the xpwm timers. the maximum values assume that the xpwm output signal changes with every cycle of the respective timer. in a real application the maximum xpwm frequency will depend on the required resolution of the xpwm output signal (see figure 18 ). the pulse width modulation module consists of 4 independent pwm channels. each channel has a 16-bit up/down counter xptx, a 16-bit period register xppx with a shadow latch, a 16-bit pulse width register xpwx with a shadow latch, two comparators, and the necessary control logic. the operation of all four channels is controlled by two common control registers, xpwmcon0 and xpwmcon1, and the interrupt control and status is handled by one interrupt control register xp2ic, which is also common for all channels (see figure 11.2.1 ). figure 18. sfrs and port pins associated with the xpwm module figure 19. xpwm channel block diagram $ata2egisters  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 800 9999 9 9 9 9 9999999 9 807 9999 9 9 9 9 9999999 9 800 9999 9 9 9 9 9999999 9 807 999 9 9 9 9 9 9999999 9 800 999 9 9 9 9 9 9999999 9 807 999 9 9 9 9 9 9999999 9 800 999 9 9 9 9 9 9999999 9 807  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 804 9999 9 9 9999999 9 9 9 804 9999 9 9 9999999 9 9 9 804 9999 9 9 9999999 9 9 9 804 #ounter2egisters  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 807-#/. 99 9 9999999 9 807-#/. 999 9 80/,!2 9999999 9 80)#% #ontrol2egistersand)nterrupt#ontrol /utputondedicatedpins 807- 807- 807- 807- 800x 807x 804x 807-#/.x 80/,!2x 807-0eriod2egisterx 807-0ulse7)dth2egisterx 807-#ounter2egisterx 807-#ontrol2egister 807-/utput0olarity#ontrol2egister 80)# 807-)nterrupt#ontrol2egister 9 % 4h isbithasa807-function 4h isbithasno807(functionorisnotimplemnented 4h isregisterbelongsto%3&2area    ("1($'5 800x0eriod2egister #omparator 804 x  bit5p$own#ounter 3hadow2egister 80 7x0ulse7idth2egister )nput 2un #ontrol #lock #lock #omparator


5p$own #lear#ontrol -atch /utput#ontrol -atch 7rite#ontrol
5serreadablewriteableregister %nable 80 /54x ("1($'5
st10f280 pwm module doc id 8673 rev. 3 83/239 11.2.1 operating modes the xpwm module provides four different operating modes: mode 0 standard pwm generation (edge aligned pwm) available on all four channels mode 1 symmetrical pwm generation (center aligned pwm) available on all four channels burst mode combines channels 0 and 1 single shot mode available on channels 2 and 3 note: the output signals of the xpwm module are xored with the outputs of the respective bits of xpolar register. after reset these bits are cleared, so the pwm signals are directly driven to the output pins. by setting the respective bits of xpolar register to ?1? the pwm signal may be inverted (xored with ?1?) before being driven to the output pin. the descriptions below refer to the standard case after reset, i.e. direct driving. mode 0: standard pwm generation (edge aligned pwm) mode 0 is selected by clearing the respective bit xpmx in register xpwmcon1 to ?0?. in this mode the timer xptx of the respective xpwm channel is always counting up until it reaches the value in the associated period shadow register. upon the next count pulse the timer is reset to 0000h and continues counting up with subsequent count pulses. the xpwm output signal is switched to high level when the timer contents are equal to or greater than the contents of the pulse width shadow register. the signal is switched back to low level when the respective timer is reset to 0000h, i.e. below the pulse width shadow register. the period of the resulting pwm signal is determined by the value of the respective xppx shadow register plus 1, counted in units of the timer resolution. pwm_period mode0 = [xppx] + 1 the duty cycle of the xpwm output signal is controlled by the value in the respective pulse width shadow register. this mechanism allows the selection of duty cycles from 0% to 100% including the boundaries. for a value of 0000h the output will remain at a high level, representing a duty cycle of 100%. for a value higher than the value in the period register the output will remain at a low level, which corresponds to a duty cycle of 0%. the figure 20 illustrates the operation and output waveforms of a xpwm channel in mode 0 for different values in the pulse width register. this mode is referred to as edge aligned pwm, because the value in the pulse width (shadow) register only effects the positive edge of the output signal. the negative edge is always fixed and related to the clearing of the timer.
pwm module st10f280 84/239 doc id 8673 rev. 3 figure 20. operation and output waveform in mode 0 mode 1: symmetrical pwm generation (center aligned pwm) mode 1 is selected by setting the respective bit xpmx in register xpwmcon1 to ?1?. in this mode the timer xptx of the respective xpwm channel is counting up until it reaches the value in the associated period shadow register. upon the next count pulse the count direction is reversed and the timer starts counting down now with subsequent count pulses until it reaches the value 0000 h . upon the next count pulse the count direction is reversed again and the count cycle is repeated with the following count pulses. the xpwm output signal is switched to a high level when the timer contents are equal to or greater than the contents of the pulse width shadow register while the timer is counting up. the signal is switched back to a low level when the respective timer has counted down to a value below the contents of the pulse width shadow register. so in mode 1 this pwm value controls both edges of the output signal. note that in mode 1 the period of the pwm signal is twice the period of the timer: pwm_period mode1 = 2 * ([xppx] + 1) the figure below illustrates the operation and output waveforms of a xpwm channel in mode 1 for different values in the pulse width register. this mode is referred to as center aligned pwm, because the value in the pulse width (shadow) register effects both edges of the output signal symmetrically.                     800x 0e riod 804 x#ount 6alu e 80 7x0ulse 7idth 80 7x 80 7x 80 7x 80 7x 80 7x 80 7x ,a tch3hadow2egisters )nterrupt2equest ,32 ,32 $uty#ycle             ,32 ("1($'5
st10f280 pwm module doc id 8673 rev. 3 85/239 figure 21. operation and output waveform in mode 1 burst mode burst mode is selected by setting bit pb01 in register xpwmcon1 to ?1?. this mode combines the signals from xpwm channels 0 and 1 onto the port pin of channel 0. the output of channel 0 is replaced with the logical and of channels 0 and 1. the output of channel 1 can still be used at its associated output pin (if enabled). each of the two channels can either operate in mode 0 or 1. note: it is guaranteed by design, that no spurious spikes will occur at the output pin of channel 0 in this mode. the output of the and gate will be transferred to the output pin synchronously to internal clocks. xoring of the pwm signal and the port output latch value is done after the anding of channel 0 and 1.            800x 0eriod 804 x#ount 6alue 807x0ulse 7i dth 807 x 807 x 807x 807 x 807 x 807 x ,a tch3hadow2egisters )nterrupt2eques #hange#ount ,32 $uty#ycle                      $irection ,32 ("1($'5
pwm module st10f280 86/239 doc id 8673 rev. 3 figure 22. operation and output waveform in burst mode single shot mode single shot mode is selected by setting the respective bit psx in register xpwmcon1 to ?1?. this mode is available for xpwm channels 2 and 3. in this mode the timer xptx of the respective xpwm channel is started via software and is counting up until it reaches the value in the associated period shadow register. upon the next count pulse the timer is cleared to 0000h and stopped via hardware, i.e. the respective ptrx bit is cleared. the xpwm output signal is switched to high level when the timer contents are equal to or greater than the contents of the pulse width shadow register. the signal is switched back to low level when the respective timer is cleared, i.e. is below the pulse width shadow register. thus starting a xpwm timer in single shot mode produces one single pulse on the respective port pin, provided that the pulse width value is between 0000h and the period value. in order to generate a further pulse, the timer has to be started again via software by setting bit ptrx (see figure 23 ). after starting the timer (i.e. ptrx = ?1?) the output pulse may be modified via software. writing to timer xptx changes the positive and/or negative edge of the output signal, depending on whether the pulse has already started (i.e. the output is high) or not (i.e. the output is still low). this (multiple) re-triggering is always possible while the timer is running, i.e. after the pulse has started and before the timer is stopped. loading counter xptx directly with the value in the respective xppx shadow register will abort the current pwm pulse upon the next clock pulse (counter is cleared and stopped by hardware). by setting the period (xppx), the timer start value (xptx) and the pulse width value (xpwx) appropriately, the pulse width (tw) and the optional pulse delay (td) may be varied in a wide range. 800 0eriod 6alue 804 #ount 6alue #hannel 800  80 4 #hannel #hannel 2esulting /u tput 80/54 ("1($'5
st10f280 pwm module doc id 8673 rev. 3 87/239 figure 23. operation and output waveform in single shot mode 11.2.2 xpwm module registers the xpwm module is controlled via two sets of registers. the waveforms are selected by the channel specific registers xptx (timer), xppx (period) and xpwx (pulse width). three common registers control the operating modes and the general functions (xpwmcon0 and xpwmcon1) of the pwm module as well as the interrupt behavior (xp2ic). up/down counters xptx each counter xptx of a pwm channel is clocked either directly by the cpu clock or by the cpu clock divided by 64. bit ptix in register xpwmcon0 selects the respective clock source. a xpwm counter counts up or down (controlled by hardware), while its respective run control bit ptrx is set. a timer is started (ptrx = ?1?) via software and is stopped (ptrx = ?0?) either via hardware or software, depending on its operating mode. control bit ptrx enables or disables the clock input of counter xptx rather than controlling the xpwm output signal. note: for the register locations please refer to the ta bl e 1 5 . ta b l e 1 6 summarizes the xpwm frequencies that result from various combinations of operating mode, counter resolution (input clock) and pulse width resolution. period registers xppx the 16-bit period register xppx of a xpwm channel determines the period of a pwm cycle, i.e. the frequency of the pwm signal. this register is buffered with a shadow register. the shadow register is loaded from the respective xppx register at the beginning of every new         800 x 0eriod 80 4x#ount 6alue 807 x0ulse 7i dth 3et042x by3oftware 042x2eset by(ardware 04xstopped         3et042x by3oftware ,32 for.ext0ulse        800 x 0eriod 80 4x#ount 6alue 807 x0ulse 7i dth     t $ 2etriggerafter 7rite07xvalueto04x       t $ 4r iggerbefore0ulsehasstarted 7rite07xvalueto04x ,32 t 7 t 7 3hortens$elay4imet $ 0ulsehasstarted ("1($'5
pwm module st10f280 88/239 doc id 8673 rev. 3 pwm cycle, or upon a write access to xppx, while the timer is stopped. the cpu accesses the xppx register while the hardware compares the contents of the shadow register with the contents of the associated counter xptx. when a match is found between counter and xppx shadow register, the counter is either reset to 0000h, or the count direction is switched from counting up to counting down, depending on the selected operating mode of that xpwm channel. for the register locations refer to the ta b l e 1 5 . pulse width registers xpwx this 16-bit register holds the actual pwm pulse width value which corresponds to the duty cycle of the pwm signal. this register is buffered with a shadow register. the cpu accesses the xpwx register while the hardware compares the contents of the shadow register with the contents of the associated counter xptx. the shadow register is loaded from the respective xpwx register at the beginning of every new pwm cycle, or upon a write access to xpwx, while the timer is stopped.when the counter value is greater than or equal to the shadow register value, the pwm signal is set, otherwise it is reset. the output of the comparators may be described by the boolean formula: pwm output signal = [xptx] [xpwx shadow latch]. this type of comparison allows a flexible control of the pwm signal. for the register locations refer to the ta b l e 1 5 . table 15. xpwm module channel specific register addresses register address register address xpw0 ec30h xpt0 ec10h xpw1 ec32h xpt1 ec12h xpw2 ec34h xpt2 ec14h xpw3 ec36h xpt3 ec16h these registers are not bit-addressable. xpp0 ec20h xpp1 ec22h xpp2 ec24h xpp3 ec26h table 16. xpwm frequency mode 0 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 156.25khz 39.06khz 9.77khz 2.44hz 610.35hz cpu clock/64 1.6 s 2.44hz 610.35hz 152.58hz 38.15hz 9.54hz mode 1 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 78.12khz 19.53khz 4.88khz 1.22khz 305.17hz cpu clock/64 1.6 s 1.22khz 305.17hz 76.29hz 19.07hz 4.77hz
st10f280 pwm module doc id 8673 rev. 3 89/239 11.2.3 xpwm control registers xpwmcon0 address: 0xec00h reset: 0x0000h type: r/w register xpwmcon0 controls the function of the timers of the four xpwm channels and the channel specific interrupts. having the control bits organized in functional groups allows e.g. to start or stop all 4 xpwm timers simultaneously with one bitfield instruction. note: this register is not bit-addressable. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 pir3 pir2 pir1 pir0 pie3 pie2 pie1 pie0 pti3 pti2 pti1 pti0 ptr3 ptr2 ptr1 ptr0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w ptrx xpwm timer x run control bit 0: timer xptx is disconnected from its input clock 1: timer xptx is running ptix xpwm timer x input clock selection 0: timer xptx clocked with clk cpu 1: timerx ptx clocked with clk cpu / 64 piex xpwm channel x interrupt enable flag 0: interrupt from channel x disabled 1: interrupt from channel x enabled pirx xpwm channel x interrupt request flag 0: no interrupt request from channel x 1: channel x interrupt pending (must be reset via software)
pwm module st10f280 90/239 doc id 8673 rev. 3 xpwmcon1 address: 0xec02h reset: 0x0000h type: r/w register xpwmcon1 controls the operating modes and the outputs of the four xpwm channels. the basic operating mode for each channel (standard = edge aligned, or symmetrical = center aligned pwm mode) is selected by the mode bits xpmx. burst mode (channels 0 and 1) and single shot mode (channel 2 or 3) are selected by separate control bits. the output signal of each xpwm channel is individually enabled by bit penx. if the output is not enabled the respective pin can only be used to generate an interrupt request. note: this register is not bit-addressable. 11.2.4 interrupt request generation each of the four channels of the xpwm module can generate an individual interrupt request. each of these ?channel interrupts? can activate the common ?module interrupt?, which actually interrupts the cpu. this common module interrupt is controlled by the xpwm module interrupt control register xp2ic(xperipherals 2 control register). the interrupt service routine can determine the active channel interrupt(s) from the channel specific interrupt request flags pirx in register xpwmcon0. the interrupt request flag pirx of a channel is set at the beginning of a new pwm cycle, i.e. upon loading the shadow registers. this indicates that registers xppx and xpwx are now ready to receive a new value. if a channel interrupt is enabled via its respective piex bit, also the common interrupt request flag xp2ir in register xp2ic is set, provided that it is enabled via the common interrupt enable bit xp2ie. note: the channel interrupt request flags (pirx in register xpwmcon0) are not automatically cleared by hardware upon entry into the interrupt service routine, so they must be cleared via software. the module interrupt request flag xp2ir is cleared by hardware upon entry into the service routine, regardless of how many channel interrupts were active. however, it 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ps3 ps2 - pb01 - - - - pm3 pm2 pm1 pm0 pen3 pen2 pen1 pen0 r/w r/w - r/w - - - - r/w r/w r/w r/w r/w r/w r/w r/w penx xpwm channel x output enable bit 0: channel x output signal disabled, generate interrupt only 1: channel x output signal enabled pmx xpwm channel x mode control bit 0: channel x operates in mode 0, edge aligned pwm 1: channel x operates in mode 1, center aligned pwm pb01 xpwm channel 0/1 burst mode control bit 0: channels 0 and 1 work independently in respective standard mode 1: outputs of channels 0 and 1 are anded to xpwm0 in burst mode psx xpwm channel x single shot mode control bit 0: channel x works in respective standard mode 1: channel x operates in single shot mode
st10f280 pwm module doc id 8673 rev. 3 91/239 will be set again if during execution of the service routine a new channel interrupt request is generated. xp2ic address: 0xf196h / cbh esfr reset: 0x--00h type: r/w note: refer to the general interrupt control register description for an explanation of the control fields. 11.2.5 xpwm output signals the output signals of the four xpwm channels are xpwm3...xpwm0. the output signal of each pwm channel is individually enabled by control bit penx in register xpwmcon1. the xpwm signals are xored with the outputs of the register xpolar(3...0) before being driven to the output pins. this allows driving the xpwm signal directly to the output pin (xpolar.x=?0?) or driving the inverted xpwm signal (xpolar.x=?1?). figure 24. xpwm output signal generation 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------xp2irxp2ie ilvl glvl r/w r/w r/w r/w ,atch80/,!2 07- 0in807- ,atch80/,!2 07- 0i n807- ,atch80/,!2 07- 0in807- ,atch80/,!2 07- 0in807-  807-#/.0%. 807-#/.0%. 807-#/.0%. 807-#/.0%. 8/2 8/2 8/2 8/2 807-#/.0" ("1($'5
pwm module st10f280 92/239 doc id 8673 rev. 3 11.2.6 xpolar register (pol arity of the xpwm channel) xpolar address: 0xec04h reset: 0x0000h type: r/w software control of the xpwm outputs in an application the xpwm output signals are generally controlled by the xpwm module. however, it may be necessary to influence the level of the xpwm output pins via software either to initialize the system or to react on some extraordinary condition, e.g. a system fault or an emergency. clearing the timer run bit ptrx stops the associated counter and leaves the respective output at its current level. the individual xpwm channel outputs are controlled by comparators according to the formula: pwm output signal = [ptx] [pwx shadow latch]. so whenever software changes registers xptx, the respective output will reflect the condition after the change. loading timer xptx with a value greater than or equal to the value in xpwx immediately sets the respective output, a xptx value below the xpwx value clears the respective output. note: to prevent further pwm pulses from occurring after such a software intervention the respective counter must be stopped first. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - - - - - xpolar.3 xpolar.2 xpolar.1 xpolar.0 r/w r/w r/w r/w xpolar.x xpolar channel x polarity bit 0: polarity of channel x is normal 1: polarity of channel x is inverted
st10f280 parallel ports doc id 8673 rev. 3 93/239 12 parallel ports in order to accept or generate single external control signals or parallel data, the st10f280 provides up to 143 parallel i/o lines, organized into two 16-bit i/o port (port 2, xport9), eight 8-bit i/o ports (port0 made of p0h and p0l, port1 made of p1h and p1l, port 4, port 6, port 7, port 8), one 15-bit i/o port (port 3) and two 16-bit input port (port 5, xport10). these port lines may be used for general purpose input/output, controlled via software, or may be used implicitly by st10f280?s integrated peripherals or the external bus controller. all port lines are bit addressable, and all input/output lines are individually (bit-wise) programmable as inputs or outputs via direction registers (except port 5, xport10). the i/o ports are true bidirectional ports which are switched to high impedance state when configured as inputs. the output drivers of seven i/o ports (2, 3, 4, 6, 7, 8, 9) can be configured (pin by pin) for push/pull operation or open-drain operation via odpx control registers. the output driver of the pads are programmable to adapt the edge characteristics to the application requirement and to improve the emi behaviour. this is possible using the poconx registers for ports p0l, p0h, p1l, p1h, p2, p3, p4, p6, p7, p8. the output driver capabilities of ale, rd and wr control lines are programmable with the dedicated bits of pocon20 control register. the input threshold levels are programmable (ttl/cmos) for five ports (2, 3, 4, 7, 8) with the picon register control bits. the logic level of a pin is clocked into the input latch once per state time, regardless whether the port is configured for input or output. a write operation to a port pin configured as an input causes the value to be written into the port output latch, while a read operation returns the latched state of the pin itself. a read- modify-write operation reads the value of the pin, modifies it, and writes it back to the output latch. writing to a pin configured as an output (dpx.y=?1?) causes the output latch and the pin to have the written value, since the output buffer is enabled. reading this pin returns the value of the output latch. a read-modify-write operation reads the value of the output latch, modifies it, and writes it back to the output latch, thus also modifying the level at the pin. note: the new i/o ports (xport9, xport10) are not mapped on the sfr space but on the internal xbus interface. the xport9 and xport10 are enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register. on the xbus interface, the registers are not bit-addressable.
parallel ports st10f280 94/239 doc id 8673 rev. 3 figure 25. sfrs associated with the parallel ports $ata)nput/utput2egister          9  9  9  9  9  9  9  9 0, 99999999 0( 99999999 0, 99999999 0( 99 99 9 9 9999999999 0 9 99 9 9 9999999999 0 99999999 0 99 99 9 9 9999999999 0 99999999 0 99999999 0 99999999 0 $irection#ontrol2egisters          9  9  9  9  9  9  9  9 $0, 99999999 $0 ( 99999999 $0, 99999999 $0 ( 999 9 9 9 9999999999 $0 9 99 9 9 9999999999 $0 99999999 $0  99999999 $0  99999999 $0  99999999 $0  4hreshold/pen$rain#ontrol          9  9   9  9  9  9  9 0)#/.% 999 9 9 9 9999999999 /$ 0% 9 9 9 9999999999 /$0% 99 /$0% 99999999 /$0% 99999999 /$0% 99999999 /$0% /utput$river#ontrol2egister          9  9  9  9  9  9  9  9 0/#/., % 99999999 0/#/.(% 99999999 0/#/., % 99999999 0/#/. (% 9999 9 9 9999999999 0/#/.% 9 99 9 9 9999999999 0/#/.% 99999999 0/#/. % 99999999 0/#/.% 99999999 0/#/. % 99999999 0/#/. % 99999999 0/#/. %

2$ 72 !,%linesonly 9  "ithasan)/function  "ithasno)/dedicatedfunctionorisnotimplemented 2egisterbelongsto%3&2area % 999 9 9 9 9999999999 0$)$)3 0)#/. 0,).0(). 0,).0(). 0,). 0,). 0,). % % % % ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 95/239 figure 26. xbus registers associated with the parallel ports 12.1 introduction 12.1.1 open drain mode in the st10f280 some ports provide open drain control. this makes it possible to switch the output driver of a port pin from a push/pull configuration to an open drain configuration. in push/pull mode a port output driver has an upper and a lower transistor, thus it can actively drive the line either to a high or a low level. in open drain mode the upper transistor is always switched off, and the output driver can only actively drive the line to a low level. when writing a ?1? to the port latch, the lower transistor is switched off and the output enters a high-impedance state. the high level must then be provided by an external pull-up device. with this feature, it is possible to connect several port pins together to a wired-and configuration, saving external glue logic and/or additional software overhead for enabling/disabling output signals. this feature is implemented for ports p2, p3, p4, p6, p7 and p8 (see respective sections), and is controlled through the respective open drain control registers odpx. these registers allow the individual bit-wise selection of the open drain mode for each port line. if the respective control bit odpx.y is ?0? (default after reset), the output driver is in the push/pull mode. if odpx.y is ?1?, the open drain configuration is selected. note that all odpx registers are located in the esfr space. figure 27. output drivers in push/pull mode and in open drain mode  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 80 999 9 9 9 9999999999 803%4 999 9 9 9 9999999999 80#,2 999 9 9 9 9999999999 80 999 9 9 9 9999999999 80$)$)3 9 8!$#-58  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 8$0 999 9 9 9 9999999999 803%4 999 9 9 9 9999999999 80#,2  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9  9 8/0 999 9 9 9 9999999999 8/03%4 999 9 9 9 9999999999 8/0#,2 ("1($'5 0in 1 0ush 0ull/utput$river 1 /pen$rain/utput$river %xternal 0ullup 0in ("1($'5
parallel ports st10f280 96/239 doc id 8673 rev. 3 12.1.2 input th reshold control the standard inputs of the st10f280 determine the status of input signals according to ttl levels. in order to accept and recognize noisy signals, cmos-like input thresholds can be selected instead of the standard ttl thresholds for all pins of port 2, port 3, port4, port 7 and port 8. these special thresholds are defined above the ttl thresholds and feature a defined hysteresis to prevent the inputs from toggling while the respective input signal level is near the thresholds. the port input control register picon is used to select these thresholds for each byte of the indicated ports, i.e. the 8-bit ports p7 and p8 are controlled by one bit each while ports p2 and p3 are controlled by two bits each. picon address: 0xf1c4h / e2h esfr reset: 0x--00h type: r/w all options for individual direction and output mode control are available for each pin, independent of the selected input threshold. the input hysteresis provides stable inputs from noisy or slowly changing external signals. figure 28. hysteresis for special input thresholds 12.1.3 output driver control the port output control registers poconx allow to select the port output driver characteristics of a port. the aim of these selections is to adapt the output drivers to the application?s requirements, and to improve the emi behaviour of the device. two characteristics may be selected: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p8lin p7lin - p4lin p3hin p3lin p2hin p2lin r/w r/w r/w r/w r/w r/w r/w r/w pxlin port x low byte input level selection 0: pins px.7...px.0 switch on standard ttl input levels 1: pins px.7...px.0 switch on special threshold input levels pxhin port x high byte input level selection 0: pins px.15...px.8 switch on standard ttl input levels 1: pins px.15...px.8 switch on special threshold input levels )nputlevel "itstate (ysteresis ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 97/239 edge characteristic defines the rise/fall time for the respective output, ie. the transition time. slow edge reduce the peak currents that are sinked/sourced when changing the voltage level of an external capacitive load. for a bus interface or pins that are changing at frequency higher than 1mhz, however, fast edges may still be required. driver characteristic defines either the general driving capability of the respective driver, or if the driver strength is reduced after the target output level has been reached or not. reducing the driver strength increases the output?s internal resistance, which attenuates noise that is imported via the output line. for driving leds or power transistors, however, a stable high output current may still be required. for each feature, a 2-bit control field (ie. 4 bits) is provided for each group of 4 port pads (ie. a port nibble), in port output control registers poconx. poconx address: 0xf0yyh / zzh for 8-bit ports esfr reset: 0x--00h type: r/w poconx address: 0xf0yyh / zzh for 16-bit ports esfr reset: 0x0000h type: r/w note: in case of reading an 8 bit p0conx register, high byte (bit 15..8) is read as 00h. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -------- pn1dc pn1ec pn0dc pn0ec r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 pn3dc pn3ec pn2dc pn2ec pn1dc pn1ec pn0dc pn0ec r/w r/w r/w r/w r/w r/w r/w r/w pnxec port nibble x edge characteristic (rise/fall time) 00: fast edge mode, rise/fall times depend on the driver?s dimensioning. 01: slow edge mode, rise/fall times ~60 ns 10: reserved 11: reserved pnxdc port nibble x driver characteristic (output current) 00: high current mode: driver always operates with maximum strength. 01: dynamic current mode: driver strength is reduced after the target level has been reached. 10: low current mode: driver always operates with reduced strength. 11: reserved
parallel ports st10f280 98/239 doc id 8673 rev. 3 port control register allocation the table below lists the defined pocon registers and the allocation of control bitfields and port pins: dedicated pins output control programmable pad drivers also are supported for the dedicated pins ale, rd and wr . for these pads, a special pocon20 register is provided. pocon20 address: 0xf0aah / 5h esfr reset: 0x0000h type: r/w table 17. pocon registers control register physical address 8-bit address controlled port pocon0l f080h 40h p0l.7...4 p0l.3...0 pocon0h f082h 41h p0h.7...4 p0h.3...0 pocon1l f084h 42h p1l.7...4 p1l.3...0 pocon1h f086h 43h p1h.7...4 p1h.3...0 pocon2 f088h 44h p2.15...12 p2.11...8 p2.7...4 p2.3...0 pocon3 f08ah 45h p3.15, p3.13...12 p3.11...8 p3.7...4 p3.3...0 pocon4 f08ch 46h p4.7...4 p4.3...0 pocon6 f08eh 47h p6.7...4 p6.3...0 pocon7 f090h 48h p7.7...4 p7.3...0 pocon8 f092h 49h p8.7...4 p8.3...0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -------- pn1dc pn1ec pn0dc pn0ec r/w r/w r/w r/w pn0ec rd , wr edge characteristic (rise/fall time) 00: fast edge mode, rise/fall times depend on the driver?s dimensioning. 01: slow edge mode, rise/fall times ~60 ns 10: reserved 11: reserved pn0dc rd , wr driver characteristic (output current) 00: high current mode: driver always operates with maximum strength. 01: dynamic current mode: driver strength is reduced after the target level has been reached. 10: low current mode: driver always operates with reduced strength. 11: reserved
st10f280 parallel ports doc id 8673 rev. 3 99/239 12.1.4 alternate port functions each port line has one associated programmable alternate input or output function. port0 and port1 may be used as the address and data lines when accessing external memory. port 4 outputs the additional segment address bits a23/a19/a18/a16 in systems where more than 64 kbytes of memory are to be accessed directly. port 6 provides the optional chip select outputs and the bus arbitration lines. port 2, port 7 and port 8 are associated with the capture inputs or compare outputs of the capcom units and/or with the outputs of the pwm module. port 2 is also used for fast external interrupt inputs and for timer 7 input. port 3 includes alternate input/output functions of timers, serial interfaces, the optional bus control signal bhe /wrh and the system clock output (clkout). port 5 is used for the analog input channels to the a/d converter or timer control signals. if an alternate output function of a pin is to be used, the direction of this pin must be programmed for output (dpx.y=?1?), except for some signals that are used directly after reset and are configured automatically. otherwise the pin remains in the high-impedance state and is not effected by the alternate output function. the respective port latch should hold a ?1?, because its output is anded with the alternate output data (except for pwm output signals). if an alternate input function of a pin is used, the direction of the pin must be programmed for input (dpx.y=?0?) if an external device is driving the pin. the input direction is the default after reset. if no external device is connected to the pin, however, one can also set the direction for this pin to output. in this case, the pin reflects the state of the port output latch. thus, the alternate input function reads the value stored in the port output latch. this can be used for testing purposes to allow a software trigger of an alternate input function by writing to the port output latch. on most of the port lines, the user software is responsible for setting the proper direction when using an alternate input or output function of a pin. this is done by setting or clearing the direction control bit dpx.y of the pin before enabling the alternate function. there are port lines, however, where the direction of the port line is switched automatically. for instance, in the multiplexed external bus modes of port0, the direction must be switched several times for an instruction fetch in order to output the addresses and to input the data. obviously, this cannot be done through instructions. in these cases, the direction of the port line is switched automatically by hardware if the alternate function of such a pin is enabled. pn1ec ale edge characteristic (rise/fall time) 00: fast edge mode, rise/fall times depend on the driver?s dimensioning. 01: slow edge mode, rise/fall times ~60 ns 10: reserved 11: reserved pn1dc ale driver characteristic (output current) 00: high current mode: driver always operates with maximum strength. 01: dynamic current mode: driver strength is reduced after the target level has been reached. 10: low current mode: driver always operates with reduced strength. 11: reserved
parallel ports st10f280 100/239 doc id 8673 rev. 3 to determine the appropriate level of the port output latches check how the alternate data output is combined with the respective port latch output. there is one basic structure for all port lines with only an alternate input function. port lines with only an alternate output function, however, have different structures due to the way the direction of the pin is switched and depending on whether the pin is accessible by the user software or not in the alternate function mode. all port lines that are not used for these alternate functions may be used as general purpose i/o lines. when using port pins for general purpose output, the initial output value should be written to the port latch prior to enabling the output drivers, in order to avoid undesired transitions on the output pins. this applies to single pins as well as to pin groups (see examples below). single_bit: bset p4.7 ; initial output level is "high" bset dp4.7 ; switch on the output driver bit_group: bfldh p4, #24h, #24h ; initial output level is "high" bfldh dp4, #24h, #24h ; switch on the output drivers note: when using several bset pairs to control more pins of one port, these pairs must be separated by instructions, which do not reference the respective port (see ?particular pipeline effects? in chapter 6: central processing unit (cpu) ). 12.2 port 0 the two 8-bit ports p0h and p0l represent the higher and lower part of port0, respectively. both halves of port0 can be written (e.g. via a pec transfer) without effecting the other half. if this port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction registers dp0h and dp0l.
st10f280 parallel ports doc id 8673 rev. 3 101/239 p0l address: 0xff00h / 80h sfr reset: 0x--00h type: r/w p0h address: 0xff020h / 81h sfr reset: 0x--00h type: r/w dp0l address: 0xf100h / 80h esfr reset: 0x--00h type: r/w dp0h address: 0xf102h / 81h esfr reset: 0x--00h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 r/w r/w r/w r/w r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------p0h.7p0h.6p0h.5p0h.4p0h.3p0h.2p0h.1p0h.0 r/w r/w r/w r/w r/w r/w r/w r/w p0x.y port data register p0h or p0l bit y 1514131211109876543210 --------dp0l.7dp0l.6dp0l.5dp0l.4dp0l.3dp0l.2dp0l.1dp0l.0 r/w r/w r/w r/w r/w r/w r/w r/w 1514131211109876543210 --------dp0h.7dp0h.6dp0h.5dp0h.4dp0h.3dp0h.2dp0h.1dp0h.0 r/w r/w r/w r/w r/w r/w r/w r/w dp0x.y port direction register dp0h or dp0l bit y dp0x.y = 0: port line p0x.y is an input (high-impedance) dp0x.y = 1: port line p0x.y is an output
parallel ports st10f280 102/239 doc id 8673 rev. 3 12.2.1 alternate f unctions of port 0 when an external bus is enabled, port0 is used as data bus or address/data bus. note that an external 8-bit de-multiplexed bus only uses p0l, while p0h is free for i/o (provided that no other bus mode is enabled). port0 is also used to select the system start-up configuration. during reset, port0 is configured to input, and each line is held high through an internal pull-up device. each line can now be individually pulled to a low level (see dc-level specifications) through an external pull-down device. a default configuration is selected when the respective port0 lines are at a high level. through pulling individual lines to a low level, this default can be changed according to the needs of the applications. the internal pull-up devices are designed such that an external pull-down resistors can be used to apply a correct low level. these external pull-down resistors can remain connected to the port0 pins also during normal operation, however, care has to be taken such that they do not disturb the normal function of port0 (this might be the case, for example, if the external resistor is too strong). with the end of reset, the selected bus configuration will be written to the buscon0 register. the configuration of the high byte of port0, will be copied into the special register rp0h. this read-only register holds the selection for the number of chip selects and segment addresses. software can read this register in order to react according to the selected configuration, if required. when the reset is terminated, the internal pull-up devices are switched off, and port0 will be switched to the appropriate operating mode. during external accesses in multiplexed bus modes port0 first outputs the 16-bit intra- segment address as an alternate output function. port0 is then switched to high- impedance input mode to read the incoming instruction or data. in 8-bit data bus mode, two memory cycles are required for word accesses, the first for the low byte and the second for the high byte of the word. during write cycles port0 outputs the data byte or word after outputting the address. during external accesses in de-multiplexed bus modes port0 reads the incoming instruction or data word or outputs the data byte or word. figure 29. port 0 i/o and alternate functions when an external bus mode is enabled, the direction of the port pin and the loading of data into the port output latch are controlled by the bus controller hardware. the input of the port output latch is disconnected from the internal bus and is switched to the line labeled ?alternate data output? via a multiplexer. the alternate data can be the 16-bit ("1($'5 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3/ 3/ 3/ 3/ 3/ 3/ 3/ 3/ 3257 3+ 3/ $owhuqdwh)xqfwlrq d e f g *hqhudo3xusrvh ,qsxw2xwsxw elw 'hpxowlsoh[hg%xv elw 'hpxowlsoh[hg%xv elw 0xowlsoh[hg%xv elw 0xowlsoh[hg%xv ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' $ $ $ $ $ $ $ $ $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $' $'
st10f280 parallel ports doc id 8673 rev. 3 103/239 intra-segment address or the 8/16-bit data information. the incoming data on port0 is read on the line ?alternate data input?. while an external bus mode is enabled, the user software should not write to the port output latch, otherwise unpredictable results may occur. when the external bus modes are disabled, the contents of the direction register last written by the user becomes active. the figure 30 shows the structure of a port0 pin. figure 30. block diagram of a port 0 pin 12.3 port 1 the two 8-bit ports p1h and p1l represent the higher and lower part of port1, respectively. both halves of port1 can be written (e.g. via a pec transfer) without effecting the other half. if this port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction registers dp1h and dp1l. p1l address: 0xff04h / 82h sfr reset: 0x--00h type: r/w $irection ,atch 7rite$0(y$0,y 2ead$0(y$0,y 0ort/utput ,atch 7rite0(y0,y 2ead0(y0,y )nternal"us -58   -58   !lternate $ata /utput -58   !lternate $i rection )nput ,atch 0(y 0,y /utput "uffer y !lternate &unction %nable 0ort$ata /u tput #05 #lock ("1($'5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p1l.7 p1l.6 p1l.5 p1l.4 p1l.3 p1l.2 p1l.1 p1l.0 r/w r/w r/w r/w r/w r/w r/w r/w
parallel ports st10f280 104/239 doc id 8673 rev. 3 p1h address: 0xff06h / 83h sfr reset: 0x--00h type: r/w dp1l address: 0xf104h / 82h esfr reset: 0x--00h type: r/w dp1h address: 0xf106h / 83h esfr reset: 0x--00h type: r/w 12.3.1 alternate f unctions of port 1 when a de-multiplexed external bus is enabled, port1 is used as address bus. note that de-multiplexed bus modes use port1 as a 16-bit port. otherwise all 16 port lines can be used for general purpose i/o. the upper four pins of port1 (p1h.7...p1h.4) also serve as capture input lines for the capcom2 unit (cc27io...cc24io). 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------p1h.7p1h.6p1h.5p1h.4p1l.3p1h.2p1h.1p1h.0 r/w r/w r/w r/w r/w r/w r/w r/w p1x.y port data register p1h or p1l bit y 1514131211109876543210 --------dp1l.7dp1l.6dp1l.5dp1l.4dp1l.3dp1l.2dp1l.1dp1l.0 r/w r/w r/w r/w r/w r/w r/w r/w 1514131211109876543210 -------- dp1h.7 dp1h.6 dp1h.5 dp1h.4 dp1h.3 dp1h.2 dp1h.1 dp1h.0 r/w r/w r/w r/w r/w r/w r/w r/w dp1x.y port direction register dp1h or dp1l bit y dp1x.y = 0: port line p1x.y is an input (high-impedance) dp1x.y = 1: port line p1x.y is an output
st10f280 parallel ports doc id 8673 rev. 3 105/239 as all other capture inputs, the capture input function of pins p1h.7...p1h.4 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). during external accesses in de-multiplexed bus modes port1 outputs the 16-bit intra- segment address as an alternate output function. during external accesses in multiplexed bus modes, when no buscon register selects a de-multiplexed bus mode, port1 is not used and is available for general purpose i/o (see figure 31 ). when an external bus mode is enabled, the direction of the port pin and the loading of data into the port output latch are controlled by the bus controller hardware. the input of the port output latch is disconnected from the internal bus and is switched to the line labeled ?alternate data output? via a multiplexer. the alternate data is the 16-bit intra-segment address. while an external bus mode is enabled, the user software should not write to the port output latch, otherwise unpredictable results may occur. when the external bus modes are disabled, the contents of the direction register last written by the user becomes active. figure 31. port 1 i/o and alternate functions the figure below shows the structure of a port1 pin. 3257 3+ 3/ d q r l w f q x )  h w d q u h w o $ 'eneral0urpose)nput/utput  bit$emultiplexed"us e #!0#/-#apture)nputs 0( 0( 0( 0( 0( 0( 0( 0( 0, 0, 0, 0, 0, 0, 0, 0, ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ##) ## ) ## ) ## ) ("1($'5
parallel ports st10f280 106/239 doc id 8673 rev. 3 figure 32. block diagram of a port 1 pin 12.4 port 2 if this 16-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp2. each port line can be switched into push/pull or open drain mode via the open drain control register odp2. p2 address: 0xffc0h / e0h sfr reset: 0x0000h type: r/w $irection ,a tch 7rite$0(y$0,y 2ead$0(y$0,y 0ort/utput ,atch 7rite0(y0,y 2ead0(y0,y )nternal"us -58   -58   -58   hv )nput ,a tch 0(y 0 ,y /utput "uffer y !lternate &unction %n able 0ort$ata /utput !lternate $ata /utput #05#lock ("1($'5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p2.15 p2.14 p2.13 p2.12 p2.11 p2.10 p2.9 p2.8 p2.7 p2.6 p2.5 p2.4 p2.3 p2.2 p2.1 p2.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w p2.y port data register p2 bit y
st10f280 parallel ports doc id 8673 rev. 3 107/239 dp2 address: 0xffc2h / e1h sfr reset: 0x0000h type: r/w odp2 address: 0xf1c2h / e1h esfr reset: 0x0000h type: r/w 12.4.1 alternate f unctions of port 2 all port 2 lines (p2.15...p2.0) serve as capture inputs or compare outputs (cc15io...cc0io) for the capcom1 unit. when a port 2 line is used as a capture input, the state of the input latch, which represents the state of the port pin, is directed to the capcom unit via the line ?alternate pin data input?. if an external capture trigger signal is used, the direction of the respective pin must be set to input. if the direction is set to output, the state of the port output latch will be read since the pin represents the state of the output latch. this can be used to trigger a capture event through software by setting or clearing the port latch. note that in the output configuration, no external device may drive the pin, otherwise conflicts would occur. when a port 2 line is used as a compare output (compare modes 1 and 3), the compare event (or the timer overflow in compare mode 3) directly effects the port output latch. in compare mode 1, when a valid compare match occurs, the state of the port output latch is read by the capcom control hardware via the line ?alternate latch data input?, inverted, and written back to the latch via the line ?alternate data output?. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 dp2.15 dp2.14 dp2.13 dp2.12 dp2.11 dp2.10 dp2.9 dp2.8 dp2.7 dp2.6 dp2.5 dp2.4 dp2.3 dp2.2 dp2.1 dp2.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w dp2.y port direction register dp2 bit y dp2.y = 0: port line p2.y is an input (high-impedance) dp2.y = 1: port line p2.y is an output 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 odp2.15 odp2.14 odp2.13 odp2.12 odp2.11 odp2.10 odp2.9 odp2.8 odp2.7 odp2.6 odp2.5 odp2.4 odp2.3 odp2.2 odp2.1 odp2.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w odp2.y port 2 open drain control register bit y odp2.y = 0: port line p2.y output driver in push/pull mode odp2.y = 1: port line p2.y output driver in open drain mode
parallel ports st10f280 108/239 doc id 8673 rev. 3 the port output latch is clocked by the signal ?compare trigger? which is generated by the capcom unit. in compare mode 3, when a match occurs, the value '1' is written to the port output latch via the line ?alternate data output?. when an overflow of the corresponding timer occurs, a '0' is written to the port output latch. in both cases, the output latch is clocked by the signal ?compare trigger?. the direction of the pin should be set to output by the user, otherwise the pin will be in the high-impedance state and will not reflect the state of the output latch. as can be seen from the port structure below, the user software always has free access to the port pin even when it is used as a compare output. this is useful for setting up the initial level of the pin when using compare mode 1 or the double-register mode. in these modes, unlike in compare mode 3, the pin is not set to a specific value when a compare match occurs, but is toggled instead. when the user wants to write to the port pin at the same time a compare trigger tries to clock the output latch, the write operation of the user software has priority. each time a cpu write access to the port output latch occurs, the input multiplexer of the port output latch is switched to the line connected to the internal bus. the port output latch will receive the value from the internal bus and the hardware triggered change will be lost. as all other capture inputs, the capture input function of pins p2.15...p2.0 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). the upper eight port 2 lines (p2.15...p2.8) also can serve as fast external interrupt inputs from ex0in to ex7in. (fast external interrupt sampling rate is 25ns at 40mhz cpu clock). p2.15 in addition serves as input for capcom2 timer t7 (t7in). the table below summarizes the alternate functions of port 2. table 18. port 2 alternate function port 2 pin alternate function a) alternate function b) alternate function c) p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 cc0io cc1io cc2io cc3io cc4io cc5io cc6io cc7io cc8io cc9io cc10io cc11io cc12io cc13io cc14io cc15io - - - - - - - - ex0in fast external interrupt 0 input ex1in fast external interrupt 1 input ex2in fast external interrupt 2 input ex3in fast external interrupt 3 input ex4in fast external interrupt 4 input ex5in fast external interrupt 5 input ex6in fast external interrupt 6 input ex7in fast external interrupt 7 input - - - - - - - - - - - - - - - t7in timer t7 ext. count input
st10f280 parallel ports doc id 8673 rev. 3 109/239 figure 33. port 2 i/o and alternate functions the pins of port 2 combine internal bus data with alternate data output before the port latch input. 3ruw $owhuqdwh)xqfwlrq d *hqhudo3xusrvh ,qsxw2xwsxw &$3&20 &dswxuh,qsxw&rpsduh2xwsxw e )dvw([whuqdo ,qwhuuxsw,qsxw f &$3&20 7lphu7,qsxw 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 &&,2 && ,2 &&,2 &&,2 &&,2 &&,2 &&,2 && ,2 &&,2 &&,2 && ,2 &&,2 &&,2 &&,2 &&,2 &&,2 (;,1 (;,1 (;,1 (;,1 (;,1 (;,1 (;,1 (;,1 7,1 ("1($'5
parallel ports st10f280 110/239 doc id 8673 rev. 3 figure 34. block diagram of a port 2 pin 2shq'udlq /dwfk :ulwh2'3\ 5hdg2'3\ 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ ,qwhuqdo%xv 08;   $owhuqdwh'dwd,qsxw ,qsxw /dwfk 3\ &&\,2 2xwsxw %xiihu [  $owhuqdwh 'dwd 2xwsxw 08;   2xwsxw /dwfk t  :ulwh3ruw3\ &rpsduh7uljjhu 5hdg3\ )dvw([whuqdo,qwhuuxsw,qsxw &38&orfn (;[,1 \  ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 111/239 12.5 port 3 if this 15-bit port is used for general purpose i/o, the direction of each line can be configured by the corresponding direction register dp3. most port lines can be switched into push/pull or open drain mode by the open drain control register odp3 (pins p3.15, p3.14 and p3.12 do not support open drain mode). due to pin limitations register bit p3.14 is not connected to an output pin. p3 address: 0xffc4h / e2h sfr reset: 0x0000h type: r/w dp3 address: 0xffc6h / e3h sfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p3.15 - p3.13 p3.12 p3.11 p3.10 p3.9 p3.8 p3.7 p3.6 p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 r/w r/w r/w r/w r/w r/w r/w r/ w r/w r/w r/w r/w r/w r/w r/w p3.y port data register p3 bit y 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 dp3.15 - dp3.13 dp3.12 dp3.11 dp3.10 dp3.9 dp3.8 dp3.7 dp3.6 dp3.5 dp3.4 dp3.3 dp3.2 dp3.1 dp3.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w dp3.y port direction register dp3 bit y dp3.y = 0: port line p3.y is an input (high-impedance) dp3.y = 1: port line p3.y is an output
parallel ports st10f280 112/239 doc id 8673 rev. 3 odp3 address: 0xf1c6h / e3h esfr reset: 0x0000h type: r/w 12.5.1 alternate f unctions of port 3 the pins of port 3 serve for various functions which include external timer control lines, the two serial interfaces and the control lines bhe /wrh and clkout. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -- odp3.13 - odp3.11 odp3.10 odp3.9 odp3.8 odp3.7 odp3.6 odp3.5 odp3.4 odp3.3 odp3.2 odp3.1 odp3.0 r/w r/w r/w r/w r/w r/w r/ w r/w r/w r/w r/w r/w r/w odp3.y port 3 open drain control register bit y odp3.y = 0: port line p3.y output driver in push-pull mode odp3.y = 1: port line p3.y output driver in open drain mode table 19. port 3 alternate functions port 3 pin alternate function p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 p3.13 p3.14 p3.15 t0in capcom1 timer 0 count input t6out timer 6 toggle output capin gpt2 capture input t3out timer 3 toggle output t3eud timer 3 external up/down input t4in timer 4 count input t3in timer 3 count input t2in timer 2 count input mrst ssc master receive / slave transmit mtsr ssc master transmit / slave receive txd0 asc0 transmit data output rxd0 asc0 receive data input / (output in synchronous mode) bhe /wrh byte high enable / write high output sclk ssc shift clock input/output --- no pin assigned! clkout system clock output
st10f280 parallel ports doc id 8673 rev. 3 113/239 figure 35. port 3 i/o and alternate functions the port structure of the port 3 pins depends on their alternate function (see figure 36 ). when the on-chip peripheral associated with a port 3 pin is configured to use the alternate input function, it reads the input latch, which represents the state of the pin, via the line labeled ?alternate data input?. port 3 pins with alternate input functions are: t0in, t2in, t3in, t4in, t3eud and capin. when the on-chip peripheral associated with a port 3 pin is configured to use the alternate output function, its ?alternate data output? line is anded with the port output latch line. when using these alternate functions, the user must set the direction of the port line to output (dp3.y=1) and must set the port output latch (p3.y=1). otherwise the pin is in its high-impedance state (when configured as input) or the pin is stuck at '0' (when the port output latch is cleared). when the alternate output functions are not used, the ?alternate data output? line is in its inactive state, which is a high level ('1'). port 3 pins with alternate output functions are: t6out, t3out, txd0 and clkout. when the on-chip peripheral associated with a port 3 pin is configured to use both the alternate input and output function, the descriptions above apply to the respective current operating mode. the direction must be set accordingly. port 3 pins with alternate input/output functions are: mtsr, mrst, rxd0 and sclk. note: enabling the clkout function automatically enables the p3.15 output driver. setting bit dp3.15=?1? is not required. 3ruw 1r 3lq e d q r l w f q x )  h w d q u h w o $ *hqhudo3xusrvh,qsxw2xwsxw 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 &/.287 6&/. %+( 5[' 7[' 0765 0567 7,1 7,1 7,1 7(8' 7287 &$3,1 7287 7,1 :5+ ("1($'5
parallel ports st10f280 114/239 doc id 8673 rev. 3 figure 36. block diagram of port 3 pin with alternate input or alternate output function pin p3.12 (bhe /wrh ) is another pin with an alternate output function, however, its structure is slightly different (see figure 37 ). after reset the bhe or wrh function must be used depending on the system start-up configuration. in either of these cases, there is no possibility to program any port latches before. thus, the appropriate alternate function is selected automatically. if bhe /wrh is not used in the system, this pin can be used for general purpose i/o by disabling the alternate function (bytdis = ?1? / wrcfg=?0?). 2shq'udlq /dwfk :ulwh2'3\ 5hdg2'3\ 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ ,qwhuqdo%xv 08;   $owhuqdwh 'dwd ,qsxw ,qsxw /dwfk 3\ 2xwsxw %xiihu \  3ruw2xwsxw /dwfk 5hdg3\ :ulwh3\ $owhuqdwh 'dwd2xwsxw 3ruw'dwd 2xwsxw &38&orfn ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 115/239 figure 37. block diagram of pins p3.15 (clkout) and p3.12 (bhe /wrh ) note: enabling the bhe or wrh function automatically enables the p3.12 output driver. setting bit dp3.12=?1? is not required. during bus hold, pin p3.12 is switched back to its standard function and is then controlled by dp3.12 and p3.12. keep dp3.12 = ?0? in this case to ensure floating in hold mode. 12.6 port 4 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp4. p4 address: 0xffc8h / e4h sfr reset: 0x--00h type: r/w 'luhfwlrq /dwfk :ulwh'3[ 5hdg'3[ 3ruw2xwsxw /dwfk :ulwh3[ 5hdg3[ ,qwhuqdo%xv 08;   08;   $owhuqdwh 'dwd 2xwsxw 08;   3 ,qsxw /dwfk 3%+( 3&/.287 2xwsxw %xiihu [  $owhuqdwh )xqfwlrq (qdeoh &38&orfn ("1($'5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p4.7 p4.6 p4.5 p4.4 p4.3 p4.2 p4.1 p4.0 r/w r/w r/w r/w r/w r/w r/w r/w p4.y port data register p4 bit y
parallel ports st10f280 116/239 doc id 8673 rev. 3 dp4 address: 0xffcah / e5h sfr reset: 0x--00h type: r/w for can configuration support (see chapter 15: can modules ), port 4 has a new open drain function, controlled with the new odp4 register: odp4 address: 0xf1cah / e5h esfr reset: 0x--00h type: r/w note: only bits 6 and 7 are implemented, all other bits will be read as ?0?. 12.6.1 alternate f unctions of port 4 during external bus cycles that use segmentation (i.e. an address space above 64k bytes) a number of port 4 pins may output the segment address lines. the number of pins used for segment address output determines the directly accessible external address space. the other pins of port 4 may be used for general purpose i/o. if segment address lines are selected, the alternate function of port 4 may be necessary to access e.g. external memory directly after reset. for this reason port 4 will be switched to this alternate function automatically. the number of segment address lines is selected via port0 during reset. the selected value can be read from bitfield salsel in register rp0h (read only) to check the configuration during run time. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------dp4.7dp4.6dp4.5dp4.4dp4.3dp4.2dp4.1dp4.0 r/w r/w r/w r/w r/w r/w r/w r/w dp4.y port direction register dp4 bit y dp4.y = 0: port line p4.y is an input (high-impedance) dp4.y = 1: port line p4.y is an output 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------odp4.7odp4.6------ r/w r/w odp4.y port 4 open drain control register bit y odp4.y = 0: port line p4.y output driver in push/pull mode odp4.y = 1: port line p4.y output driver in open drain mode if p4.y is not a segment address line output
st10f280 parallel ports doc id 8673 rev. 3 117/239 devices with can interfaces use 2 pins of port 4 to interface each can module to an external can transceiver. in this case the number of possible segment address lines is reduced. the table below summarizes the alternate functions of port 4 depending on the number of selected segment address lines (coded via bitfield salsel). . figure 38. port 4 i/o and alternate functions table 20. port 4 alternate functions port 4 pin std. function salsel=01 64 kb altern. function salsel=11 256kb altern. function salsel=00 1mb altern. function salsel=10 16mb p4.0 p4.1 p4.2 p4.3 p4.4 p4.5 p4.6 p4.7 gpio gpio gpio gpio gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd seg. address a16 seg. address a17 gpio gpio gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd seg. address a16 seg. address a17 seg. address a18 seg. address a19 gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd seg. address a16 seg. address a17 seg. address a18 seg. address a19 seg. address a20 seg. address a21 seg. address a22 seg. address a23 3ruw $owhuqdwh)xqfwlrq d *hqhudo3xusrvh ,qsxw2xwsxw e 6hjphqw$gguhvv /lqhv &dqv,2dqg*hqhudo3xusrvh ,qsxw2xwsxw 3 3 3 3 3 3 3 3 $ $ $ $ $ $ $ $ &$1b7[' &$1b7[' &$1b5[' &$1b5[' s 3 3 3 ("1($'5
parallel ports st10f280 118/239 doc id 8673 rev. 3 figure 39. block diagram of a port 4 pin 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ 3ruw2xwsxw /dwfk :ulwh3\ 5hdg3\ ,qwhuqdo%xv 08;   08;   $owhuqdwh 'dwd 2xwsxw 08;   3 ,qsxw /dwfk 3\ 2xwsxw %xiihu \  $owhuqdwh )xqfwlrq (qdeoh &38&orfn ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 119/239 figure 40. block diagram of p4.4 and p4.5 pins 'luhfwlrq /dwfk :ulwh'3[ 5hdg'3[ 3ruw2xwsxw /dwfk :ulwh3[ 5hdg3[ ,qwhuqdo%xv 08;   08;   $owhuqdwh 'dwd 2xwsxw 08;   3 ,qsxw /dwfk &orfn 3[ [  $owhuqdwh )xqfwlrq (qdeoh   3 08; 08;   3 2xwsxw %xiihu d  \  &$1&kdqqho ]  d  e  &$1 \5[' ;3(5&21d ;3(5&21e &$1\(1 &$1](1 ("1($'5
parallel ports st10f280 120/239 doc id 8673 rev. 3 figure 41. block diagram of p4.6 and p4.7 pins 12.7 port 5 this 16-bit input port can only read data. there is no output latch and no direction register. data written to p5 will be lost. 08;    2shq'udlq /dwfk :ulwh2'3[ 5hdg2'3[ 'luhfwlrq /dwfk :ulwh'3[ 5hdg'3[ ,qwhuqdo%xv 08;   ,qsxw /dwfk &orfn 3[ 2xwsxw %xiihu 3ruw2xwsxw /dwfk 5hdg3[ :ulwh3[ $owhuqdwh 'dwd 2xwsxw 08;   08;    08; $owhuqdwh )xqfwlrq (qdeoh 08;    08; 08;    08;   08; d  &$1\7[' ;3(5&21d &$1\(1 ;3(5&21e &$1](1 'dwdrxwsxw [  \  &$1&kdqqho ]  d  e  ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 121/239 p5 address: 0xffa2h / d1h sfr reset: 0xxxxxh type: r 12.7.1 alternate f unctions of port 5 each line of port 5 is also connected to one of the multiplexer of the analog/digital converter. all port lines (p5.15...p5.0) can accept analog signals (an15...an0) that can be converted by the adc. no special programming is required for pins that shall be used as analog inputs. some pins of port 5 also serve as external timer control lines for gpt1 and gpt2. the table below summarizes the alternate functions of port 5. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p5.15 p5.14 p5.13 p5.12 p5.11 p5.10 p5.9 p5.8 p5.7 p5.6 p5.5 p5.4 p5.3 p5.2 p5.1 p5.0 rrrrrrrrrrrrrrrr p5.y port data register p5 bit y (read only) table 21. port 5 alternate functions port 5 pin alternate function a) alternate function b) p5.0 p5.1 p5.2 p5.3 p5.4 p5.5 p5.6 p5.7 p5.8 p5.9 p5.10 p5.11 p5.12 p5.13 p5.14 p5.15 analog input an0 analog input an1 analog input an2 analog input an3 analog input an4 analog input an5 analog input an6 analog input an7 analog input an8 analog input an9 analog input an10 analog input an11 analog input an12 analog input an13 analog input an14 analog input an15 - - - - - - - - - - t6eud timer 6 ext. up/down input t5eud timer 5 ext. up/down input t6in timer 6 count input t5in timer 5 count input t4eud timer 4 ext. up/down input t2eud timer 2 ext. up/down input
parallel ports st10f280 122/239 doc id 8673 rev. 3 figure 42. port 5 i/o and alternate functions port 5 pins have a special port structure (see figure 43 ), first because it is an input only port, and second because the analog input channels are directly connected to the pins rather than to the input latches. figure 43. block diagram of a port 5 pin 3ruw d q r l w f q x )  h w d q u h w o $ *hqhudo3xusrvh,qsxwv e $'&rqyhuwhu,qsxwv 7lphu,qsxwv 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 7(8' 7(8' 7,1 7,1 7(8' 7(8' ("1($'5 5hdg3ruw3\ ,qwhuqdo%xv ,qsxw /dwfk &38&orfn 3\$1\ 5hdg %xiihu wr6dpsoh+rog &lufxlw &kdqqho 6hohfw $qdorj 6zlwfk \  ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 123/239 port 5 schmitt trigger analog inputs a schmitt trigger protection can be activated on each pin of port 5 by setting the dedicated bit of register p5didis. p5didis address: 0xffa4h / d2h sfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 p5didis.15 p5didis.14 p5didis.13 p5didis.12 p5didis.11 p5didis.10 p5didis.9 p5didis.8 p5didis.7 p5didis.6 p5didis.5 p5didis.4 p5didis.3 p5didis.2 p5didis.1 p5didis.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w p5didis.y port 5 digital disablel register bit y p5didis.y = 0: port line p5.y digital input is enabled (schmitt trigger enabled) p5didis.y = 1: port line p5.y digital input is disabled (schmitt trigger disabled, necessary for input leakage current reduction)
parallel ports st10f280 124/239 doc id 8673 rev. 3 12.8 port 6 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp6. each port line can be switched into push/pull or open drain mode via the open drain control register odp6. p6 (ffcch / e6h) address: 0xffcch / e6h sfr reset: 0x--00h type: r/w dp6 address: 0xffceh / e7h sfr reset: 0x--00h type: r/w odp6 address: 0xf1ceh / e7h esfr reset: 0x--00h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p6.7 p6.6 p6.5 p6.4 p6.3 p6.2 p6.1 p6.0 r/w r/w r/w r/w r/w r/w r/w r/w p6.y port data register p6 bit y 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------dp6.7dp6.6dp6.5dp6.4dp6.3dp6.2dp6.1dp6.0 r/w r/w r/w r/w r/w r/w r/w r/w dp6.y port direction register dp6 bit y dp6.y = 0: port line p6.y is an input (high-impedance) dp6.y = 1: port line p6.y is an output 1514131211109876543210 -------- odp6.7 odp6.6 odp6.5 odp6.4 odp6.3 odp6.2 odp6.1 odp6.0 r/w r/w r/w r/w r/w r/w r/w r/w odp6.y port 6 open drain control register bit y odp6.y = 0: port line p6.y output driver in push/pull mode odp6.y = 1: port line p6.y output driver in open drain mode
st10f280 parallel ports doc id 8673 rev. 3 125/239 12.8.1 alternate f unctions of port 6 a programmable number of chip select signals (cs4...cs0) derived from the bus control registers (buscon4...buscon0) can be output on the 5 pins of port 6. the number of chip select signals is selected via port0 during reset. the selected value can be read from bitfield cssel in register rp0h (read only) e.g. in order to check the configuration during run time. the table below summarizes the alternate functions of port 6 depending on the number of selected chip select lines (coded via bitfield cssel). figure 44. port 6 i/o and alternate functions the chip select lines of port 6 have an internal weak pull-up device. this device is switched on during reset. this feature is implemented to drive the chip select lines high during reset in order to avoid multiple chip selection. after reset the cs function must be used, if selected so. in this case there is no possibility to program any port latches before. thus the alternate function (cs ) is selected automatically in this case. note: the open drain output option can only be selected via software earliest during the initialization routine; at least signal cs0 will be in push/pull output driver mode directly after reset. table 22. port 6 alternate functions port 6 pin altern. function cssel = 10 altern. function cssel = 01 altern. function cssel = 00 altern. function cssel = 11 p6.0 p6.1 p6.2 p6.3 p6.4 general purpose i/o general purpose i/o general purpose i/o general purpose i/o general purpose i/o chip select cs0 chip select cs1 gen. purpose i/o gen. purpose i/o gen. purpose i/o chip select cs0 chip select cs1 chip select cs2 gen. purpose i/o gen. purpose i/o chip select cs0 chip select cs1 chip select cs2 chip select cs3 chip select cs4 p6.5 p6.6 p6.7 hold external hold request input hlda hold acknowledge output breq bus request output 3ruw d q r l w f q x )  h w d q u h w o $ *hqhudo3xusrvh,qsxw2xwsxw 3 3 3 3 3 3 3 3 %5(4 +/'$ +2/' &6 &6 &6 &6 &6 ("1($'5
parallel ports st10f280 126/239 doc id 8673 rev. 3 figure 45. block diagram of port 6 pins with an alternate output function note: * p6.5 has only alternate input function. 08;    2shq'udlq /dwfk :ulwh2'3\ 5hdg2'3\ 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ ,qwhuqdo%xv 08;   ,qsxw /dwfk &38&orfn 3\ 2xwsxw %xiihu 3ruw2xwsxw /d wfk 5hdg3\ :ulwh3\ $owhuqdwh 'dwd 2xwsxw 08;   08;    08; $owhuqdwh )xqfwlrq (qdeoh \   ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 127/239 12.9 port 7 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp7. each port line can be switched into push/pull or open drain mode via the open drain control register odp7. p7 address: 0xffd0h / e8h sfr reset: 0x--00h type: r/w dp7 address: 0xffd2h / e9h sfr reset: 0x--00h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p7.7 p7.6 p7.5 p7.4 p7.3 p7.2 p7.1 p7.0 r/w r/w r/w r/w r/w r/w r/w r/w p7.y port data register p7 bit y 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------dp7.7dp7.6dp7.5dp7.4dp7.3dp7.2dp7.1dp7.0 r/w r/w r/w r/w r/w r/w r/w r/w dp7.y port direction register dp7 bit y dp7.y = 0: port line p7.y is an input (high impedance) dp7.y = 1: port line p7.y is an output
parallel ports st10f280 128/239 doc id 8673 rev. 3 odp7 address: 0xf1d2h / e9h esfr reset: 0x--00h type: r/w 12.9.1 alternate f unctions of port 7 the upper 4 lines of port 7 (p7.7...p7.4) serve as capture inputs or compare outputs (cc31io...cc28io) for the capcom2 unit. the usage of the port lines by the capcom unit, its accessibility via software and the precautions are the same as described for the port 2 lines. as all other capture inputs, the capture input function of pins p7.7...p7.4 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). the lower 4 lines of port 7 (p7.3...p7.0) serve as outputs from the pwm module (pout3...pout0). at these pins the value of the respective port output latch is xored with the value of the pwm output rather than anded, as the other pins do. this allows to use the alternate output value either as it is (port latch holds a ?0?) or invert its level at the pin (port latch holds a ?1?). note that the pwm outputs must be enabled via the respective penx bits in pwmcon1. the table below summarizes the alternate functions of port 7. 1514131211109876543210 - - - - - - - - odp7.7 odp7.6 odp7.5 odp7.4 odp7.3 odp7.2 odp7.1 odp7.0 r/w r/w r/w r/w r/w r/w r/w r/w odp7.y port 7 open drain control register bit y odp7.y = 0: port line p7.y output driver in push-pull mode odp7.y = 1: port line p7.y output driver in open drain mode table 23. port 7 alternate functions port 7 pin alternate function p7.0 p7.1 p7.2 p7.3 p7.4 p7.5 p7.6 p7.7 pout0 pwm mode channel 0 output pout1 pwm mode channel 1 output pout2 pwm mode channel 2 output pout3 pwm mode channel 3 output cc28io capture input / compare output channel 28 cc29io capture input / compare output channel 29 cc30io capture input / compare output channel 30 cc31io capture input / compare output channel 31
st10f280 parallel ports doc id 8673 rev. 3 129/239 figure 46. port 7 i/o and alternate functions the port structures of port 7 differ in the way the output latches are connected to the internal bus and to the pin driver (see the two figure 47 ). pins p7.3...p7.0 (pout3...pout0) xor the alternate data output with the port latch output, which allows to use the alternate data directly or inverted at the pin driver. figure 47. block diagram of port 7 pins p7.3...p7.0 3ruw $owhuqdwh)xqfwlrq *hqhudo3xusrvh,qsxw2xwsxw 3 3 3 3 3 3 3 3 &&,2 &&,2 &&,2 &&,2 3287 3287 3287 3287 ("1($'5 2shq'udlq /d wfk :ulwh2'3\ 5hdg2'3\ 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ ,qwhuqdo%xv 08;   ,qsxw /d wfk &38&orfn 3\3287\ 2xwsxw %xiihu 3ruw2xwsxw /dwfk 5hdg3\  3ruw'dwd 2xwsxw (;25 $owhuqdwh 'dwd 2xwsxw :ulwh3\ \  ("1($'5
parallel ports st10f280 130/239 doc id 8673 rev. 3 figure 48. block diagram of port 7 pins p7.7...p7.4 2shq'udlq /dwfk :ulwh2'3\ 5hdg2'3\ 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ ,qwhuqdo%xv 08;   $owhuqdwh/dwfk 'dwd,qsxw ,qsxw /dwfk &orfn 3\ &&],2 2xwsxw %xiihu $owhuqdwh 'dwd 2xwsxw 08 ;   2xwsxw /dwfk t  :ulwh3ruw3\ &rpsduh7uljjhu 5hdg3\ \   ]   $owhuqdwh3lq 'dwd,qsxw ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 131/239 12.10 port 8 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp8. each port line can be switched into push/pull or open drain mode via the open drain control register odp8. p8 address: 0xffd40h / eah sfr reset: 0x--00h type: r/w dp8 address: 0xffd6h / ebh sfr reset: 0x--00h type: r/w odp8 address: 0xf1d6h / ebh esfr reset: 0x--00h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - p8.7 p8.6 p8.5 p8.4 p8.3 p8.2 p8.1 p8.0 r/w r/w r/w r/w r/w r/w r/w r/w p8.y port data register p8 bit y 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------dp8.7dp8.6dp8.5dp8.4dp8.3dp8.2dp8.1dp8.0 r/w r/w r/w r/w r/w r/w r/w r/w dp8.y port direction register dp8 bit y dp8.y = 0: port line p8.y is an input (high impedance) dp8.y = 1: port line p8.y is an output 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - odp8.7 odp8.6 odp8.5 odp8.4 odp8.3 odp8.2 odp8.1 odp8.0 r/w r/w r/w r/w r/w r/w r/w r/w odp8.y port 8 open drain control register bit y odp8.y = 0: port line p8.y output driver in push-pull mode odp8.y = 1: port line p8.y output driver in open drain mode
parallel ports st10f280 132/239 doc id 8673 rev. 3 12.10.1 alternate f unctions of port 8 the 8 lines of port 8 (p8.7...p8.0) serve as capture inputs or compare outputs (cc23io...cc16io) for the capcom2 unit. the usage of the port lines by the capcom unit, its accessibility via software and the precautions are the same as described for the port 2 lines. as all other capture inputs, the capture input function of pins p8.7...p8.0 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). the ta b l e 2 4 summarizes the alternate functions of port 8. figure 49. port 8 i/o and alternate functions the port structures of port 8 differ in the way the output latches are connected to the internal bus and to the pin driver (see the figure 50 ). pins p8.7...p8.0 (cc23io...cc16io) combine internal bus data and alternate data output before the port latch input, as do the port 2 pins. table 24. port 8 alternate functions port 7 alternate function p8.0 p8.1 p8.2 p8.3 p8.4 p8.5 p8.6 p8.7 cc16io capture input / compare output channel 16 cc17io capture input / compare output channel 17 cc18io capture input / compare output channel 18 cc19io capture input / compare output channel 19 cc20io capture input / compare output channel 20 cc21io capture input / compare output channel 21 cc22io capture input / compare output channel 22 cc23io capture input / compare output channel 23 3ruw $owhuqdwh)xqfwlrq *hqhudo3xusrvh,qsxw2xwsxw 3 3 3 3 3 3 3 3 &&,2 &&,2 &&,2 &&,2 &&,2 &&,2 &&,2 &&,2 ("1($'5
st10f280 parallel ports doc id 8673 rev. 3 133/239 figure 50. block diagram of port 8 pins p8.7...p8.0 2shq'udlq /dwfk :ulwh'3\ 5hdg'3\ 'luhfwlrq /dwfk :ulwh'3\ 5hdg'3\ ,qwhuqdo%xv 08;   $owhuqdwh/dwfk 'dwd,qsxw ,qsxw /dwfk &38&orfn 3\ &&],2 2xwsxw %xiihu $o whuqdwh 'dwd 2xwsxw 08;   2xwsxw /dwfk t  :ulwh3ruw3\ &rpsduh7uljjhu 5hdg3\ \   ]   $owhuqdwh3lq'dwd,qsxw ("1($'5
parallel ports st10f280 134/239 doc id 8673 rev. 3 12.11 xport 9 the xport9 is enabled by setting xpen bit 2 of the syscon register and xport9en bit 3 of the new xpercon register. on the xbus interface, the register are not bit-addressable this 16-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register xdp9. each port line can be switched into push/pull or open drain mode via the open drain control register xodp9. all port lines can be individually (bit-wise) programmed. the ?bit-addressable? feature is available via specific ?set? and ?clear? registers: xp9set, xp9clr, xdp9set, xdp9clr, xodp9set, xodp9clr. xp9 address: 0xc100h reset: 0x0000h type: r/w xp9set (c102h) address: 0xc102h reset: 0x0000h type: w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xp9.15 xp9.14 xp9.13 xp9.12 xp9.11 xp9.10 xp9.9 xp9.8 xp9.7 xp9.6 xp9.5 xp9.4 xp9.3 xp9.2 xp9.1 xp9.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w xp9.y port data register xp9 bit y 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xp9set.15 xp9set.14 xp9set.13 xp9set.12 xp9set.11 xp9set.10 xp9set.9 xp9set.8 xp9set.7 xp9set.6 xp9set.5 xp9set.4 xp9set.3 xp9set.2 xp9set.1 xp9set.0 wwwwwwwwwwwwwwww xp9set.y writing a ?1? will set the corresponding bit in xp9 register, writing a ?0? has no effect.
st10f280 parallel ports doc id 8673 rev. 3 135/239 xp9clr address: 0xc104h reset: 0x0000h type: w xdp9 address: 0xc200h reset: 0x0000h type: r/w xdp9set address: 0xc202h reset: 0x0000h type: w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xp9clr.15 xp9clr.14 xp9clr.13 xp9clr.12 xp9clr.11 xp9clr.10 xp9clr.9 xp9clr.8 xp9clr.7 xp9clr.6 xp9clr.5 xp9clr.4 xp9clr.3 xp9clr.2 xp9clr.1 xp9clr.0 wwwwwwwwwwwwwwww xp9clr.y writing a ?1? will clear the corresponding bit in xp9 register, writing a ?0? has no effect. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xdp9.15 xdp9.14 xdp9.13 xdp9.12 xdp9.11 xdp9.10 xdp9.9 xdp9.8 xdp9.7 xdp9.6 xdp9.5 xdp9.4 xdp9.3 xdp9.2 xdp9.1 xdp9.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w xdp9.y port direction register xdp9 bit y xdp9.y = 0: port line xp9.y is an input (high-impedance) xdp9.y = 1: port linex p9.y is an output 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xdp9 set.15 xdp9 set.14 xdp9 set.13 xdp9 set.12 xdp9 set.11 xdp9 set.10 xdp9 set.9 xdp9 set.8 xdp9 set.7 xdp9 set.6 xdp9 set.5 xdp9 set.4 xdp9 set.3 xdp9 set.2 xdp9 set.1 xdp9 set.0 wwwwwwwwwwwwwwww xdp9set.y writing a ?1? will set the corresponding bit in xdp9 register, writing a ?0? has no effect.
parallel ports st10f280 136/239 doc id 8673 rev. 3 xdp9clr address: 0xc204h reset: 0x0000h type: w xodp9 address: 0xc300h reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xdp9 clr.15 xdp9 clr.14 xdp9 clr.13 xdp9 clr.12 xdp9 clr.11 xdp9 clr.10 xdp9 clr.9 xdp9 clr.8 xdp9 clr.7 xdp9 clr.6 xdp9 clr.5 xdp9 clr.4 xdp9 clr.3 xdp9 clr.2 xdp9 clr.1 xdp9 clr.0 wwwwwwwwwwwwwwww xdp9clr.y writing a ?1? will clear the corresponding bit in xdp9 register, writing a ?0? has no effect. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xodp9 .15 xodp9 .14 xodp9 .13 xodp9 .12 xodp9 .11 xodp9 .10 xodp9 .9 xodp9 .8 xodp9 .7 xodp9 .6 xodp9 .5 xodp9 .4 xodp9 .3 xodp 9.2 xodp9 .1 xodp9 .0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w xodp9.y port 9 open drain control register bit y xodp9.y = 0: port line xp9.y output driver in push/pull mode xodp9.y = 1: port line xp9.y output driver in open drain mode
st10f280 parallel ports doc id 8673 rev. 3 137/239 xodp9set (c302h) address: 0xc302h reset: 0x0000h type: w xodp9clr address: 0xc304h reset: 0x0000h type: w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xodp9set.15 xodp9set.14 xodp9set.13 xodp9set.12 xodp9set.11 xodp9set.10 xodp9set.9 xodp9set.8 xodp9set.7 xodp9set.6 xodp9set.5 xodp9set.4 xodp9set.3 xodp9set.2 xodp9set.1 xodp9set.0 wwwwwwwwwwwwwwww xodp9set.y writing a ?1? will set the corresponding bit in xodp9 register, writing a ?0? has no effect. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xodp9clr.15 xodp9clr.14 xodp9clr.13 xodp9clr.12 xodp9clr.11 xodp9clr.10 xodp9clr.9 xodp9clr.8 xodp9clr.7 xodp9clr.6 xodp9clr.5 xodp9clr.4 xodp9clr.3 xodp9clr.2 xodp9clr.1 xodp9clr.0 wwwwwwwwwwwwwwww xodp9clr.y writing a ?1? will clear the corresponding bit in xodp9 register, writing a ?0? has no effect.
parallel ports st10f280 138/239 doc id 8673 rev. 3 12.12 xport 10 the xport10 is enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register. on the xbus interface, the register are not bit-addressable. this 16-bit input port can only read data. there is no output latch and no direction register. data written to xp10 will be lost. xp10 address: 0xc380h reset: 0xxxxxh type: r 12.12.1 alternate f unctions of xport 10 each line of xport 10 is also connected to one of the multiplexer of the analog/digital converter. all port lines (xp10.15...xp10.0) can accept analog signals (an31...an16) that can be converted by the adc. no special programming is required for pins that shall be used as analog inputs. the ta b l e 2 5 summarizes the alternate functions of xport 10. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xp10 .15 xp10 .14 xp10 .13 xp10 .12 xp10 .11 xp10 .10 xp10 .9 xp10 .8 xp10 .7 xp10 .6 xp10 .5 xp10 .4 xp10 .3 xp10 .2 xp10 .1 xp10 .0 rrrrrrrrrrrrrrrr xp10.y port data register xp10 bit y (read only) table 25. xport 10 alternate functions xport 10 pin alternate function p10.0 p10.1 p10.2 p10.3 p10.4 p10.5 p10.6 p10.7 p10.8 p10.9 p10.10 p10.11 p10.12 p10.13 p10.14 p10.15 analog input an16 analog input an17 analog input an18 analog input an19 analog input an20 analog input an21 analog input an22 analog input an23 analog input an24 analog input an25 analog input an26 analog input an27 analog input an28 analog input an29 analog input an30 analog input an31
st10f280 parallel ports doc id 8673 rev. 3 139/239 figure 51. port10 i/o and alternate functions 12.12.2 new disturb protection on analog inputs a new register is provided for additional disturb protection support on analog inputs for port xp10: xp10didis address: 0xc382h reset: 0x0000h type: r/w $'&rqyhuwhu,qsxw $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 ;3ruw $owhuqdwh)xqfwlrq *hqhudo3xusrvh,qsxw ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ;3 ("1($'5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xp10didis .15 xp10didis .14 xp10didis .13 xp10didis .12 xp10didis .11 xp10didis .10 xp10didis.9 xp10didis.8 xp10didis.7 xp10didis.6 xp10didis.5 xp10didis.4 xp10didis.3 xp10didis.2 xp10didis.1 xp10didis.0 r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w xp10didis.y xport 10 digital disable register bit y 0: port line xp10.y digital input is enabled (schmitt trigger enabled) 1: port line xp10.y digital input is disabled (schmitt trigger disabled, necessary for input leakage current reduction)
a/d converter st10f280 140/239 doc id 8673 rev. 3 13 a/d converter 13.1 a/d converter module a 10-bit a/d converter with 2 x 16 multiplexed input channels and a sample and hold circuit is integrated on-chip. this a/d converter does not have the self-calibration feature. thus, guaranteed total unadjusted error is + 2 lsb. refer to section 20.3.1: a/d converter characteristics for detailled characteristics. the sample time (for loading the capacitors) and the conversion time is programmable and can be adjusted to the external circuitry. convertion time is fully equivalent to the one of previous generation a/d self-calibrated converter. to remove high frequency components from the analog input signal, a low-pass filter must be connected at the adc input. overrun error detection/protection is controlled by the addat register. either an interrupt request is generated when the result of a previous conversion has not been read from the result register at the time the next conversion is complete, or the next conversion is suspended until the previous result has been read. for applications which require less than 16 analog input channels, the remaining channel inputs can be used as digital input port pins. the a/d converter of the st10f280 supports four different conversion modes: single channel conversion mode the analog level on a specified channel is sampled once and converted to a digital result. single channel continuous mode the analog level on a specified channel is repeatedly sampled and converted without software intervention. auto scan mode the analog levels on a pre-specified number of channels are sequentially sampled and converted. auto scan continuous mode the number of pre-specified channels is repeatedly sampled and converted. channel injection mode injects a channel into a running sequence without disturbing this sequence. the peripheral event controller stores the conversion results in memory without entering and exiting interrupt routines for each data transfer. 13.2 multiplexage of two blocks of 16 analog inputs the adc can manage 16 analog inputs, so to increase its capability, a new xadcmux register is added to control the multiplexage between the first block of 16 channels on port5 and the second block of 16 channels on xport10. the conversion result register stays identical and only a software management can determine the block in use.
st10f280 a/d converter doc id 8673 rev. 3 141/239 figure 52. block diagram the xadcmux register is enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register xadcmux address: 0xc384h reset: 0x0000h type: r/w 13.3 xtimer peripheral (tri gger for adc channel injection) this new peripheral is dedicated for the channel injection mode of the a/d converter. this mode injects a channel into a running sequence without disturbing this sequence. the peripheral event controller stores the conversion results in memory without entering and exiting interrupt routines for each data transfer. a channel injection can be triggered by an event on capture/compare cc31 (port p7.7) of the capcom2 unit. the dedicated output xadcinj of the xtimer must be connected externally on the input p7.7/cc31. 151413121110987654321 0 ---------------xadcmux r/w \  ,qsxw odwfk ,qsxw odwfk $'& 5hdg3ruw3\ 5hdg3ruw;3\ &kdqqho6hohfw ;$'&08;   &38forfn &38forfn 3\ ;3\   ;%86 ,qwhuqdo%xv ("1($'5 xadcmux.0 0: default configuration,analog inputs on port p5.y can be converted 1: analog inputs on port xp10.y can be converted
a/d converter st10f280 142/239 doc id 8673 rev. 3 due to the multiplexed inputs, at a time, the adc exclusively converts the port5 inputs or the xport10 inputs. if one "y" channel has to be used continuously in injection mode, it must be externally hardware connected to the port5.y and xport10.y inputs. the xtimer peripheral is enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register. 13.3.1 main features the xtimer features are : 16 bits linear timer / 4 bits exponential prescaler counting between 16 bits ?start value? and 16 bits ?end value? counting period between 4 cycles and 2**33 cycles (100 ns and 214s using 40mhz cpu clock) 1 trigger ouput (xadcinj) programmable functions : ? internal clock xclk is derivated from the cpu clock and has the same period ? up counting / down counting ? reload enable ? continue / stop modes 4 memory mapped registers : ? control / prescaler ? start value ?end value ? current value table 26. the different counting modes tle tcs tcvr(n) = tevr tud ten tcvr(n+1) comments xx x x 0 tcvr(n) timer disable x0 1 x 1 stop xx 0 0 tcvr(n)-1 decrement 0 1 1 decrement (continue) xx 0 1 tcvr(n)+1 increment 0 1 1 increment (continue) 1 1 1 x tsvr load
st10f280 a/d converter doc id 8673 rev. 3 143/239 13.3.2 register description tcr: timer control register xtcr address: 0xc000h reset: 0x0000h type: r, r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 000000 tfp[3:0] tcmtietcstletudten r r r r r r rw rw rw rw rw rw rw ten timer enable when ten = ?0?, the timer is disabled (reset value). to avoid glitches, it is recommended to modify tcr in 2 steps, first with new values and and second by setting ten. tud timer up / down counting when tud = ?0?, the timer is counting "down" (reset value), ie the tcvr (?current value?) register content is decremented. when tud = ?1?, the timer is counting "up", ie the tcvr (?current value?) register content is incremented. tle timer load enable when the counter has reached its end value (tcvr = tevr), tcvr is (re)loaded with tsvr (?start value?) register content when tle = ?1?. when tle = ?0? (reset value), the next state of tcvr depends on tcs bit. tcs timer continue / stop when tle = ?0? (no load) and when the counter has reached its end value (tcvr = tevr), the tcvr content continues to increment / decrement according to tud bit when tcs = ?1? (continue mode). when tcs = ?0? (stop mode reset value), tcvr is stopped and its content is frozen. tie timer output enable when the counter has reached its end value (tcvr = tevr), the xadcinj output is set when tie = ?1?. when tie = ?0? (reset value), xadcinj output is disabled (= ?0?). tcm timer clock mode must be cleared tcm = ?0? (reset value), the tcvr clock is derived from internal xclk clock according to tfp bits. tfp[3:0] timer frequency prescaler when tcm = ?0? (internal clock), the tcvr register clock is derived from the xclk clock input by dividing xclk by 2**(2+ tfp). the coding is as follows : 0000 : prescaler by 2 (reset value), xclk divided by 4 0001 : prescaler by 4, xclk divided by 8 0010 : prescaler by 8, xclk divided by 16 ... 1111 : prescaler by 2**16, xclk divided by 2**17
a/d converter st10f280 144/239 doc id 8673 rev. 3 xtsvr : timer start value register address: 0xc002h reset: 0x0000h type: r/w xtevr : timer end value register address: 0xc004h reset: 0x0000h type: r/w xtcvr : timer current value register address: 0xc006h reset: 0x0000h type: r 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 tsvr rw tsvr[15:0] timer start value tsvr contains the data to be transferred to the tcvr ?current value? register when : ? ten = ?1? (tim enable), tle = ?1? (tim load enable), tcvr = tevr (count period finished), tcs = ?1? (stop mode disabled). ? first counting clock rising edge after the timer start (the timer starts on ten rising edge). 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 tevr rw tevr[15:0] timer end value tevr contains the data to be compared to the tcvr ?current value? register. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 tcvr r tcvr[15:0] timer current value tcvr contains the current counting value. when tcvr = tevr, tcvr content is changed according to table . the tcvr clock is derived from internal xclk clock according to tfp bits when tcm = ?0?.
st10f280 a/d converter doc id 8673 rev. 3 145/239 registers mapping 13.3.3 block diagram figure 53. xtimer block diagram clocks the xtcvr register clock is the prescaler output. the prescaler allows to divide the basic register frequency in order to offer a wide range of counting period, from 2**2 to 2**33 cycles (note that 1 cycle = 1 xclk periods). table 27. timer registers mapping address (hexa) register name reset value (hexa) access c000h xtcr : control 0000h rw c002h xtsvr : start value 0000h rw c004h xtevr : end value 0000h rw c006h xtcvr : current value 0000h r ;7&5 ;7695 ;7&95 3uhvfdolqj ;7(95 fwo fwo fwo fwo glii ;&/.   7lphurxwsxw '$7$ ;$'&,1- ("1($'5
a/d converter st10f280 146/239 doc id 8673 rev. 3 registers the xtcvr register input is linked to several sources: xtsvr register (start value) for reload when the period is finished, or for load when the timer is starting. incrementer output when the ?up? mode is selected, decrementer output when the ?down? mode is selected. the selection between the sources is made through the xtcr control register. when starting the timer, by setting ten bit of tcr to ?1?, xtcvr will be loaded with xtsvr value on the first rising edge of the counting clock. that?s to say that for counting from 0000h to 0009h for example, 10 counting clock rising edges are required. the xtcvr register output is continuously compared to the xtevr register to detect the end of the counting period. when the registers are equal, several actions are made depending on the xtcr control register content : the output xadcinj is conditionally generated, xtcvr is loaded with xtsvr or stops or continues to count (see table ). xtevr, xtsvr and all tcr bits except ten must not be modified while the timer is counting, ie while ten bit of tcr = ?1?. the timer behaviour is not guaranteed if this rule is not respected. it implies that the timer can be configured only when stopped (ten = ?0?). when programming the timer, xtevr, xtsvr and xtcr bits except ten can be modified, with ten = ?0?; then the timer is started by modifying only ten bit of tcr. to stop the timer, only ten bit should be modified, from ?1? to ?0?. timer output (xadcinj) the xadcinj output is the result of the (xtcvr = xtevr) flag after differentiation. the duration of the output lasts two cycles (50ns at 40mhz). figure 54. xadcinj timer output ;$'&,1- 7&/ qv ;&/. ("1($'5
st10f280 a/d converter doc id 8673 rev. 3 147/239 figure 55. external connection for adc channel injection ,qsxw /dwfk ;7,0(5 &orfn 3&& ;$'&,1- &$3&20 2xwsxw wuljjhu iru$'& 81,7 fkdqqho lqmhfwlrq ("1($'5
serial channels st10f280 148/239 doc id 8673 rev. 3 14 serial channels serial communication with other microcontrollers, microprocessors, terminals or external peripheral components is provided by two serial interfaces: the asynchronous / synchronous serial channel (asco) and the high-speed synchronous serial channel (ssc). two dedicated baud rate generators set up all standard baud rates without the requirement of oscillator tuning. for transmission, reception and erroneous reception, 3 separate interrupt vectors are provided for each serial channel. 14.1 asynchronous / synchronous serial interface (asco) the asynchronous / synchronous serial interface (asco) provides serial communication between the st10f280 and other microcontrollers, microprocessors or external peripherals. a set of registers is used to configure and to control the asco serial interface: p3, dp3, odp3 for pin configuration sobg for baud rate generator sotbuf for transmit buffer sotic for transmit interrupt control sotbic for transmit buffer interrupt control socon for control sorbuf for receive buffer (read only) soric for receive interrupt control soeic for error interrupt control
st10f280 serial channels doc id 8673 rev. 3 149/239 14.1.1 asco in asynchronous mode in asynchronous mode, 8 or 9-bit data transfer, parity generation and the number of stop bit can be selected. parity framing and overrun error detection is provided to increase the reliability of data transfers. transmission and reception of data is double-buffered. full- duplex communication up to 1.25m bauds (at 40mhz of f cpu ) is supported in this mode. figure 56. asynchronous mode of serial channel asc0 asynchronous mode baud rates for asynchronous operation, the baud rate generator provides a clock with 16 times the rate of the established baud rate. every received bit is sampled at the 7th, 8th and 9th cycle of this clock. the baud rate for asynchronous operation of serial channel asc0 and the required reload value for a given baud rate can be determined by the following formulas: (s0brl) represents the content of the reload register, taken as unsigned 13 bit integer, (s0brs) represents the value of bit s0brs (?0? or ?1?), taken as integer. 3lq  &38 &orfn 65 %dxg5dwh7lphu 5hordg5hjlvwhu  &orfn 6huldo3ruw&rqwuro 6kliw&orfn 60 6673 6)( 62( 63( 65(1 6)(1 63(1 62(1 6/% 65,5 67,5 6(,5 5hfhlyh,qwhuuxsw 5htxhvw 7udqvplw,qwhuuxsw 5htxhvw (uuru,qwhuuxsw 5htxhvw 7udqvplw6kliw 5hjlvwhu 5hfhlyh6kliw 5hjlvwhu 7udqvplw%xiihu 5hjlvwhu67%8) 5hfhlyh%xiihu 5hjlvwhu65%8) 6dpsolqj 08;   3lq ,qsxw ,qwhuqdo%xv 5['3 2xwsxw 7['3 ("1($'5 b async = f cpu 16 x [2 + (s0brs)] x [(s0brl) + 1] s0brl = ( f cpu 16 x [2 + (s0brs)] x b async ) 1
serial channels st10f280 150/239 doc id 8673 rev. 3 using the above equation, the maximum baud rate can be calculated for any given clock speed. baud rate versus reload register value (sobrs=0 and sobrs=1) is described in ta b l e 2 8 . note: the deviation errors given in the ta b l e 2 8 are rounded. to avoid deviation errors use a baud rate crystal (providing a multiple of the asc0/ssc sampling frequency). table 28. commonly used baud rates by reload value and deviation errors s0brs = ?0?, f cpu = 40mhz s0brs = ?1?, f cpu = 40mhz baud rate (baud) deviation error reload value (hexa) baud rate (baud) deviation error reload value (hexa) 1 250 000 0.0% / 0.0% 0000 / 0000 833 333 0.0% / 0.0% 0000 / 0000 112 000 +1.5% /7.0% 000a / 000b 112 000 +6.3% /7.0% 0006 / 0007 56 000 +1.5% /3.0% 0015 / 0016 56 000 +6.3% /0.8% 000d / 000e 38 400 +1.7% /1.4% 001f / 0020 38 400 +3.3% /1.4% 0014 / 0015 19 200 +0.2% /1.4% 0040 / 0041 19 200 +0.9% /1.4% 002a / 002b 9 600 +0.2% /0.6% 0081 / 0082 9 600 +0.9% /0.2% 0055 / 0056 4 800 +0.2% /0.2% 0103 / 0104 4 800 +0.4% /0.2% 00ac / 00ad 2 400 +0.2% /0.0% 0207 / 0208 2 400 +0.1% /0.2% 015a / 015b 1 200 0.1% / 0.0% 0410 / 0411 1 200 +0.1% /0.1% 02b5 / 02b6 600 0.0% / 0.0% 0822 / 0823 600 +0.1% /0.0% 056b / 056c 300 0.0% / 0.0% 1045 / 1046 300 0.0% / 0.0% 0ad8 / 0ad9 153 0.0% / 0.0% 1fe8 / 1fe9 102 0.0% / 0.0% 1fe8 / 1fe9
st10f280 serial channels doc id 8673 rev. 3 151/239 14.1.2 asco in synchronous mode in synchronous mode, data are transmitted or received synchronously to a shift clock which is generated by the st10f280. half-duplex communication up to 5m baud (at 40mhz of f cpu ) is possible in this mode. figure 57. synchronous mode of serial channel asc0 synchronous mode baud rates for synchronous operation, the baud rate generator provides a clock with 4 times the rate of the established baud rate. the baud rate for synchronous operation of serial channel asc0 can be determined by the following formula: (s0brl) represents the content of the reload register, taken as unsigned 13 bit integers, (s0brs) represents the value of bit s0brs (?0? or ?1?), taken as integer.  &38 &orfn 65 %dxg5dwh7lphu 5hordg5hjlvwhu  &orfn 6huldo3ruw&rqwuro 6kliw&orfn 60 % 62( 65(1 62(1 6/% 65,5 67,5 6(,5 5hfhlyh,qwhuuxsw 5htxhvw 7udqvplw,qwhuuxsw 5htxhvw (uuru,qwhuuxsw 5htxhvw 7udqvplw6kliw 5hjlvwhu 5hfhlyh6kliw 5hjlvwhu 7udqvplw%xiihu 5hjlvwhu67%8) 5hfhlyh%xiihu 5hjlvwhu65%8) 08;   3lq ,qwhuqdo%xv 5hfhlyh 2xwsxw 7udqvplw 3lq ,qsxw2xwsxw 7'[3 5[' 3 ("1($'5 b sync = s0brl = ( f cpu 4 x [2 + (s0brs)] x b sync ) 1 f cpu 4 x [2 + (s0brs)] x [(s0brl) + 1]
serial channels st10f280 152/239 doc id 8673 rev. 3 using the above equation, the maximum baud rate can be calculated for any clock speed as given in ta bl e 2 9 . note: the deviation errors given in the ta b l e 2 9 are rounded. to avoid deviation errors use a baud rate crystal (providing a multiple of the asc0/ssc sampling frequency) 14.2 high speed synchronous serial channel (ssc) the high-speed synchronous serial interface ssc provides flexible high-speed serial communication between the st10f280 and other microcontrollers, microprocessors or external peripherals. the ssc supports full-duplex and half-duplex synchronous communication. the serial clock signal can be generated by the ssc itself (master mode) or be received from an external master (slave mode). data width, shift direction, clock polarity and phase are programmable. this allows communication with spi-compatible devices. transmission and reception of data is double-buffered. a 16-bit baud rate generator provides the ssc with a separate serial clock signal. the serial channel ssc has its own dedicated 16-bit baud rate generator with 16-bit reload capability, allowing baud rate generation independent from the timers. table 29. commonly used baud rates by reload value and deviation errors s0brs = ?0?, f cpu = 40mhz s0brs = ?1?, f cpu = 40mhz baud rate (baud) deviation error reload value (hexa) baud rate (baud) deviation error reload value (hexa) 5 000 000 0.0% / 0.0% 0000 / 0000 3 333 333 0.0% / 0.0% 0000 / 0000 112 000 +1.5% /0.8% 002b / 002c 112 000 +2.6% /0.8% 001c / 001d 56 000 +0.3% /0.8% 0058 / 0059 56 000 +0.9% /0.8% 003a / 003b 38 400 +0.2% /0.6% 0081 / 0082 38 400 +0.9% /0.2% 0055 / 0056 19 200 +0.2% /0.2% 0103 / 0104 19 200 +0.4% /0.2% 00ac / 00ad 9 600 +0.2% /0.0% 0207 / 0208 9 600 +0.1% /0.2% 015a / 015b 4 800 +0.1% /0.0% 0410 / 0411 4 800 +0.1% /0.1% 02b5 / 02b6 2 400 0.0% / 0.0% 0822 / 0823 2 400 +0.1% /0.0% 056b / 056c 1 200 0.0% / 0.0% 1045 / 1046 1 200 0.0% / 0.0% 0ad8 / 0ad9 900 0.0% / 0.0% 15b2 / 15b3 600 0.0% / 0.0% 15b2 / 15b3 612 0.0% / 0.0% 1fe8 / 1fe9 407 0.0% / 0.0% 1ffd / 1ffe
st10f280 serial channels doc id 8673 rev. 3 153/239 figure 58. synchronous serial channel ssc block diagram 14.2.1 baud rate generation the baud rate generator is clocked by f cpu /2. the timer is counting downwards and can be started or stopped through the global enable bit sscen in register ssccon. register sscbr is the dual-function baud rate generator/reload register. reading sscbr, while the ssc is enabled, returns the content of the timer. reading sscbr, while the ssc is disabled, returns the programmed reload value. in this mode the desired reload value can be written to sscbr. note: never write to sscbr, while the ssc is enabled. the formulas below calculate the resulting baud rate for a given reload value and the required reload value for a given baud rate: (sscbr) represents the content of the reload register, taken as unsigned 16 bit integer. ta b l e 3 0 lists some possible baud rates against the required reload values and the resulting bit times for a 40mhz cpu clock. %dxg5dwh*hqhudwru 66&&rqwuro %orfn 3lq ,qwhuqdo%xv &orfn&rqwuro &38 &orfn 6odyh&orfn 0dvwhu&orfn 6&/. 6kliw &orfn 6wdwxv &rqwuro 5hfhlyh,qwhuuxsw5htxhvw 7udqvplw,qwhuuxsw5htxhvw (uuru,qwhuuxsw5htxhvw %lw6kliw5hjlvwhu 3lq &rqwuro 3lq 3lq 0765 0567 7udqvplw%xiihu 5hjlvwhu66&7% 5hfhlyh%xiihu 5hjlvwhu66&5% ("1($'5 baud rate ssc = f cpu 2 x [(sscbr) + 1] sscbr = ( f cpu 2 x baud rate ssc ) 1
serial channels st10f280 154/239 doc id 8673 rev. 3 table 30. synchronous baud rate and reload values baud rate bit time reload value reserved use a reload value > 0. --- --- 10m baud 100ns 0001h 5m baud 200ns 0003h 2.5m baud 400ns 0007h 1m baud 1 s 0013h 100k baud 10 s 00c7h 10k baud 100 s07cfh 1k baud 1ms 4e1fh 306 baud 3.26ms ff4eh
st10f280 can modules doc id 8673 rev. 3 155/239 15 can modules the two integrated can modules (can1 and can2) are identical and handle the completely autonomous transmission and reception of can frames in accordance with the can specification v2.0 part b (active) i.e. the on-chip can module can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. because of duplication of can controllers, the following adjustements are to be considered: the same internal register addresses both can controllers, but with the base addresses differing in address bit a8 and separate chip select for each can module. for address mapping, see chapter 4. the can1 transmit line (can1_txd) is the alternate function of the port p4.6 and the receive line (can1_rxd) is p4.5. the can2 transmit line (can2_txd) is the alternate function of the port p4.7 and the receive line (can2_rxd) is the alternate function of the port p4.4. interrupt of can2 is connected to the xbus interrupt line xp1 (can1 is on xp0). because of the new xpercon register, both can modules have to be selected, before the bit xpen is set in syscon register. after reset, the can1 is selected with the related control bit in the xpercon register. the can2 is not selected. 15.1 memory mapping 15.1.1 can1 address range 00?ef00h 00?efffh is reserved for the can1 module access. the can1 is enabled by setting bit 0 of the new xpercon register before setting xpen bit 2 of the syscon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. 15.1.2 can2 address range 00?ee00h 00?eeffh is reserved for the can2 module access. the can2 is enabled by setting xpen bit 2 of the syscon register and bit 1 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. note: if one or the two can modules are used, port 4 can not be programmed to output all 8 segment address lines. thus, only 4 segment address lines can be used, reducing the external memory space to 5m bytes (1m byte per cs line). 15.2 can bus configurations depending on application, can bus configuration may be one single bus with a single or multiple interfaces or a multiple bus with a single or multiple interfaces. the st10f280 is able to support these 2 cases.
can modules st10f280 156/239 doc id 8673 rev. 3 15.2.1 single can bus the single can bus multiple interfaces configuration may be implemented using 2 can transceives as shown in figure 55 . figure 59. single can bus multiple in terfaces - multiple transceivers the st10f280 also supports single can bus multiple (dual) interfaces using the open drain option of the canx_txd output as shown in figure 60 . thanks to the or-wired connection, only one transceiver is required. in this case the design of the application must take in account the wire length and the noise environment. figure 60. single can bus dual interfaces - single transceiver 15.2.2 multiple can bus the st10f280 provides 2 can interfaces to support the kind of bus configuration shown in figure 57 . &$1 5[' 7[' &$1 5[' 7[' &$1 7udqvfhlyhu &$1 7udqvfhlyhu &$1b+ &$1b+ &$1exv ("1($'5 &$1 5[' 7[' &$1 5[' 7[' &$1 7udqvfhlyhu &$1b+ &$1b+ &$1exv 2shqgudlqrxwsxw 9 n : ("1($'5
st10f280 can modules doc id 8673 rev. 3 157/239 figure 61. connection to two different can buses (e.g. for gateway application) 15.3 register and message object organization all registers and message objects of the can controller are located in the special can address area of 256 bytes, which is mapped into segment 0 and uses addresses 00?ee00h through 00?efffh. all registers are organized as 16 bit registers, located on word addresses. however, all registers may be accessed byte wise in order to select special actions without effecting other mechanisms. note: the address map shown in figure 58 lists the registers which are part of the can controller. there are also st10f280 specific registers that are associated with the can module. these registers, however, control the access to the can module rather than its function. &$1 5[' 7[' &$1 5[' 7[' &$1 7udqvfhlyhu &$1 7udqvfhlyhu &$1b+ &$1b+ &$1 &$1 exv exv ("1($'5
can modules st10f280 158/239 doc id 8673 rev. 3 figure 62. can module address map ()k((k ()k((k ()k((k ()k((k ()k((k ()&k((&k 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw 0hvvdjh2emhfw *hqhudo5hjlvwhuv &$1$gguhvv$uhd *hqhudo5hjlvwhuv ()k ()k ()k ()k ()k ()k ()k ()k ()k ()k ()$k ()%k ()&k ()'k ()(k ())k &rqwuro6wdwxv 5hjlvwhu ,qwhuuxsw 5hjlvwhu %lw7lplqj 5hjlvwhu *oredo0dvn 6kruw *oredo0dvn /rqj 0dvnri /dvw0hvvdjh ((k ((k ((k ((k ((k ((k ((k ((k ((k ((k (($k ((%k ((&k (('k (((k (()k &$1 &$1 ("1($'5
st10f280 can modules doc id 8673 rev. 3 159/239 control / status register address: 0xef00h / 0xee00h xreg reset: 0xxx01h type: r, r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 boff ewrn - rxok txok lec tst cce 0 0 eie sie ie init r r r/w r/w r/w r/w r/w r r r/w r/w r/w r/w init initialization 1: software initialization of the can controller. while init is set, all message transfers are stopped. setting init does not change the configuration registers and does not stop transmission or reception of a message in progress. the init bit is also set by hardware, following a busoff condition; the cpu then needs to reset init to start the bus recovery sequence. 0: disable software initialization of the can controller; on ini completion, the can waits for 11 consecutive recessive bit before taking part in bus activities. ie interrupt enable does not affect status updates. 1: global interrupt enable from can module. 0: global interrupt disable from can module. sie status change interrupt enable 1: enables interrupt generation when a message transfer (reception or transmision is successfully completed) or can bus error is detected and registered in lec is the status partition. 0: disable status change interrupt. eie error interrupt enable 1: enables interrupt generation on a change of bit boff or ewarn in the status partition. 0: disable error interrupt. cce configuration change enable 1: allows cpu access to the bit timing register 0: disables cpu access to the bit timing register tst test mode (bit 7) make sure that bit 7 is cleared when writing to the control register. writing a 1 during normal operation may lead erroneous device behaviour.
can modules st10f280 160/239 doc id 8673 rev. 3 note: reading the upper half of the control register (status partition) will clear the status change interrupt value in the interrupt register, if it is pending. use byte accesses to the lower half to avoid this. 15.4 can interrupt handling the on-chip can module has one interrupt output, which is connected (through a synchronization stage) to a standard interrupt node in the st10f280 in the same manner as all other interrupts of the standard on-chip peripherals. the control register for this interrupt is xp0ic (located at address f186h/c3h for can1 and f18eh/c7h for can2 in the esfr range). the associated interrupt vector is called xp0int at location 100h (trap number 40h) and xp1int at location 104h (trap number 41h). with this configuration, the user has all control options available for this interrupt, such as enabling/disabling, level and group priority, and interrupt or pec service (see note below). lec last error code this field holds a code which indicates the type of the last error occurred on the can bus. if a message has been transferred (reception or transmission) without error, this field will be cleared. code ?7? is unused and may be written by the cpu to check for updates. 0: no error 1: stuff error: more than 5 equal bit 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 controller transmitted was not acknowledged by another node 4: bit1error: during the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (?1?), but the monitored bus value was dominant 5: bit0error: during the transmission of a message (or acknowledge bit, active error flag, or overload flag), the device wanted to send a dominant level (?0?), but the monitored bus value was recessive . during busoff recovery this status is set each time a sequence of 11 recessive bit has been monitored. this enables the cpu to monitor the proceeding of the busoff recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). 6: crcerror: the crc check sum was incorrect in the message received. txok transmitted message successfully indicates that a message has been transmitted successfully (error free and acknowledged by at least one other node), since this bit was last reset by the cpu (the can controller does not reset this bit!). rxok received message successfully indicates that a message has been received successfully, since this bit was last reset by the cpu (the can controller does not reset this bit!). ewrn error warning status indicates that at least one of the error counters in the eml has reached the error warning limit of 96. boff busoff status indicates when the can controller is in busoff state (see eml).
st10f280 can modules doc id 8673 rev. 3 161/239 as for all other interrupts, the interrupt request flag xp0ir/xp1ir in register xp0ic/xp1ic is cleared automatically by hardware when this interrupt is serviced (either by standard interrupt or pec service). note: as a rule, can interrupt requests can be serviced by a pec channel. however, because pec channels only can execute single predefined data transfers (there are no conditional pec transfers), pec service can only be used, if the respective request is known to be generated by one specific source, and that no other interrupt request will be generated in between. in practice this seems to be a rare case. since an interrupt request of the can module can be generated due to different conditions, the appropriate can interrupt status register must be read in the service routine to determine the cause of the interrupt request. the interrupt identifier intid (a number) in the interrupt register indicates the cause of an interrupt. when no interrupt is pending, the identifier will have the value 00h. if the value in intid is not 00h, then there is an interrupt pending. if bit ie in the control register is set, also the interrupt line to the cpu is activated. the interrupt line remains active until either intid gets 00h (after the interrupt requester has been serviced) or until ie is reset (if interrupts are disabled). the interrupt with the lowest number has the highest priority. if a higher priority interrupt (lower number) occurs before the current interrupt is processed, intid is updated and the new interrupt overrides the last one. the ta bl e 3 1 lists the valid values for intid and their corresponding interrupt sources. interrupt register address: 0xef02h / 0xee02h xreg reset: 0x--xxh type: r 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 reserved intid r intid interrupt identifier this number indicates the cause of the interrupt. when no interrupt is pending, the value will be ?00?. table 31. intid values and corresponding interrupt sources intid cause of the interrupt 00 interrupt idle: there is no interrupt request pending. 01 status change interrupt: the can controller has updated (not necessarily changed) the status in the control register. this can refer to a change of the error status of the can controller (eie is set and boff or ewrn change) or to a can transfer incident (sie must be set), like reception or transmission of a message (rxok or txok is set) or the occurrence of a can bus error (lec is updated). the cpu may clear rxok, txok, and lec, however, writing to the status partition of the control register can never generate or reset an interrupt. to update the intid value the status partition of the control register must be read.
can modules st10f280 162/239 doc id 8673 rev. 3 15.4.1 bit timi ng configuration according to the can protocol specification, a bit time is subdivided into four segments: sync segment, propagation time segment, phase buffer segment 1 and phase buffer segment 2. each segment is a multiple of the time quantum t q with t q = ( brp + 1 ) x2 xt xclk the synchronization segment (sync seg) is always 1 t q long. the propagation time segment and the phase buffer segment1 (combined to tseg1) defines the time before the sample point, while phase buffer segment2 (tseg2) defines the time after the sample point. the length of these segments is programmable (except sync-seg). note: for exact definition of these segments please refer to the can specification. figure 63. bit timing definition 02 message 15 interrupt: bit intpnd in the message control register of message object 15 (last message) has been set. the last message object has the highest interrupt priority of all message objects. 1) (1) (2+n) message n interrupt: bit intpnd in the message control register of message object ?n? has been set (n = 1...14). (1)(2) 1. bit intpnd of the corresponding message object has to be cleared to give messages with a lower priority the possibility to update intid or to reset intid to 00h (idle state). 2. a message interrupt code is only displayed, if ther e is no other interrupt reques t with a higher priority. table 31. intid values and corresponding interrupt sources (continued) intid cause of the interrupt 6hj 76hj 76hj elwwlph wlphtxdqwxp vdpsohsrlqw wudqvplwsrlqw 6\qf 6hj 6\qf ("1($'5
st10f280 can modules doc id 8673 rev. 3 163/239 bit timing register address: 0xef04h / ee04h xreg reset: 0xuuuuh type: r, r/w note: this register can only be written, if the configuration change enable bit (cce) is set. 15.4.2 mask registers messages can use standard or extended identifiers. incoming frames are masked with their appropriate global masks. bit ide of the incoming message determines whether the standard 11 bit mask in global mask short or the 29 bit extended mask in global mask long is to be used. bit holding a ?0? mean ?don?t care?, so do not compare the message?s identifier in the respective bit position. the last message object (15) has an additional individually programmable acceptance mask (mask of last message) for the complete arbitration field. this allows classes of messages to be received in this object by masking some bits of the identifier. note: the mask of last message is anded with the global mask that corresponds to the incoming message. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 tseg2 tseg1 sjw brp r r/w r/w r/w r/w brp baud rate prescaler for generating the bit time quanta the cpu frequency is divided by 2 x (brp+1). sjw (re)synchronization jump width adjust the bit time by maximum (sjw+1) time quanta for re-synchronization. tseg1 time segment before sample point there are (tseg1+1) time quanta before the sample point. valid values for tseg1 are ?2...15?. tseg2 time segment after sample point there are (tseg2+1) time quanta after the sample point. valid values for tseg2 are ?1...7?.
can modules st10f280 164/239 doc id 8673 rev. 3 global mask short address: 0xef06h / ee06h xreg reset: 0xufuuh type: r, r/w upper global mask long address: 0xef08h / ee08h xreg reset: 0xuuuuh type: r/w lower global mask long address: 0xef0ah / ee0ah xreg reset: 0xuuuuh type: r, r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id20...18 1 1 1 1 1 id28...21 r/w rrrrr r/w id28...18 identifier (11 bit) mask to filter incoming messages with standard identifier. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id20...13 id28...21 r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id4...0 0 0 0 id12...5 r/w r r r r/w id28...0 identifier (29 bit) mask to filter incoming messages with extended identifier.
st10f280 can modules doc id 8673 rev. 3 165/239 upper mask of last message address: 0xef0ch / ee0ch xreg reset: 0xuuuuh type: r/w lower mask of last message address: 0xef0eh / ee0eh xreg reset: 0xuuuuh type: r, r/w 15.5 the message object the message object is the primary means of communication between cpu and can controller. each of the 15 message objects uses 15 consecutive bytes (see figure 60 ) and starts at an address that is a multiple of 16. note: all message objects must be initialized by the cpu, even those which are not going to be used, before clearing the init bit. each element of the message control register is made of two complementary bits. this special mechanism allows the selective setting or resetting of specific elements (leaving others unchanged) without requiring read-modify-write cycles. none of these elements will be affected by reset. the ta b l e 3 2 shows how to use and to interpret these 2 bit-fields. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id20...18 id17...13 id28...21 r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id4...0 0 0 0 id12...5 r/w r r r r/w id28...0 identifier (29 bit) mask to filter the last incoming message (nr. 15) with standard or extended identifier (as configured).
can modules st10f280 166/239 doc id 8673 rev. 3 figure 64. message object address map table 32. functions of complementary bit of message control register value function on write meaning on read 0 0 reserved reserved 0 1 reset element element is reset 1 0 set element element is set 1 1 leave element unchanged reserved 0hvvdjh&rqwuro $uelwudwlrq 0hvvdjh&rqilj         2emhfw6wduw$gguhvv 'dwd 5h vhuyhg 'dwd 'dwd 'dwd 'dwd 'dwd 'dwd 'dwd ("1($'5
st10f280 can modules doc id 8673 rev. 3 167/239 message control register address: 0xefn0h / een0h xreg reset: 0xuuuuh type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 rmtpnd txrq msglst cpuupd newdat msgval txie rxie intpnd r/w r/w r/w r/w r/w r/w r/w r/w intpnd interrupt pending indicates, if this message object has generated an interrupt request (see txie and rxie), since this bit was last reset by the cpu, or not. rxie receive interrupt enable defines, if bit intpnd is set after successful reception of a frame. txie transmit interrupt enable defines, if bit intpnd is set after successful transmission of a frame. (1) 1. in message object 15 (last message) these bits are hardwired to ?0? (inactive) in order to prevent transmission of message 15. msgval message valid indicates, if the corresponding message object is valid or not. the can controller only operates on valid objects. message objects can be tagged invalid, while they are changed, or if they are not used at all. newdat new data indicates, if new data has been written into the data portion of this message object by cpu (transmit-objects) or can controller (receive-objects) since this bit was last reset, or not. (2) 2. when the can controller writes new data into the message object, unused message bytes will be overwritten by non specified values. usually the cp u will clear this bit before working on the data, and verify that the bit is still cleared once it has finished wo rking to ensure that it has worked on a consistent set of data and not part of an old message and part of the new message. for transmit-objects the cpu will set this bit along with clearing bit cpuupd. this will ensure that, if the message is actually being transmitted during the time the message was being updated by the cpu, the can controller will not reset bit txrq. in this way bit txrq is only reset once the actual data has been transferred. msglst (receive) message lost (this bit applies to receive-objects only) indicates that the can controller has stored a new message into this object, while newdat was still set, i.e. the previously stored message is lost. cpuupd (transmit) cpu update (this bit applies to transmit-objects only) indicates that the corresponding message object may not be transmitted now. the cpu sets this bit in order to inhibit the transmission of a message that is currently updated, or to control the automatic response to remote requests. txrq transmit request indicates that the transmission of this message object is requested by the cpu or via a remote frame and is not yet done. txrq can be disabled by cpuupd. (1) (3) rmtpnd remote pending (used for transmit-objects) indicates that the transmission of this message object has been requested by a remote node, but the data has not yet been transmitted. when rmtpnd is set, the can controller also sets txrq. rmtpnd and txrq are cleared, when the message object has been successfully transmitted.
can modules st10f280 168/239 doc id 8673 rev. 3 15.6 arbitration registers the arbitration registers are used for acceptance filtering of incoming messages and to define the identifier of outgoing messages. upper arbitration reg address: 0xefn2h / een2h xreg reset: 0xuuuuh type: r/w lower arbitration reg address: 0xefn4h / een4h xreg reset: 0xuuuuh type: r, r/w 3. when the cpu requests the transmission of a receive- object, a remote frame will be sent instead of a data frame to request a remote node to send the correspondi ng data frame. this bit will be cleared by the can controller along with bit rmtpnd when the message has been successfully transmitted, if bit newdat has not been set. if there are several valid me ssage objects with pending transmission request, the message with the lowest message number is transmitted first. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id20...18 id17...13 id28...21 r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 id4...0 0 0 0 id12...5 r/w r r r r/w id28...0 identifier (29 bit) identifier of a standard message (id28...18) or an extended message (id28...0). for standard identifiers bit id17...0 are ?don?t care?.
st10f280 watchdog timer doc id 8673 rev. 3 169/239 16 watchdog timer the watchdog timer is a fail-safe mechanism which prevents the microcontroller from malfunctioning for long periods of time. the watchdog timer is always enabled after a reset of the chip and can only be disabled in the time interval until the einit (end of initialization) instruction has been executed. therefore, the chip start-up procedure is always monitored. the software must be designed to service the watchdog timer before it overflows. if, due to hardware or software related failures, the software fails to do so, the watchdog timer overflows and generates an internal hardware reset. it pulls the rstout pin low in order to allow external hardware components to be reset. each of the different reset sources is indicated in the wdtcon register. the indicated bit are cleared with the einit instruction. the origine of the reset can be identified during the initialization phase. wdtcon address: 0xffaeh / d7h sfr reset: 0x00xxh type: r, r/w 1514131211109876543210 wdtrel - - ponr lhwr shwr swr wdtr wdtin r/w rrrrr r/w wdtin watchdog timer input frequency selection 0: input frequency is f cpu /2. 1: input frequency is f cpu /128. wdtr (1) 1. more than one reset indication flag may be set. after einit, all flags are cleared. watchdog timer reset indication flag set by the watchdog timer on an overflow. cleared by a hardware reset or by the srvwdt instruction. swr (1) software reset indication flag set by the srst execution. cleared by the einit instruction. shwr (1) short hardware reset indication flag set by the input rstin . cleared by the einit instruction. lhwr (1) long hardware reset indication flag set by the input rstin . cleared by the einit instruction. ponr (1)(2) 2. power-on is detected when a rising edge from vcc = 0 v to vcc > 2.0 v is recognized. power-on (asynchronous) reset indication flag set by the input rstin if a power-on condition has been detected. cleared by the einit instruction.
watchdog timer st10f280 170/239 doc id 8673 rev. 3 the ponr flag of wdtcon register is set if the output voltage of the internal 3.3v supply falls below the threshold (typically 2v) of the power-on detection circuit. this circuit is efficient to detect major failures of the external 5v supply but if the internal 3.3v supply does not drop under 2 volts, the ponr flag is not set. this could be the case on fast switch-off / switch-on of the 5v supply. the time needed for such a sequence to activate the ponr flag depends on the value of the capacitors connected to the supply and on the exact value of the internal threshold of the detection circuit. note: 1. ponr bit may not be set for short supply failure. note: 2. for power-on reset and reset after supply partial failure, asynchronous reset must be used. in case of bi-directional reset is enabled, and if the rstin pin is latched low after the end of the internal reset sequence, then a short hardware reset, a software reset or a watchdog reset will trigger a long hardware reset. thus, reset indications flags will be set to indicate a long hardware reset. the watchdog timer is 16-bit, clocked with the system clock divided by 2 or 128. the high byte of the watchdog timer register can be set to a pre-specified reload value (stored in wdtrel). each time it is serviced by the application software, the high byte of the watchdog timer is reloaded. for security, rewrite wdtcon each time before the watchdog timer is serviced the ta b l e 3 4 shows the watchdog time range for 40mhz cpu clock. the watchdog timer period is calculated with the following formula: table 33. wdtcon bits value on different resets reset source ponr lhwr shwr swr wdtr power on reset xxxx power on after partial supply failure 1xxx long hardware reset x x x short hardware reset x x software reset x watchdog reset x x table 34. wdtrel reload value reload value in wdtrel prescaler for f cpu = 40mhz 2 (wdtin = ?0?) 128 (wdtin = ?1?) ffh 12.8 s819.2ms 00h 3.276ms 209.7ms p wdt 1 f cpu -------------- - 512 1wdtin ] 63 ) 256 wdtrel ]) [ ? ( [ + ( =
st10f280 system reset doc id 8673 rev. 3 171/239 17 system reset system reset initializes the mcu in a predefined state. there are five ways to activate a reset state. the system start-up configuration is different for each case as shown in ta b l e 3 5 . 17.1 asynchronous reset (long hardware reset) an asynchronous reset is triggered when rstin pin is pulled low while rpd pin is at low level. then the mcu is immediately forced in reset default state. it pulls low rstout pin, it cancels pending internal hold states if any, it waits for any internal access cycles to finish, it aborts external bus cycle, it switches buses (data, address and control signals) and i/o pin drivers to high-impedance, it pulls high port0 pins and the reset sequence starts. 17.1.1 power-on reset the asynchronous reset must be used during the power-on of the mcu. depending on crystal frequency, the on-chip oscillator needs about 10ms to 50ms to stabilize. the logic of the mcu does not need a stabilized clock signal to detect an asynchronous reset, so it is suitable for power-on conditions. to ensure a proper reset sequence, the rstin pin and the rpd pin must be held at low level until the mcu clock signal is stabilized and the system configuration value on port0 is settled. 17.1.2 hardware reset the asynchronous reset must be used to recover from catastrophic situations of the application. it may be triggerred by the hardware of the application. internal hardware logic and application circuitry are described in reset circuitry chapter and figure 68 , figure 69 and figure 66 . 17.1.3 exit of asy nchronous reset state when the rstin pin is pulled high, the mcu restarts. the system configuration is latched from port0 and ale, rd and r/w pins are driven to their inactive level. the mcu starts program execution from memory location 00'0000h in code segment 0. this starting location will typically point to the general initialization routine. timing of asynchronous reset sequence are summarized in figure 61 . table 35. reset event definition reset source short-cut conditions power-on reset ponr power-on long hardware reset (synchronous & asynchronous) lhwr t rstin > 1032 tcl short hardware reset (synchronous reset) shwr 4 tcl < t rstin < 1032 tcl watchdog timer reset wdtr wdt overflow software reset swr srst execution
system reset st10f280 172/239 doc id 8673 rev. 3 figure 65. asynchronous reset timing note: 1. rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2), else it is 4 cpu clock cycles (8 tcl) . 17.2 synchronous reset (warm reset) a synchronous reset is triggered when rstin pin is pulled low while rpd pin is at high level. in order to properly activate the internal reset logic of the mcu, the rstin pin must be held low, at least, during 4 tcl (2 periods of cpu clock). the i/o pins are set to high impedance and rstout pin is driven low. after rstin level is detected, a short duration of 12 tcl (approximately 6 periods of cpu clock) elapes, during which pending internal hold states are cancelled and the current internal access cycle if any is completed. external bus cycle is aborted. the internal pull-down of rstin pin is activated if bit bdrsten of syscon register was previously set by software. this bit is always cleared on power-on or after a reset sequence. 17.2.1 exit of syn chronous reset state the internal reset sequence starts for 1024 tcl (512 periods of cpu clock) and rstin pin level is sampled. the reset sequence is extended until rstin level becomes high. then, the mcu restarts. the system configuration is latched from port0 and ale, rd and r/w pins are driven to their inactive level. the mcu starts program execution from memory location 00'0000h in code segment 0. this starting location will typically point to the general initialization routine. timing of synchronous reset sequence are summarized in figure 66 and figure 67 . 7&/ru7&/  &38&orfn 567,1 $v\qfkurqrxv 5hvhw&rqglwlrq 53' 567287 $/( q r l w d u x j l i q r &  w h v h 5  7 5 2 3 ,167 ,qwhuqdo 5hvhw 6ljqdo /dwfklqjsrlqwri3257 iruv\vwhpvwduwxs frqiljxudwlrq ("1($'5
st10f280 system reset doc id 8673 rev. 3 173/239 figure 66. synchronous warm reset (short low pulse on rstin ) 1. rstin assertion can be released there. 2. if during the reset condition (rstin low), v rpd voltage drops below the threshold voltage (about 2.5v for 5v operation), the asynchronous reset is then immediately entered. 3. rstin rising edge to internal latch of port0 is 3 cpu cl ock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2), else it is 4 cpu clock cycles (8 tcl). 4. rstin pin is pulled low if bit bdrsten (bit 5 of sysc on register) was previously set by software. bit bdrsten is cleared after reset. &38&orfn 567,1 53' 567287 $ /( 3257 ,167 ,qwhuqdo 5hvhw 6ljqdo /dwfklqjsrlqwri3257 iruv\vwhpvwduwxsfrqiljxudwlrq ru7&/  7&/ 7&/ plq pd[ 7&/  ,qwhuqdoo\sxoohgorz  5hvhw&rqiljxudwlrq 9 53' !9$v\qfkurqrxv5hvhwqrwhqwhuhg  p $'lvfkdujh  ("1($'5
system reset st10f280 174/239 doc id 8673 rev. 3 figure 67. synchronous warm reset (long low pulse on rstin ) 1. rstin rising edge to internal latch of port0 is 3 cpu (6 tcl) clock cycles if the pll is bypassed and the prescaler is on (f cpu = f xtal / 2), else it is 4 cpu clock cycles (8 tcl). 2. if during the reset condition (rstin low), v rpd voltage drops below the threshold voltage (about 2.5v for 5v operation), the asynchronous reset is then immediately entered. 3. rstin pin is pulled low if bit bdrsten (bit 5 of syscon register) was previously set by soft-ware. bit bdrsten is cleared after reset. 17.3 software reset the reset sequence can be triggered at any time using the protected instruction srst (software reset). this instruction can be executed deliberately within a program, for example to leave bootstrap loader mode, or upon a hardware trap that reveals a system failure. upon execution of the srst instruction, the internal reset sequence (1024 tcl) is started. the microcontroller behaviour is the same as for a short hardware reset, except that only p0.12...p0.6 bit are latched at the end of the reset sequence, while p0.5...p0.2 bit are cleared. 17.4 watchdog timer reset when the watchdog timer is not disabled during the initialization or when it is not regularly serviced during program execution it will overflow and it will trigger the reset sequence. unlike hardware and software resets, the watchdog reset completes a running external bus cycle if this bus cycle either does not use ready , or if ready is sampled active (low) after the programmed wait states. when ready is sampled inactive (high) after the programmed wait states the running external bus cycle is aborted. then the internal reset sequence is started. at the end of the internal reset sequence (1024 tcl), only p0.12...p0.6 bit are latched, while previously latched values of p0.5...p0.2 are cleared. &38&orfn 567,1 53' 567287 $/( 3257 ,qwhuqdo 5hvhw 6ljqdo /dwfklqjsrlqwri3257 iruv\vwhpvwduwxsfrqiljxudwlrq ru7&/  7&/ 7&/ 7&/ ,qwhuqdoo\sxoohgorz  5hvhw&rqiljxudwlrq  9 53' !9$v\qfkurqrxv5hvhwqrwhqwhuhg  p $'lvfkdujh ("1($'5
st10f280 system reset doc id 8673 rev. 3 175/239 17.5 rstout pin and bidirectional reset the rstout pin is driven active (low level) at the beginning of any reset sequence (synchronous/asynchronous hardware, software and watchdog timer resets). rstout pin stays active low beyond the end of the initialization routine, until the protected einit instruction (end of initialization) is completed. the bidirectional reset function is useful when external devices require a reset signal but cannot be connected to rstout pin, because rstout signal lasts during initialisation. it is, for instance, the case of external memory running initialization routine before the execution of einit instruction. bidirectional reset function is enabled by setting bit 3 (bdrsten) in syscon register. it only can be enabled during the initialization routine, before einit instruction is completed. when enabled, the open drain of the rstin pin is activated, pulling down the reset signal, for the duration of the internal reset sequence (synchronous/asynchronous hardware, software and watchdog timer resets). at the end of the internal reset sequence the pull down is released and the rstin pin is sampled 8 tcl periods later. if signal is sampled low, a hardware reset is triggered again. if it is sampled high, the chip exits reset state according to the running reset way (synchronous/asynchronous hardware, software and watchdog timer resets ). note: the bidirectional reset function is disabled by any reset sequence (bit bdrsten of syscon is cleared). to be activated again it must be enabled during the initialization routine. 17.6 reset circuitry the internal reset circuitry is described in figure 68 . an internal pull-up resistor is implemented on rstin pin. (50k minimum, to 250k maximum). the minimum reset time must be calculated using the lowest value. in addition, a programmable pull-down (bit bdrsten of syscon register) drives the rstin pin according to the internal reset state as explained in section 17.5: rstout pin and bidirectional reset . the rstout pin provides a signals to the application as described in section 17.5: rstout pin and bidirectional reset . a weak internal pull-down is connected to the rpd pin to discharge external capacitor to vss at a rate of 100 a to 200 a. this pull-down is turned on when rstin pin is low if bit pwdcfg of syscon register is set, an internal pull-up resistor is activated at the end of the reset sequence. this pull-up charges the capacitor connected to rpd pin. if bidirectional reset function is not used, the simplest way to reset st10f280 is to connect external components as shown in figure 69 . it works with reset from application (hardware or manual) and with power-on. the value of c1 capacitor, connected on rstin pin with internal pull-up resistor (50k to 250k ), must lead to a charging time long enough to let the internal or external oscillator and / or the on-chip pll to stabilize. the r0-c0 components on rpd pin are mainly implemented to provide a time delay to exit power down mode (see chapter 18: power reduction modes ). nervertheless, they drive rpd pin level during resets and they lead to different reset modes as explained hereafter. on power-on, c0 is totaly discharged, a low level on rpd pin forces an asynchronous
system reset st10f280 176/239 doc id 8673 rev. 3 hardware reset. c0 capacitor starts to charge throught r0 and at the end of reset sequence st10f280 restarts. rpd pin threshold is typically 2.5v. depending on the delay of the next applied reset, the mcu can enter a synchronous reset or an asynchronous reset. if rpd pin is below 2.5v an asynchronous reset starts, if rpd pin is above 2.5v a synchronous reset starts. (see section 17.1: asynchronous reset (long hardware reset) and section 17.2: synchronous reset (warm reset) ). note that an internal pull-down is connected to rpd pin and can drive a 100 a to 200 a current. this pull-down is turned on when rstin pin is low. in order to properly use the bidirectional reset features, the schematic (or equivalent) of figure 66 must be implemented. r1-c1 only work for power-on or manual reset in the same way as explained previously. d1 diode brings a faster discharge of c1 capacitor at power-off during repetitive switch-on / switch-off sequences. d2 diode performs an or-wired connection, it can be replaced with an open drain buffer. r2 resistor may be added to increase the pull-up current to the open drain in order to get a faster rise time on rstin pin when bidirectional function is activated. the start-up configurations and some system features are selected on reset sequences as described in ta b l e and ta b l e 3 7 . ta b l e 3 6 describes what is the system configuration latched on port0 in the five different reset ways. ta bl e 3 7 summarizes the bit state of port0 latched in rp0h, syscon, buscon0 registers. rpoh register is described in section 19.2: system configuration registers .
st10f280 system reset doc id 8673 rev. 3 177/239 figure 68. internal (simplified) reset circuitry figure 69. minimum external reset circuitry 567287 (,1,7,qvwuxfwlrq 7uljjhu &ou &orfn 5hvhw6wdwh 0dfklqh ,qwhuqdo 5hvhw 6ljqdo 5hvhw6htxhqfh &38&orfn&\fohv 65 67lqvwuxfwlrq zdwfkgrjryhuiorz 567,1 9 && %'567(1 9 && 53' :hdnsxoogrzq a p $ )urpwr([lw 3rzhugrzq &lufxlw $v\qfkurqrxv 5hvhw &ou 4 6hw ("1($'5 67) ([whuqdo +dugzduh 567287  567,1 d 0dqxdo+dugzduh5hvhw & e )ru$xwrpdwlf3rzhuxs5hvhwdqglqwhuuxswleohsrzhugrzqpr gh 9 '' 5 53'  & ("1($'5
system reset st10f280 178/239 doc id 8673 rev. 3 figure 70. external reset hardware circuitry table 36. port0 latched configuration for the different resets x : pin is sampled - : pin is not sampled port0 clock options segm. addr. lines chip selects wr config. bus type reserved bsl reserved reserved adapt mode emu mode sample event p0h.7 p0h.6 p0h.5 p0h.4 p0h.3 p0h.2 p0h.1 p0h.0 p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 software reset - - - xxxxxxx ------ watchdog reset - - - xxxxxxx ------ short hardware reset - - - xxxxxxxxxxxxx long hardware reset xxxxxxxxxxxxxxxx power-on reset xxxxxxxxxxxxxxxx 67) ([whuqdo +dugzduh 567287  567,1 9 '' & ' 5 ' 9 '' 5 2shq'udlq,qyhuwhu ([whuqdo 5hvhw6rxufh 9 '' 5 53'  & ("1($'5
st10f280 system reset doc id 8673 rev. 3 179/239 table 37. port0 bit latched into the different registers after reset port0 bit nber h7 h6 h5 h4 h3 h2 h1 h0 i7 i6 i5 i4 i3 i2 i1 i0 port0 bit name clkcfg clkcfg clkcfg salsel salsel cssel cssel wrc bustyp bustyp r bsl rr adp emu rp0h (1) x (2) x (2) x (2) x (2) x (2) x (2) x (2) x (2) clkcfg clkcfg clkcfg salsel salsel cssel cssel wrc syscon x (2) x (2) x (2) x (2) x (2) x (2) bytdis (3) x (2) wrcfg (3) x (2) x (2) x (2) x (2) x (2) x (2) x (2) buscon0 x (2) x (2) x (2) x (2) - bus act0 (4) ale ctl0 (4) - btyp btyp x (2) x (2) x (2) x (2) x (2) x (2) internal logic to c l o ck generator to po r t 4 logic to po r t 6 logic x (2) x (2) x (2) x (2) internal x (2) x (2) internal internal 1. only rp0h low byte is used and the bit-fields are latched from port0 high byte to rp0h low byte. 2. not latched from port0. 3. indirectly depend on port0. 4. bits set if ea pin is 1.
power reduction modes st10f280 180/239 doc id 8673 rev. 3 18 power reduction modes two different power reduction modes with different levels of power reduction have been implemented in the st10f280, which may be entered under software control. in idle mode the cpu is stopped, while the peripherals continue their operation. idle mode can be terminated by any reset or interrupt request. in power down mode both the cpu and the peripherals are stopped. power down mode can now be configured by software in order to be terminated only by a hardware reset or by a transition on enabled fast external interrupt pins. note: all external bus actions are completed before idle or power down mode is entered. however, idle or power down mode is not entered if ready is enabled, but has not been activated (driven low for negative polarity, or driven high for positive polarity) during the last bus access. 18.1 idle mode idle mode is entered by running idle protected instruction. the cpu operation is stopped and the peripherals still run. idle mode is terminate by any interrupt request. whatever the interrupt is serviced or not, the instruction following the idle instruction will be executed after return from interrupt (reti) instruction, then the cpu resumes the normal program. note that a pec transfer keeps the cpu in idle mode. if the pec transfer does not succeed, the idle mode is terminated. watchdog timer must be properly programmed to avoid any disturbance during idle mode. 18.2 power down mode power down mode starts by running pwrdn protected instruction. internal clock is stopped, all mcu parts are on hold including the watchdog timer. there are two different operating power down modes: protected mode and interruptible mode. the internal ram contents can be preserved through the voltage supplied via the v dd pins. to verify ram integrity, some dedicated patterns may be written before entering the power down mode and have to be checked after power down is resumed. it is mandatory to keep v dd = +5v 10% during power-down mode, because the on-chip voltage regulator is turned in power saving mode and it delivers 2.5v to the core logic, but it must be supplied at nominal v dd = +5v.
st10f280 power reduction modes doc id 8673 rev. 3 181/239 syscon address: 0xff12h / 89h sfr reset: 0x0xx0h type: r/w note: register syscon cannot be changed after execution of the einit instruction. 18.2.1 protected power down mode this mode is selected by clearing the bit pwdcfg in register syscon to ?0?. in this mode, the power down mode can only be entered if the nmi (non maskable interrupt) pin is externally pulled low while the pwrdn instruction is executed. this feature can be used in conjunction with an external power failure signal which pulls the nmi pin low when a power failure is imminent. the microcontroller will enter the nmi trap routine which can save the internal state into ram. after the internal state has been saved, the trap routine may set a flag or write a certain bit pattern into specific ram locations, and then execute the pwrdn instruction. if the nmi pin is still low at this time, power down mode will be entered, otherwise program execution continues. during power down the voltage delivered by the on-chip voltage regulator automatically lowers the internal logic supply down to 2.5 v, saving the power while the contents of the internal ram and all registers will still be preserved. exiting power down mode in this mode, the only way to exit power down mode is with an external hardware reset. the initialization routine (executed upon reset) can check the identification flag or bit pattern within ram to determine whether the controller was initially switched on, or whether it was properly restarted from power down mode. 18.2.2 interruptable power down mode this mode is selected by setting the bit pwdcfg in register syscon to ?1?. 151413121110987654321 0 stksz roms1 sgtdis romen bytdis clken wrcfg cscfg pwdcfg owddis bdrsten xpen visible xper-share r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w pwdcfg power down mode configuration control 0: power down mode can only be entered during pwrdn instruction execution if nmi pin is low, otherwise the instruction has no effect. to exit power down mode, an external reset must occurs by asserting the rstin pin. 1: power down mode can only be entered during pwrdn instruction execution if all enabled fastexternal interrupt (exxin) pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin.
power reduction modes st10f280 182/239 doc id 8673 rev. 3 in this mode, the power down mode can be entered if enabled fast external interrupt pins (exxin pins, alternate functions of port 2 pins, with x = 7...0) are in their inactive level. this inactive level is configured with the exixes bit field in the exicon register, as follow: exicon (f1c0h / e0h) address: 0xf1c0h / e0h esfr reset: 0x000h type: r/w exiting power down mode when power down mode is entered, the cpu and peripheral clocks are frozen, and the oscillator and pll are stopped. power down mode can be exited by either asserting rstin or one of the enabled exxin pin (fast external interrupt). rstin must be held low until the oscillator and pll have stabilized. exxin inputs are normally sampled interrupt inputs. however, the power down mode circuitry uses them as level-sensitive inputs. an exxin (x = 7...0) interrupt enable bit (bit ccxie in respective ccxic register) need not to be set to bring the device out of power down mode. an external rc circuit must be connected, as shown in the following figure: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es r/w r/w r/w r/w r/w r/w r/w r/w exixes (x=7...0) external interrupt x edge selection field (x=7...0) 00: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. interrupt on positive edge (rising) 01: enter power down mode if exiin = ?0?, exit if exxin = ?1? (referred as ?high? active level) 10: interrupt on negative edge (falling) enter power down mode if exiin = ?1?, exit if exxin = ?0? (referred as ?low? active level) 11: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed.
st10f280 power reduction modes doc id 8673 rev. 3 183/239 figure 71. external rc circuit on rpd pin for exiting power down mode with external interrupt to exit power down mode with external interrupt, an exxin pin has to be asserted for at least 40 ns (x = 7...0). this signal enables the internal oscillator and pll circuitry, and also turns on the weak pull-down (see following figure). the discharging of the external capacitor provides a delay that allows the oscillator and pll circuits to stabilize before the internal cpu and peripheral clocks are enabled. when the vpp voltage drops below the threshold voltage (about 2.5 v), the schmitt trigger clears q2 flip-flop, thus enabling the cpu and peripheral clocks, and the device resumes code execution. if the interrupt was enabled (bit ccxie=?1? in the respective ccxic register) before entering power down mode, the device executes the interrupt service routine, and then resumes execution after the pwrdn instruction (see note below). if the interrupt was disabled, the device executes the instruction following pwrdn instruction, and the interrupt request flag (bit ccxir in the respective ccxic register) remains set until it is cleared by software. note: due to internal pipeline, the instruction that follows the pwrdn instruction is executed before the cpu performs a call of the interrupt service routine when exiting power-down mode. 53' 9 '' & 5 n : 0 : 7\slfdo  p )7\slfdo 67)  ("1($'5
power reduction modes st10f280 184/239 doc id 8673 rev. 3 figure 72. simplified power down exit circuitry figure 73. power down exit sequence when using an external interrupt (pll x 2) '4 4 9 '' (qwhu fg ([whuqdo lqwhuuxsw uhvhw 6wrssoo vwrsrvfloodwru 9 '' '4 4 fg 6\vwhpforfn &38dqg3hulskhudovforfnv 53' 9 '' 3xooxs :hdn3xoogrzq a p $ 3rzhu'rzq 4 4 ("1($'5 &38fon lqwhuqdo ([whuqdo 53' ([lw3zug ;7$/ ,qwhuuxsw lqwhuqdo a9 ghod\irurvfloodwrusoo vwdelol]dwlrq vljqdo 3rzhugrzq ("1($'5
st10f280 special function register overview doc id 8673 rev. 3 185/239 19 special function register overview the following table lists all sfrs which are implemented in the st10f280 in alphabetical order. bit-addressable sfrs are marked with the letter ?b? in column ?name?. sfrs within the extended sfr-space (esfrs) are marked with the letter ?e? in column ?physical address?. an sfr can be specified by its individual mnemonic name. depending on the selected addressing mode, an sfr can be accessed via its physical address (using the data page pointers), or via its short 8-bit address (without using the data page pointers). the reset value is defined as following: x: means the full nibble is not defined at reset. x: means some bit of the nibble are not defined at reset. table 38. special function registers listed by name name physical address 8-bit address description reset value adcic b ff98h cch a/d converter end of conversion interrupt control register - - 00h adcon b ffa0h d0h a/d converter control register 0000h addat fea0h 50h a/d converter result register 0000h addat2 f0a0h e 50h a/d converter 2 result register 0000h addrsel1 fe18h 0ch address select register 1 0000h addrsel2 fe1ah 0dh address select register 2 0000h addrsel3 fe1ch 0eh address select register 3 0000h addrsel4 fe1eh 0fh address select register 4 0000h adeic b ff9ah cdh a/d converter overrun error interrupt control register - - 00h buscon0 b ff0ch 86h bus configuration register 0 0xx0h buscon1 b ff14h 8ah bus configuration register 1 0000h buscon2 b ff16h 8bh bus configuration register 2 0000h buscon3 b ff18h 8ch bus configuration register 3 0000h buscon4 b ff1ah 8dh bus configuration register 4 0000h caprel fe4ah 25h gpt2 capture/reload register 0000h cc0 fe80h 40h capcom register 0 0000h cc0ic b ff78h bch capcom register 0 interrupt control register - - 00h cc1 fe82h 41h capcom register 1 0000h cc1ic b ff7ah bdh capcom register 1 interrupt control register - - 00h cc2 fe84h 42h capcom register 2 0000h cc2ic b ff7ch beh capcom register 2 interrupt control register - - 00h
special function register overview st10f280 186/239 doc id 8673 rev. 3 cc3 fe86h 43h capcom register 3 0000h cc3ic b ff7eh bfh capcom register 3 interrupt control register - - 00h cc4 fe88h 44h capcom register 4 0000h cc4ic b ff80h c0h capcom register 4 interrupt control register - - 00h cc5 fe8ah 45h capcom register 5 0000h cc5ic b ff82h c1h capcom register 5 interrupt control register - - 00h cc6 fe8ch 46h capcom register 6 0000h cc6ic b ff84h c2h capcom register 6 interrupt control register - - 00h cc7 fe8eh 47h capcom register 7 0000h cc7ic b ff86h c3h capcom register 7 interrupt control register - - 00h cc8 fe90h 48h capcom register 8 0000h cc8ic b ff88h c4h capcom register 8 interrupt control register - - 00h cc9 fe92h 49h capcom register 9 0000h cc9ic b ff8ah c5h capcom register 9 interrupt control register - - 00h cc10 fe94h 4ah capcom register 10 0000h cc10ic b ff8ch c6h capcom register 10 interrupt control register - - 00h cc11 fe96h 4bh capcom register 11 0000h cc11ic b ff8eh c7h capcom register 11 interrupt control register - - 00h cc12 fe98h 4ch capcom register 12 0000h cc12ic b ff90h c8h capcom register 12 interrupt control register - - 00h cc13 fe9ah 4dh capcom register 13 0000h cc13ic b ff92h c9h capcom register 13 interrupt control register - - 00h cc14 fe9ch 4eh capcom register 14 0000h cc14ic b ff94h cah capcom register 14 interrupt control register - - 00h cc15 fe9eh 4fh capcom register 15 0000h cc15ic b ff96h cbh capcom register 15 interrupt control register - - 00h cc16 fe60h 30h capcom register 16 0000h cc16ic b f160h e b0h capcom register 16 interrupt control register - - 00h cc17 fe62h 31h capcom register 17 0000h cc17ic b f162h e b1h capcom register 17 interrupt control register - - 00h cc18 fe64h 32h capcom register 18 0000h cc18ic b f164h e b2h capcom register 18 interrupt control register - - 00h cc19 fe66h 33h capcom register 19 0000h cc19ic b f166h e b3h capcom register 19 interrupt control register - - 00h table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 special function register overview doc id 8673 rev. 3 187/239 cc20 fe68h 34h capcom register 20 0000h cc20ic b f168h e b4h capcom register 20 interrupt control register - - 00h cc21 fe6ah 35h capcom register 21 0000h cc21ic b f16ah e b5h capcom register 21 interrupt control register - - 00h cc22 fe6ch 36h capcom register 22 0000h cc22ic b f16ch e b6h capcom register 22 interrupt control register - - 00h cc23 fe6eh 37h capcom register 23 0000h cc23ic b f16eh e b7h capcom register 23 interrupt control register - - 00h cc24 fe70h 38h capcom register 24 0000h cc24ic b f170h e b8h capcom register 24 interrupt control register - - 00h cc25 fe72h 39h capcom register 25 0000h cc25ic b f172h e b9h capcom register 25 interrupt control register - - 00h cc26 fe74h 3ah capcom register 26 0000h cc26ic b f174h e bah capcom register 26 interrupt control register - - 00h cc27 fe76h 3bh capcom register 27 0000h cc27ic b f176h e bbh capcom register 27 interrupt control register - - 00h cc28 fe78h 3ch capcom register 28 0000h cc28ic b f178h e bch capcom register 28 interrupt control register - - 00h cc29 fe7ah 3dh capcom register 29 0000h cc29ic b f184h e c2h capcom register 29 interrupt control register - - 00h cc30 fe7ch 3eh capcom register 30 0000h cc30ic b f18ch e c6h capcom register 30 interrupt control register - - 00h cc31 fe7eh 3fh capcom register 31 0000h cc31ic b f194h e cah capcom register 31 interrupt control register - - 00h ccm0 b ff52h a9h capcom mode control register 0 0000h ccm1 b ff54h aah capcom mode control register 1 0000h ccm2 b ff56h abh capcom mode control register 2 0000h ccm3 b ff58h ach capcom mode control register 3 0000h ccm4 b ff22h 91h capcom mode control register 4 0000h ccm5 b ff24h 92h capcom mode control register 5 0000h ccm6 b ff26h 93h capcom mode control register 6 0000h ccm7 b ff28h 94h capcom mode control register 7 0000h cp fe10h 08h cpu context pointer register fc00h cric b ff6ah b5h gpt2 caprel interrupt control register - - 00h table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
special function register overview st10f280 188/239 doc id 8673 rev. 3 csp fe08h 04h cpu code segment pointer register (read only) 0000h dp0l b f100h e 80h p0l direction control register - - 00h dp0h b f102h e 81h p0h direction control register - - 00h dp1l b f104h e 82h p1l direction control register - - 00h dp1h b f106h e 83h p1h direction control register - - 00h dp2 b ffc2h e1h port 2 direction control register 0000h dp3 b ffc6h e3h port 3 direction control register 0000h dp4 b ffcah e5h port 4 direction control register - - 00h dp6 b ffceh e7h port 6 direction control register - - 00h dp7 b ffd2h e9h port 7 direction control register - - 00h dp8 b ffd6h ebh port 8 direction control register - - 00h dpp0 fe00h 00h cpu data page pointer 0 register (10-bit) 0000h dpp1 fe02h 01h cpu data page pointer 1 register (10-bit) 0001h dpp2 fe04h 02h cpu data page pointer 2 register (10-bit) 0002h dpp3 fe06h 03h cpu data page pointer 3 register (10-bit) 0003h exicon b f1c0h e e0h external interrupt control register 0000h exisel b f1dah e edh external interrupt source selection register 0000h idchip f07ch e 3eh device identifier register (n is the device revision) 118nh idmanuf f07eh e 3fh manufacturer identifier register 0401h idmem f07ah e 3dh on-chip memory identifier register 3080h idprog f078h e 3ch programming voltage identifier register 0040h idx0 b ff08h 84h mac unit address pointer 0 0000h idx1 b ff0ah 85h mac unit address pointer 1 0000h mah fe5eh 2fh mac unit accumulator - high word 0000h mal fe5ch 2eh mac unit accumulator - low word 0000h mcw b ffdch eeh mac unit control word 0000h mdc b ff0eh 87h cpu multiply divide control register 0000h mdh fe0ch 06h cpu multiply divide register ? high word 0000h mdl fe0eh 07h cpu multiply divide register ? low word 0000h mrw b ffdah edh mac unit repeat word 0000h msw b ffdeh efh mac unit status word 0200h odp2 b f1c2h e e1h port 2 open drain control register 0000h odp3 b f1c6h e e3h port 3 open drain control register 0000h table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 special function register overview doc id 8673 rev. 3 189/239 odp4 b f1cah e e5h port 4 open drain control register - - 00h odp6 b f1ceh e e7h port 6 open drain control register - - 00h odp7 b f1d2h e e9h port 7 open drain control register - - 00h odp8 b f1d6h e ebh port 8 open drain control register - - 00h ones b ff1eh 8fh constant value 1?s register (read only) ffffh p0l b ff00h 80h port0 low register (lower half of port0) - - 00h p0h b ff02h 81h port0 high register (upper half of port0) - - 00h p1l b ff04h 82h port1 low register (lower half of port1) - - 00h p1h b ff06h 83h port1 high register (upper half of port1) - - 00h p2 b ffc0h e0h port 2 register 0000h p3 b ffc4h e2h port 3 register 0000h p4 b ffc8h e4h port 4 register (8-bit) - - 00h p5 b ffa2h d1h port 5 register (read only) xxxxh p6 b ffcch e6h port 6 register (8-bit) - - 00h p7 b ffd0h e8h port 7 register (8-bit) - - 00h p8 b ffd4h eah port 8 register (8-bit) - - 00h p5didis b ffa4h d2h port 5 digital disable register 0000h pocon0l f080h e 40h port0 low output control register (8-bit) - - 00h pocon0h f082h e 41h port0 high output control register (8-bit) - - 00h pocon1l f084h e 42h port1 low output control register (8-bit) - - 00h pocon1h f086h e 43h port1 high output control register (8-bit) - - 00h pocon2 f088h e 44h port2 output control register 0000h pocon3 f08ah e 45h port3 output control register 0000h pocon4 f08ch e 46h port4 output control register (8-bit) - - 00h pocon6 f08eh e 47h port6 output control register (8-bit) - - 00h pocon7 f090h e 48h port7 output control register (8-bit) - - 00h pocon8 f092h e 49h port8 output control register (8-bit) - - 00h pocon20 f0aah e 55h ale, rd , wr output control register (8-bit) - - 00h pecc0 fec0h 60h pec channel 0 control register 0000h pecc1 fec2h 61h pec channel 1 control register 0000h pecc2 fec4h 62h pec channel 2 control register 0000h pecc3 fec6h 63h pec channel 3 control register 0000h pecc4 fec8h 64h pec channel 4 control register 0000h pecc5 fecah 65h pec channel 5 control register 0000h table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
special function register overview st10f280 190/239 doc id 8673 rev. 3 pecc6 fecch 66h pec channel 6 control register 0000h pecc7 feceh 67h pec channel 7 control register 0000h picon b f1c4h e e2h port input threshold control register - - 00h pp0 f038h e 1ch pwm module period register 0 0000h pp1 f03ah e 1dh pwm module period register 1 0000h pp2 f03ch e 1eh pwm module period register 2 0000h pp3 f03eh e 1fh pwm module period register 3 0000h psw b ff10h 88h cpu program status word 0000h pt0 f030h e 18h pwm module up/down counter 0 0000h pt1 f032h e 19h pwm module up/down counter 1 0000h pt2 f034h e 1ah pwm module up/down counter 2 0000h pt3 f036h e 1bh pwm module up/down counter 3 0000h pw0 fe30h 18h pwm module pulse width register 0 0000h pw1 fe32h 19h pwm module pulse width register 1 0000h pw2 fe34h 1ah pwm module pulse width register 2 0000h pw3 fe36h 1bh pwm module pulse width register 3 0000h pwmcon0 b ff30h 98h pwm module control register 0 0000h pwmcon1 b ff32h 99h pwm module control register 1 0000h pwmic b f17eh e bfh pwm module interrupt control register - - 00h qr0 f004h e 02h mac unit offset register qr0 0000h qr1 f006h e 03h mac unit offset register qr1 0000h qx0 f000h e 00h mac unit offset register qx0 0000h qx1 f002h e 01h mac unit offset register qx1 0000h rp0h b f108h e 84h system start-up configuration register (read only) - - xxh s0bg feb4h 5ah serial channel 0 baud rate generator reload register 0000h s0con b ffb0h d8h serial channel 0 control register 0000h s0eic b ff70h b8h serial channel 0 error interrupt control register - - 00h s0rbuf feb2h 59h serial channel 0 receive buffer register (read only) - - xxh s0ric b ff6eh b7h serial channel 0 receive interrupt control register - - 00h s0tbic b f19ch e ceh serial channel 0 transmit buffer interrupt control register - - 00h table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 special function register overview doc id 8673 rev. 3 191/239 s0tbuf feb0h 58h serial channel 0 transmit buffer register (write only) 0000h s0tic b ff6ch b6h serial channel 0 transmit interrupt control register - - 00h sp fe12h 09h cpu system stack pointer register fc00h sscbr f0b4h e 5ah ssc baud rate register 0000h ssccon b ffb2h d9h ssc control register 0000h ssceic b ff76h bbh ssc error interrupt control register - - 00h sscrb f0b2h e 59h ssc receive buffer (read only) xxxxh sscric b ff74h bah ssc receive interrupt control register - - 00h ssctb f0b0h e 58h ssc transmit buffer (write only) 0000h ssctic b ff72h b9h ssc transmit interrupt control register - - 00h stkov fe14h 0ah cpu stack overflow pointer register fa00h stkun fe16h 0bh cpu stack underflow pointer register fc00h syscon b ff12h 89h cpu system configuration register 0xx0h (1) t0 fe50h 28h capcom timer 0 register 0000h t01con b ff50h a8h capcom timer 0 and timer 1 control register 0000h t0ic b ff9ch ceh capcom timer 0 interrupt control register - - 00h t0rel fe54h 2ah capcom timer 0 reload register 0000h t1 fe52h 29h capcom timer 1 register 0000h t1ic b ff9eh cfh capcom timer 1 interrupt control register - - 00h t1rel fe56h 2bh capcom timer 1 reload register 0000h t2 fe40h 20h gpt1 timer 2 register 0000h t2con b ff40h a0h gpt1 timer 2 control register 0000h t2ic b ff60h b0h gpt1 timer 2 interrupt control register - - 00h t3 fe42h 21h gpt1 timer 3 register 0000h t3con b ff42h a1h gpt1 timer 3 control register 0000h t3ic b ff62h b1h gpt1 timer 3 interrupt control register - - 00h t4 fe44h 22h gpt1 timer 4 register 0000h t4con b ff44h a2h gpt1 timer 4 control register 0000h t4ic b ff64h b2h gpt1 timer 4 interrupt control register - - 00h t5 fe46h 23h gpt2 timer 5 register 0000h t5con b ff46h a3h gpt2 timer 5 control register 0000h t5ic b ff66h b3h gpt2 timer 5 interrupt control register - - 00h t6 fe48h 24h gpt2 timer 6 register 0000h table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
special function register overview st10f280 192/239 doc id 8673 rev. 3 t6con b ff48h a4h gpt2 timer 6 control register 0000h t6ic b ff68h b4h gpt2 timer 6 interrupt control register - - 00h t7 f050h e 28h capcom timer 7 register 0000h t78con b ff20h 90h capcom timer 7 and 8 control register 0000h t7ic b f17ah e beh capcom timer 7 interrupt control register - - 00h t7rel f054h e 2ah capcom timer 7 reload register 0000h t8 f052h e 29h capcom timer 8 register 0000h t8ic b f17ch e bfh capcom timer 8 interrupt control register - - 00h t8rel f056h e 2bh capcom timer 8 reload register 0000h tfr b ffach d6h trap flag register 0000h wdt feaeh 57h watchdog timer register (read only) 0000h wdtcon b ffaeh d7h watchdog timer control register 00xxh (2) xp0ic b f186h e c3h can1 module interrupt control register - - 00h (3) xp1ic b f18eh e c7h can2 module interrupt control register - - 00h (3) xp2ic b f196h e cbh xpwm interrupt control register - - 00h (3) xp3ic b f19eh e cfh pll unlock interrupt control register - - 00h (3) xpercon f024h e 12h xper configuration register - - 05h zeros b ff1ch 8eh constant value 0?s register (read only) 0000h 1. the system configuration is selected during reset. 2. bit wdtr indicates a watchdog timer triggered reset. 3. the xpnic interrupt control registers control interr upt requests from integrated x-bus peripherals. some software controlled interrupt requests may be generated by setting the xpnir bits (of xpnic register) of the unused x-peripheral nodes. table 39. x registers listed by name name physical address description reset value can1btr ef04h can1 bit timing register xxxxh can1csr ef00h can1 control/status register xx01h can1gms ef06h can1 global mask short xfxxh can1ir ef02h can1 interrupt register - - xxh can1lar1--15 ef14--eff4h can1 lower arbitration register 1 to 15 xxxxh can1lgml ef0ah can1 lower global mask long xxxxh can1lmlm ef0eh can1 lower mask last message xxxxh can1mcr1--15 ef10--eff0h can1 message control register 1 to 15 xxxxh can1mo1--15 ef1x--effxh can1 message object 1 to 15 xxxxh table 38. special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 special function register overview doc id 8673 rev. 3 193/239 can1uar1--15 ef12--eff2h can1 upper arbitration register 1 to 15 xxxxh can1ugml ef08h can1 upper global mask long xxxxh can1umlm ef0ch can1 upper mask last message xxxxh can2btr ee04h can2 bit timing register xxxxh can2csr ee00h can2 control/status register xx01h can2gms ee06h can2 global mask short xfxxh can2ir ee02h can2 interrupt register - - xxh can2lar1--15 ee14--eef4h can2 lower arbitration register 1 to 15 xxxxh can2lgml ee0ah can2 lower global mask long xxxxh can2lmlm ee0eh can2 lower mask last message xxxxh can2mcr1--15 ee10--eef0h can2 message control register 1 to 15 xxxxh can2mo1--15 ee1x--eefxh can2 message object 1 to 15 xxxxh can2uar1--15 ee12--eef2h can2 upper arbitration register 1 to 15 xxxxh can2ugml ee08h can2 upper global mask long xxxxh can2umlm ee0ch can2 upper mask last message xxxxh xadcmux c384h port5 or portx10 adc input selection (read / write) 0000h xdp9 c200h direction register xport9 (read / write) 0000h xdp9clr c204h bit clear direction register xport9 (write only) 0000h xdp9set c202h bit set direction register xport9 (write only) 0000h xodp9 c300h open drain control register xport9 (read / write) 0000h xodp9clr c304h bit clear open drain control register xport9 (write only) 0000h xodp9set c302h bit set open drain control register xport9 (write only) 0000h xp10 c380h read only data register xport10 (read only) 0000h xp10didis c382h xport10 schmitt trigger input selection (read / write) 0000h xp9 c100h data register xport9 (read / write) 0000h xp9clr c104h bit clear data register xport9 (write only) 0000h xp9set c102h bit set data register xport9 (write only) 0000h xpolar ec04h xpwm channel polarity control register 0000h xpp0 ec20h xpwm period register 0 0000h xpp1 ec22h xpwm period register 1 0000h xpp2 ec24h xpwm period register 2 0000h xpp3 ec26h xpwm period register 3 0000h table 39. x registers listed by name (continued) name physical address description reset value
special function register overview st10f280 194/239 doc id 8673 rev. 3 19.1 identification registers the st10f280 has four identification registers, mapped in esfr space. these register contain: a manufacturer identifier, a chip identifier, with its revision, a internal memory and size identifier and programming voltage description. idmanuf address: f07eh / 3fh esfr reset: 0x0401h type: r xpt0 ec10h xpwm timer counter register 0 0000h xpt1 ec12h xpwm timer counter register 1 0000h xpt2 ec14h xpwm timer counter register 2 0000h xpt3 ec16h xpwm timer counter register 3 0000h xpw0 ec30h xpwm pulse width register 0 0000h xpw1 ec32h xpwm pulse width register 1 0000h xpw2 ec34h xpwm pulse width register 2 0000h xpw3 ec36h xpwm pulse width register 3 0000h xpwmcon0 ec00h xpwm control register 0 0000h xpwmcon1 ec02h xpwm control register 1 0000h xtcr c000h xtimer control register (read / write) 0000h xtcvr c006h xtimer current value register (read / write) 0000h xtevr c004h xtimer end value register (read / write) 0000h xtsvr c002h xtimer start value register (read / write) 0000h table 39. x registers listed by name (continued) name physical address description reset value 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 manuf 00001 r manuf manufacturer identifier 020h: stmicroelectronics manufacturer (jtag worldwide normalization).
st10f280 special function register overview doc id 8673 rev. 3 195/239 idchip address: f07ch / 3eh esfr reset: 0x118xh type: r idmem address: 0xf07ah / 3dh esfr reset: 0x3080h type: r idprog address: f078h / 3ch esfr reset: 0x0040h type: r note: 1. all identification words are read only registers. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 chipid revid rr revid device revision identifier chipid device identifier 118h: st10f280 identifier. 1514131211109876543210 memtyp memsize rr memsize internal memory size is calculated using the following formula: size = 4 x [memsize] (in k byte) 080h for st10f280 (512k byte) memtyp internal memory type 3h for st10f280 (flash memory). 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 progvpp progvdd rr progvdd programming v dd voltage v dd voltage when programming eprom or flash devices is calculated using the following formula: v dd = 20 x [progvdd] / 256 (volts) 40h for st10f280 (5v). progvpp programming v pp voltage (no need of external v pp ) 00h
special function register overview st10f280 196/239 doc id 8673 rev. 3 19.2 system configuration registers the st10f280 has registers used for different configuration of the overall system. these registers are described below. syscon address: 0xff12h / 89h sfr reset: 0x0xx0h type: r/w note: register syscon cannot be changed after execution of the einit instruction. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stksz roms1 sgtdis romen bytdis clken wrcfg cscfg pwd cfg owd dis bdr sten xpen visible xper-share r/w r/w r/w r/w (1) 1. these bit are set directly or indirectly acco rding to port0 and ea pin configuration during reset sequence. r/w (1) r/w r/w (1) r/w r/w r/w r/w r/w r/w r/w xper-share xbus peripheral share mode control 0: external accesses to xbus peripherals are disabled 1: xbus peripherals are accessible via the external bus during hold mode visible visible mode control 0: accesses to xbus peripherals are done internally 1: xbus peripheral accesses are made visible on the external pins xpen xbus peripheral enable bit 0: accesses to the on-chip x-peripherals and xram are disabled 1: the on-chip x-peripherals are enabled. bdrsten bidirectional reset enable 0: rstin pin is an input pin only. (sw reset or wdt reset have no effect on this pin) 1: rstin pin is a bidirectional pin. this pin is pulled low during 1024 tcl during reset sequence. owddis oscillator watchdog disable control 0: oscillator watchdog (owd) is enabled. if pll is bypassed, the owd monitors xtal1 activity. if there is no activity on xtal1 for at least 1 s, the cpu clock is switched automatically to pll?s base frequency (2 to 10mhz). 1: owd is disabled. if the pll is bypassed, the cpu clock is always driven by xtal1 signal. the pll is turned off to reduce power supply current. pwdcfg power down mode configuration control 0: power down mode can only be entered during pwrdn instruction execution if nmi pin is low, otherwise the instruction has no effect. exit power down only with reset. 1: power down mode can only be entered during pwrdn instruction execution if all enabled fast external interrupt exxin pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin or with external reset.
st10f280 special function register overview doc id 8673 rev. 3 197/239 cscfg chip select configuration control 0: latched chip select lines: csx change 1 tcl after rising edge of ale 1: unlatched chip select lines: csx change with rising edge of ale. wrcfg write configuration control (inverted copy of bit wrc of rp0h) 0: pins wr and bhe retain their normal function 1: pin wr acts as wrl , pin bhe acts as wrh . clken system clock output enable (clkout) 0: clkout disabled: pin may be used for general purpose i/o 1: clkout enabled: pin outputs the system clock signal. bytdis disable/enable control for pin bhe (set according to data bus width) 0: pin bhe enabled 1: pin bhe disabled, pin may be used for general purpose i/o. romen internal memory enable (set according to pin ea during reset) 0: internal memory disabled: accesses to the memory area use the external bus 1: internal memory enabled. sgtdis segmentation disable/enable control 0: segmentation enabled (csp is saved/restored during interrupt entry/exit) 1: segmentation disabled (only ip is saved/restored). roms1 internal flash memory mapping 0: internal flash memory area mapped to segment 0 (00?0000h...00?7fffh) 1: internal flash memory area mapped to segment 1 (01?0000h...01?7fffh). stksz system stack size selects the size of the system stack (in the internal ram) from 32 to 1024 words. table 40. stack size selection stack size (words) internal ram addresses (words) of physical stack significant bits of stack pointer sp 0 0 0 b 256 00?fbfeh...00?fa00h (default after reset) sp.8...sp.0 0 0 1 b 128 00?fbfeh...00?fb00h sp.7...sp.0 0 1 0 b 64 00?fbfeh...00?fb80h sp.6...sp.0 0 1 1 b 32 00?fbfeh...00?fbc0h sp.5...sp.0 1 0 0 b 512 00?fbfeh...00?f800h (not for 1k byte iram) sp.9...sp.0 1 0 1 b - reserved. do not use this combination - 1 1 0 b - reserved. do not use this combination - 1 1 1 b 1024 00?fdfeh...00?fx00h (note: no circular stack) 00?fx00h represents the lower iram limit, i.e. 1k byte: 00?fa00h, 2k byte: 00?f600h, 3k byte: 00?f200h sp.11...sp.0
special function register overview st10f280 198/239 doc id 8673 rev. 3 buscon0 address: 0xff0ch / 86h sfr reset: 0x0xx0h type: r/w buscon1 address: 0xff14h / 8ah sfr reset: 0x0000h type: r/w buscon2 address: 0xff16h / 8bh sfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen0 csren0 rdypol0 rdyen0 - bus act0 ale ctl0 -btyp mttc0 rwdc0 mctc r/w r/w r/w r/w r/w (1) 1. buscon0 is initialized with 0000h, if ea pin is high during reset. if ea pin is low during reset, bit busact0 and alectrl0 are set (?1?) and bit field btyp is loaded with the bus configuration selected via port0. r/w (1) r/w (2) 2. btyp (bit 6 and 7) are set according to the configuration of the bit l1 and l2 of port0 latched at the end of the reset sequence. r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen1 csren1 rdypol1 rdyen1 - busact1 alectl1 -btyp mttc1 rwdc1 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen2 csren2 rdypol2 rdyen2 - busact2 alectl2 -btyp mttc2 rwdc2 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w
st10f280 special function register overview doc id 8673 rev. 3 199/239 buscon3 address: 0xff18h / 8ch sfr reset: 0x0000h type: r/w buscon4 address: 0xff14h / 8dh sfr reset: 0x0000h type: r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen3 csren3 rdypol3 rdyen3 - busact3 alectl3 -btyp mttc3 rwdc3 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cswen4 csren4 rdypol4 rdyen4 - busact4 alectl4 -btyp mttc4 rwdc4 mctc r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w mctc memory cycle time control (number of memory cycle time wait states) 0000: 15 wait states (nber = 15 [mctc]) . . . 1111: no wait states rwdcx read/write delay control for busconx 0: with read/write delay: activate command 1 tcl after falling edge of ale 1: no read/write delay: activate command with falling edge of ale mttcx memory tristate time control 0: 1 wait state 1: no wait state btyp external bus configuration 00: 8-bit demultiplexed bus 01: 8-bit multiplexed bus 10: 16-bit demultiplexed bus 11: 16-bit multiplexed bus note: for buscon0, btyp bit-field is defined via port0 during reset. alectlx ale lengthening control 0: normal ale signal 1: lengthened ale signal busactx bus active control 0: external bus disabled 1: external bus enabled (within the respective address window, see addrsel)
special function register overview st10f280 200/239 doc id 8673 rev. 3 rp0h address: 0xf108h / 84h esfr reset: 0x--xxh type: r rdyenx ready input enable 0: external bus cycle is controlled by bit field mctc only 1: external bus cycle is controlled by the ready input signal rdypolx ready active level control 0: active level on the ready pin is low, bus cycle terminates with a ?0? on ready pin, 1: active level on the ready pin is high, bus cycle terminates with a ?1? on ready pin. csrenx read chip select enable 0: the cs signal is independent of the read command (rd ) 1: the cs signal is generated for the duration of the read command cswenx write chip select enable 0: the cs signal is independent of the write command (wr ,wrl ,wrh ) 1: the cs signal is generated for the duration of the write command 1514131211109 87654321 0 -------- clksel salsel c ssel wrc r (1)(2) 1. rp0h.7 to rp0h.5 bits are loaded only during a long hardware reset. as pull-up resistors are active on each port p0h pins during reset, rp0h default value is "ffh" 2. these bits are set according to port 0 configuration during any reset sequence. r (2) r (2) r (2) wrc write configuration control 0: pin wr acts as wrl , pin bhe acts as wrh 1: pins wr and bhe retain their normal function cssel chip select line selection (number of active cs outputs) 00: 3 cs lines: cs 2...cs 0 01: 2 cs lines: cs 1...cs 0 10: no cs lines at all 11: 5 cs lines: cs 4...cs 0 (default without pull-downs) salsel segment address line selection (number of active segment address outputs) 00: 4-bit segment address: a19...a16 01: no segment address lines at all 10: 8-bit segment address: a23...a16 11: 2-bit segment address: a17...a16 (default without pull-downs)
st10f280 special function register overview doc id 8673 rev. 3 201/239 exicon address: 0xf1c0h / e0h esfr reset: 0x0000h type: r/w exisel address: 0xf1dah / edh esfr reset: 0x0000h type: r/w clksel system clock selection 000: f cpu = 2.5 x f osc 001: f cpu = 0.5 x f osc 010: f cpu = 10 x f osc 011: f cpu = f osc 100: f cpu = 5 x f osc 101: f cpu = 2 x f osc 110: f cpu = 3 x f osc 111: f cpu = 4 x f osc 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es r/w r/w r/w r/w r/w r/w r/w r/w exixes(x=7...0) external interrupt x edge selection field (x=7...0) 00: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. 01: interrupt on positive edge (rising) enter power down mode if exiin = ?0?, exit if exxin = ?1? (referred as ?high? active level) 10: interrupt on negative edge (falling) enter power down mode if exiin = ?1?, exit if exxin = ?0? (referred as ?low? active level) 11: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 exi7ss exi6ss exi5ss exi4ss exi3ss exi2ss exi1ss exi0ss r/w r/w r/w r/w r/w r/w r/w r/w exixss external interrupt x source selection (x=7...0) 00: input from associated port 2 pin. 01: input from ?alternate source?. 10: input from port 2 pin ored with ?alternate source?. 11: input from port 2 pin anded with ?alternate source?.
special function register overview st10f280 202/239 doc id 8673 rev. 3 xp3ic address: 0xf19eh / cfh esfr reset: 0x--00h type: r/w note: xp3ic register has the same bit field as xxic interrupt registers xxic address: 0xyyyyh / zzh sfr reset: 0x--00h type: r/w exixss port 2 pin alternate source 0p2.8can1_rxd 1p2.9can2_rxd 2...7 p2.10...15 not used (zero) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - xp3ir xp3ie xp3ilvl glvl r/w r/w r/w r/w 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------xxirxxie ilvl glvl r/w r/w r/w r/w glvl group level defines the internal order for simultaneous requests of the same priority. 11: highest group priority 00: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. 1111: highest priority level 0000: lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) 0: interrupt request is disabled 1: interrupt request is enabled xxir interrupt request flag 0: no request pending 1: this source has raised an interrupt request
st10f280 special function register overview doc id 8673 rev. 3 203/239 xpercon address: 0xf024h / 12h esfr reset: 0x--05h type: r/w note: when both can and xpwm are disabled via xpercon setting, then any access in the address range 00?ec00h 00?efffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register. p4.4 and p4.7 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ----------- xpwmen xperconen3 xramen can2en can1en r/w r/w r/w r/w r/w can1en can1 enable bit 0: accesses to the on-chip can1 xperipheral and its functions are disabled. p4.5 and p4.6 pins can be used as general purpose i/os. address range 00?ef00h- 00?efffh is only directed to external memory if can2en and xpwm bits are cleared also. 1: the on-chip can1 xperipheral is enabled and can be accessed. can2en can2 enable bit 0: accesses to the on-chip can2 xperipheral and its functions are disabled. p4.4 and p4.7 pins can be used as general purpose i/os. address range 00?ee00h- 00?eeffh is only directed to external memory if can1en and xpwm bits are cleared also. t1: he on-chip can2 xperipheral is enabled and can be accessed. xramen xram enable bit 0: accesses to the on-chip 16k byte xram are disabled, external access performed. 1: the on-chip 16k byte xram is enabled and can be accessed. xperconen3 xport9,xtimer, xport10, xadcmux enable bit 0: accesses to the xport9, xtimer, xport10, xadcmux peripherals are disabled, external access performed. 1: the on-chip xport9, xtimer, xport10, xadcmux peripherals are enabled and can be accessed. xpwmen xpwm enable bit 0: accesses to the on-chip xpwm are disabled, external access performed. address range 00?ec00h-00?ecffh is only directed to external memory if can1en and can2en are ?0? also 1: the on-chip xpwm is enabled and can be accessed.
special function register overview st10f280 204/239 doc id 8673 rev. 3 can be used as general purpose i/o when can2 is not enabled, and p4.5 and p4.6 can be used as general purpose i/o when can1 is not enabled. the default xper selection after reset is: xcan1 is enabled, xcan2 is disabled, xram is enabled, xport9, xtimer, xport10, xpwm are disabled. register xpercon cannot be changed after the global enabling of xperipherals, i.e. after setting of bit xpen in syscon register.
st10f280 electrical characteristics doc id 8673 rev. 3 205/239 20 electrical characteristics 20.1 absolute maximum ratings stresses the device above the rating listed in the table 41: absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the 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 < v ss ) the voltage on pins with respect to ground (v ss ) must not exceed the values defined ta bl e 4 1 . 20.2 parameter interpretation the parameters listed in the following tables represent the characteristics of the st10f280 and its demands on the system. where the st10f280 logic provides signals with their respective timing characteristics, the symbol ?cc? for controller characteristics, is included in the ?symbol? column. where the external system must provide signals with their respective timing characteristics to the st10f280, the symbol ?sr? for system requirement, is included in the ?symbol? column. 20.3 dc characteristics v dd =5v 10%, v ss =0v, f cpu = 40 mhz, reset active, t a = -40c to 125c table 41. absolute maximum ratings symbol parameter value unit v dd voltage on v dd pins with respect to ground -0.5, +6.5 v v io voltage on any pin with respect to ground -0.5, (v dd +0.5) v v aref voltage on v aref pin with respect to ground -0.3, (v dd +0.3) v i ov input current on any pin during overload condition -10, +10 ma i tov absolute sum of all input currents during overload condition |100 ma| ma p tot power dissipation 1.5 w t a ambient temperature under bias -40, +125 c t stg storage temperature -65, +150 c table 42. dc characteristics symbol parameter test conditions min. max. unit v il sr input low voltage ? -0.5 0.2 v dd - 0.1 v v ils sr input low voltage (special threshold) ? -0.5 2.0 v
electrical characteristics st10f280 206/239 doc id 8673 rev. 3 v ih sr input high voltage (all except rstin and xtal1) ? 0.2 v dd + 0.9 v dd + 0.5 v v ih1 sr input high voltage rstin ?0.6 v dd v dd + 0.5 v v ih2 sr input high voltage xtal1 ? 0.7 v dd v dd + 0.5 v v ihs sr input high voltage (special threshold) ? 0.8 v dd - 0.2 v dd + 0.5 v hys input hysteresis (special threshold) (1) ?400?mv v ol cc output low voltage (port0, port1, port 4, ale, rd , wr , bhe , clkout, rstout ) (2) i ol = 2.4ma ? 0.45 v v ol1 cc output low voltage (all other outputs) (2) i ol1 = 1.6ma ? 0.45 v v oh cc output high voltage (port0, port1, port4, ale, rd , wr , bhe , clkout, rstout ) (2) i oh = -500 a0.9 v dd ?v i oh = -2.4ma 2.4 ? v v oh1 cc output high voltage (all other outputs) (2)(3) i oh = ? 250 a0.9 v dd ?v i oh = ? 1.6ma 2.4 ? v ? i oz1 ? cc input leakage current (port 5, xport 10) 0v < v in < v dd ?0.2 a ? i oz2 ? cc input leakage current (all other) 0v < v in < v dd ?1 a ? i ov ? sr overload current (1) (4) ?5ma r rst cc rstin pull-up resistor (1) ? 50 250 k i rwh read / write inactive current (5)(6) v out = 2.4v ? -40 a i rwl read / write active current (5)(7) v out = v olmax -500 ? a i alel ale inactive current (5)(6) v out = v olmax 40 ? a i aleh ale active current (5)(7) v out = 2.4v ? 500 a i p6h port 6 inactive current (5)(6) v out = 2.4v ? -40 a i p6l port 6 active current (5)(7) v out = v ol1max -500 ? a i p0h port0 configuration current (5) v in = v ihmin (6) ?-10 a i p0l v in = v ilmax (7) -100 ? a ? i il ? cc xtal1 input current 0v < v in < v dd ?20 a c io cc pin capacitance (digital inputs / outputs) (1)(5) f = 1mhz, t a =25c ?10pf i cc power supply current (8) rstin = v ih1 f cpu in [mhz] ? 30 + 3.3 x f cpu ma i id idle mode supply current (9) rstin = v ih1 f cpu in [mhz] ?20 + f cpu ma i pd power-down mode supply current (10) v dd = 5.5v t a = 55c ? 200 a 1. partially tested, guaranteed by design characterization. table 42. dc characteristics (continued) symbol parameter test conditions min. max. unit
st10f280 electrical characteristics doc id 8673 rev. 3 207/239 figure 74. supply / idle current as a function of operating frequency 2. st10f280 pins are equipped with low-noise output drivers whic h significantly improve the device?s emi performance. these low-noise drivers deliver their maximum current only until the respective target output level is reached. after this, the output current is reduced. this results in increased impedance of the driver, which attenuates electrical noise from the connected pcb tracks. the current specified in co lumn ?test conditions? is delivered in any cases. 3. this specification is not valid for out puts which are switched to open drain mode. in this case the respective output will fl oat and the voltage results from the external circuitry. 4. overload conditions occur if the standard operating conditi ons are exceeded, i.e. the voltage on any pin exceeds the specified range (i.e. vov > vdd+0.5v or vov <0.5v). the absol ute sum of input overload currents on all port pins may not exceed 50ma. the supply voltage must remain within the specified limits. 5. this specification is only valid during reset, or during hold -mode or adapt-mode. port 6 pins are only affected if they are used for cs output and if their open drain function is not enabled. 6. the maximum current may be drawn while the respective signal line remains inactive 7. the minimum current must be drawn in order to drive the respective signal line active. 8. the power supply current is a function of the operating frequency. this dependency is illustrated in the figure 70. these parameters are tested at vddmax and 40mhz cpu clock with all outputs disconnected and all inputs at vil or vih. the chip is configured with a demultiplexed 16-bit bus, direct cloc k drive, 5 chip select lines and 2 segment address lines, ea pin is low during reset. after reset, port 0 is driven with the value ?00cch? that produces infinite execution of nop instruction with 15 wait-state, r/w delay, memory tristate wait state, normal ale. peripherals are not activated 9. idle mode supply current is a function of the operating frequency. this dependency is illustra ted in the figure 70. these parameters are tested at vddmax and 40mhz cpu clock wit h all outputs disconnected and all inputs at vil or vih. 10. this parameter value includes leakage currents. with all inputs (including pins configured as i nputs) at 0 v to 0.1v or at vdd ? 0.1v to vdd, vref = 0v, all outputs (i ncluding pins configured as outputs) disconnected. ,>p$@ i &38 >0+]@     , &&w\s , ,'pd[ , &&pd[ , ,'w\s   p$ p$ ("1($'5
electrical characteristics st10f280 208/239 doc id 8673 rev. 3 20.3.1 a/d converter characteristics v dd = 5 v 10%, v ss = 0 v , t a = -40c to 125c, 4.0 v v aref v dd + 0.1 v; v ss 0.1 v v agnd v ss + 0.2 v table 43. a/d converter characteristics symbol parameter test condition min. max unit v aref sr analog reference voltage 4.0 v dd + 0.1 v v ain sr analog input voltage (1)(2) 1. vain may exceed vagnd or varef up to the absolute maximum ratings. however, the conversion result in these cases will be x000h or x3ffh, respectively. 2. to remove noise and undesirable high frequency co mponents from the analog input signal, a low-pass filter must be connected at the adc input. the cut- off frequency of this filter should avoid 2 opposite transitions during the t s sampling time of the st10 adc: - f cut-off 1 / 5 ts to 1/10 ts where ts is the sampling time of the st10 adc and is not related to the nyquist frequency determined by the t c conversion time. v agnd v aref v i aref cc reference supply current running mode power-down mode (3) 3. partially tested, guaranteed by design characterization. ? ? 500 1 a a c ain cc adc input capacitance not sampling sampling (3) ? ? 10 15 pf pf t s cc sample time (4)(5) 4. during the t s sample time the input capacitance c ain can be charged/discharged by the external source. the internal resistance of the analog source must a llow the capacitance to reac h its final voltage level within the t s sample time. after the end of the t s sample time, changes of the analog input voltage have no effect on the conversion result. values for the t sc sample clock depend on the programming. referring to the t c conversion time formula of section 20.3.2 and to the table 39 of page 156: - t s min = 2 t sc min = 2 t cc min = 2 x 24 x tcl = 48 tcl - t s max = 2 t sc max = 2 x 8 t cc max = 2 x 8 x 96 tcl = 1536 tcl tcl is defined in section 20.4.5 at page 159. 5. this parameter is fix ed by adc control logic. 48 tcl 1 536 tcl t c cc conversion time (6)(5) 6. the conversion time formula is: - t c = 14 t cc + t s + 4 tcl (= 14 t cc + 2 t sc + 4 tcl) the t c parameter includes the t s sample time, the time for determining the digital result and the time to load the result register with the result of the conversion. values for the t cc conversion clock depend on the programming. referring to the table 39 of page 156: - t c min = 14 t cc min + t s min + 4 tcl = 14 x 24 x tcl + 48 tcl + 4 tcl = 388 tcl - t c max = 14 t cc max + t s max + 4 tcl = 14 x 96 tcl + 1536 tcl + 4 tcl = 2884 tcl 388 tcl 2 884 tcl dnl cc differential nonlinearity (7) -0.5 +0.5 lsb inl cc integral nonlinearity (7) -1.5 +1.5 lsb ofs cc offset error (7) -1.0 +1.0 lsb tue cc total unadjusted error (7) -2.0 +2.0 lsb r asrc sr internal resistance of analog source t s in [ns] (4)(3) ? (t s / 150) - 0.25 k k cc coupling factor between inputs (8)(3) ?1/500
st10f280 electrical characteristics doc id 8673 rev. 3 209/239 20.3.2 conversi on timing control when a conversion is started, first the capacitances of the converter are loaded via the respective analog input pin to the current analog input voltage. the time to load the capacitances is referred to as the sample time t s . next the sampled voltage is converted to a digital value in 10 successive steps, which correspond to the 10-bit resolution of the adc. the next 4 steps are used for equalizing internal levels (and are keep for exact timing matching with the 10-bit a/d converter module implemented in st10f168). the current that has to be drawn from the sources for sampling and changing charges depends on the time that each respective step takes, because the capacitors must reach their final voltage level within the given time, at least with a certain approximation. the maximum current, however, that a source can deliver, depends on its internal resistance. the sample time t s (= 2 t sc ) and the conversion time t c (= 14 t cc + 2 t sc + 4 tcl) can be programmed relatively to the st10f280 cpu clock. this allows adjusting the a/d converter of the st10f280 to the properties of the system: fast conversion can be achieved by programming the respective times to their absolute possible minimum. this is preferable for scanning high frequency signals. the internal resistance of analog source and analog supply must be sufficiently low, however. high internal resistance can be achieved by programming the respective times to a higher value, or the possible maximum. this is preferable when using analog sources and supply with a high internal resistance in order to keep the current as low as possible. however, the conversion rate in this case may be considerably lower. the conversion times are programmed via the upper four bit of register adcon. bit field adctc (conversion time control) selects the basic conversion clock t cc , used for the 14 steps of converting. the sample time t s is a multiple of this conversion time and is selected by bit field adstc (sample time control). the table below lists the possible combinations. the timings refer to the unit tcl, where f cpu = 1/2 tcl. 7. dnl, inl, tue are tested at v aref =5.0v, v agnd =0v, v cc = 4.9v. it is guaranteed by design characterization for all other voltages within the defined voltage range. ?lsb? has a value of v aref / 1024. the specified tue is guaranteed onl y if an overload condition (see i ov specification) occurs on maximum 2 not selected analog input pins and the absolute sum of input overload currents on all analog input pins does not exceed 10ma. 8. the coupling factor is measured on a channel while an overload condition occurs on the adjacent not selected channel with an absolute overload current less than 10ma. table 44. adc sampling and conversion timing adctc conversion clock t cc adstc sample clock t sc tcl = 1/2 x f xtal at f cpu = 40mhz t sc = at f cpu = 40mhz and adctc = 00 00 tcl x 24 0.3 s00t cc 0.3 s 01 reserved, do not use reserved 01 t cc x 2 0.6 s 10 tcl x 96 1.2 s10t cc x 4 1.2 s 11 tcl x 48 0.6 s11t cc x 8 2.4 s
electrical characteristics st10f280 210/239 doc id 8673 rev. 3 a complete conversion will take 14 t cc + 2 t sc + 4 tcl (fastest conversion rate = 4.85 s at 40mhz). this time includes the conversion itself, the sample time and the time required to transfer the digital value to the result register. 20.4 ac characteristics 20.4.1 test waveforms figure 75. input / output waveforms figure 76. float waveforms 20.4.2 definition of internal timing the internal operation of the st10f280 is controlled by the internal cpu clock f cpu . both edges of the cpu clock can trigger internal (for example pipeline) or external (for example bus cycles) operations. the specification of the external timing (ac characteristics) therefore depends on the time between two consecutive edges of the cpu clock, called ?tcl?. the cpu clock signal can be generated by different mechanisms. the duration of tcl and its variation (and also the derived external timing) depends on the mechanism used to generate f cpu . this influence must be regarded when calculating the timings for the st10f280. the example for pll operation shown in figure 73 refers to a pll factor of 4. 9 9 7h vw3rlqwv 9 ''  9 ''  9 ''   9 ''  $&lqsxwvgxulqjwhvwlqjduhgulyhqdw9irudorjlf?dqg 9irudorjlf? 7lplqjphdvxuhphqwvduhpdghdw9 ,+ plqirudorjlf?dqg9 ,/ pd[irudorjlf? ("1($'5 7lplqj 5hihuhqfh 3rlqwv 9 /rdg 9 9 /rdg 9 9 2+ 9 9 2/ 9 9 /rdg 9 2/ 9 2+ )ruwlplqjsxusrvhvdsruwslqlvqrorqjhuiordwlqjzkhq9 /2$' fkdqjhvri?p9 ,wehjlqvwriordwzkhqdp9fkdqjhiurpwkhordghg9 2+ 9 2/ ohyhorffxuv , 2+ , 2/  p$  ("1($'5
st10f280 electrical characteristics doc id 8673 rev. 3 211/239 the mechanism used to generate the cpu clock is selected during reset by the logic levels on pins p0.15-13 (p0h.7-5). figure 77. generation mechanisms for the cpu clock 20.4.3 clock ge neration modes the table 45 associates the combinations of these three bit with the respective clock generation mode. 7&/ 7&/ i &38 i ;7$/ i &38 i ;7$/ 3kdvhorfnhgorrsrshudwlrq 'luhfw&orfn'ulyh 7&/ 7&/ i &38 i ;7$/ 3uhvfdohu2shudwlrq 7&/ 7&/ ("1($'5 table 45. cpu frequency generation p0h.7 p0h.6 p0h.5 cpu frequency f cpu = f xtal x f external clock input range (1) notes 11 1 f xtal x 4 2.5 to 10mhz default configuration 11 0 f xtal x 3 3.33 to 13.33mhz 10 1 f xtal x 2 5 to 20mhz 10 0 f xtal x 5 2 to 8mhz 01 1 f xtal x 1 1 to 40mhz direct drive (2)(3) 01 0 f xtal x 10 1 to 4mhz 00 1 f xtal x 0.5 2 to 80mhz cpu clock via prescaler (4) 00 0 f xtal x 2.5 4 to 16mhz 1. the external clock input range refers to a cpu clock range of 1...40mhz. 2. the maximum depends on the duty cycle of the external clock signal. 3. the pll free-running frequency is from 2 to 10mhz.
electrical characteristics st10f280 212/239 doc id 8673 rev. 3 20.4.4 prescaler operation when pins p0.15-13 (p0h.7-5) equal ?001? during reset, the cpu clock is derived from the internal oscillator (input clock signal) by a 2:1 prescaler. the frequency of f cpu is half the frequency of f xtal and the high and low time of f cpu (i.e. the duration of an individual tcl) is defined by the period of the input clock f xtal . the timings listed in the ac characteristics that refer to tcl therefore can be calculated using the period of f xtal for any tcl. note that if the bit owddis in syscon register is cleared, the pll runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. if bit owddis is set, then the pll is switched off. 20.4.5 direct drive when pins p0.15-13 (p0h.7-5) equal ?011? during reset the on-chip phase locked loop is disabled and the cpu clock is directly driven from the internal oscillator with the input clock signal. the frequency of f cpu directly follows the frequency of f xtal so the high and low time of f cpu (i.e. the duration of an individual tcl) is defined by the duty cycle of the input clock f xtal . therefor, the timings given in this chapter refer to the minimum tcl. this minimum value can be calculated by the following formula: for two consecutive tcls, the deviation caused by the duty cycle of f xtal is compensated, so the duration of 2 tcl is always 1/f xtal . the minimum value tcl min has to be used only once for timings that require an odd number of tcls (1,3,...). timings that require an even number of tcls (2,4,...) may use the formula: note: the address float timings in multiplexed bus mode (t 11 and t 45 ) use the maximum duration of tcl (tcl max = 1/f xtal x dc max ) instead of tcl min . if the bit owddis in syscon register is cleared, the pll runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. if bit owddis is set, then the pll is switched off. 4. the maximum input frequency is 25mhz when using an external crysta l with the internal oscillato r; providing that internal serial resistance of the crystal is less than 40 . however, higher frequencies can be appli ed with an external clock source on pin xtal1, but in this case, the input clock signal must reach the defined levels v il and v ih2. . tcl min 1f ? xt al l x l dc min = dc duty cycle = 2tcl 1 f xtal ? =
st10f280 electrical characteristics doc id 8673 rev. 3 213/239 20.4.6 oscillator watchdog (owd) an on-chip watchdog oscillator is implemented in the st10f280. this feature is used for safety operation with external crystal oscillator (using direct drive mode with or without prescaler). this watchdog oscillator operates as following: the reset default configuration enables the watchdog oscillator. it can be disabled by setting the owddis (bit 4) of syscon register. when the owd is enabled, the pll runs at its free-running frequency, and it increments the watchdog counter. the pll free-running frequency is from 2 to 10mhz. on each transition of external clock, the watchdog counter is cleared. if an external clock failure occurs, then the watchdog counter overflows (after 16 pll clock cycles). the cpu clock signal will be switched to the pll free-running clock signal, and the oscillator watchdog interrupt request (xp3int) is flagged. the cpu clock will not switch back to the external clock even if a valid external clock exits on xtal1 pin. only a hardware reset can switch the cpu clock source back to direct clock input. when the owd is disabled, the cpu clock is always external oscillator clock and the pll is switched off to decrease consumption supply current. 20.4.7 phase locked loop for all other combinations of pins p0.15-13 (p0h.7-5) during reset the on-chip phase locked loop is enabled and it provides the cpu clock (see ta b l e 4 5 ). the pll multiplies the input frequency by the factor f which is selected via the combination of pins p0.15-13 (f cpu = f xtal x f). with every f?th transition of f xtal the pll circuit synchronizes the cpu clock to the input clock. this synchronization is done smoothly, so the cpu clock frequency does not change abruptly. due to this adaptation to the input clock the frequency of f cpu is constantly adjusted so it is locked to f xtal . the slight variation causes a jitter of f cpu which also effects the duration of individual tcls. the timings listed in the ac characteristics that refer to tcls therefore must be calculated using the minimum tcl that is possible under the respective circumstances. the real minimum value for tcl depends on the jitter of the pll. the pll tunes f cpu to keep it locked on f xtal . the relative deviation of tcl is the maximum when it is referred to one tcl period. it decreases according to the formula and to the figure 74 given below. for n periods of tcl the minimum value is computed using the corresponding deviation d n : where n = number of consecutive tcl periods and 1 n 40. so for a period of 3 tcl periods (n = 3): d 3 = 4 - 3/15 = 3.8% 3tcl min = 3 tcl nom x (1 - 3.8/100) = 3 tcl nom x 0.962 3tcl min = (36.075ns at f cpu = 40mhz) tcl min tcl nom 1 d n 100 ------------- ? ?? ?? ?? ?? = d n 4n15 ) % [] ? ? ( =
electrical characteristics st10f280 214/239 doc id 8673 rev. 3 this is especially important for bus cycles using wait states and e.g. for the operation of timers, serial interfaces, etc. for all slower operations a nd longer periods (e.g. pulse train generation or measurement, lower baud rates, etc.) the deviation caused by the pll jitter is negligible. figure 78. approximated maximum pll jitter 20.4.8 external clock drive xtal1 v dd = 5 v 10%, v ss = 0 v, t a = -40c to 125 c      ? ? ? ? 0d[mlwwhu>@ 1 7klvdssur[lpdwhgirupxodlvydolgiru  d 1 d dqg0+] d i &38 d 0+] ("1($'5 table 46. external clock drive xtal1 parameter symbol f cpu = f xtal f cpu = f xtal / 2 f cpu = f xtal x f f = 2 / 2.5 / 3 / 4 / 5 / 10 unit min. max. min. max. min. max. oscillator period t osc sr 25 (1) 1. theoretical minimum. the real minimum value depends on the duty cycle of the input clock signal. 25mhz is the maximum input frequency when us ing an external crystal oscillator. however, 40mhz can be applied with an external clock source. ? 12.5 ? 40 x n 100 x n ns high time t 1 sr 10 (2) 2. the input clock signal must reach the defined levels v il and v ih2 ?5 (2) ?10 (2) ?ns low time t 2 sr 10 (2) ?5 (2) ?10 (2) ?ns rise time t 3 sr ? 3 (2) ?3 (2) ?3 (2) ns fall time t 4 sr ? 3 (2) ?3 (2) ?3 (2) ns
st10f280 electrical characteristics doc id 8673 rev. 3 215/239 figure 79. external clock drive xtal1 20.4.9 memory cycle variables the tables below use three variables which are derived from the busconx registers and represent the special characteristics of the programmed memory cycle. the following table describes, how these variables are to be computed. 20.4.10 multiplexed bus v dd = 5 v 10%, v ss = 0 v, t a = -40c to +125c, c l = 50 pf, ale cycle time = 6 tcl + 2 t a + t c + t f (75 ns at 40 mhz cpu clock without wait states). w  w  w  9 ,+ w  w 26& 9 ,/ ("1($'5 table 47. memory cycle variables description symbol values ale extension t a tcl x [alectl] memory cycle time wait states t c 2 tcl x (15 - [mctc]) memory tri-state time t f 2 tcl x (1 - [mttc]) table 48. multiplexed bus characteristics symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 5 cc ale high time 4 + t a ?tcl - 8.5 + t a ?ns t 6 cc address setup to ale 2 + t a ? tcl - 10.5 + t a ?ns t 7 cc address hold after ale (1) 4 + t a ?tcl - 8.5 + t a ?ns t 8 cc ale falling edge to rd , wr (with r/w-delay) 4 + t a ?tcl - 8.5 + t a ?ns t 9 cc ale falling edge to rd , wr (no r/w-delay) -8.5 + t a ?-8.5 + t a ?ns t 10 cc address float after rd , wr (with r/w-delay) (1) ?6 ? 6ns t 11 cc address float after rd , wr (no r/w-delay) (1) ? 18.5 ? tcl + 6 ns t 12 cc rd , wr low time (with r/w- delay) 15.5 + t c ?2 tcl -9.5 + t c ?ns
electrical characteristics st10f280 216/239 doc id 8673 rev. 3 t 13 cc rd , wr low time (no r/w- delay) 28 + t c ?3 tcl -9.5 + t c ?ns t 14 sr rd to valid data in (with r/w-delay) ?6 + t c ?2 tcl - 19 + t c ns t 15 sr rd to valid data in (no r/w- delay) ? 18.5 + t c ?3 tcl - 19 + t c ns t 16 sr ale low to valid data in ? 18.5 + t a + t c ? 3 tcl - 19 + t a + t c ns t 17 sr address/unlatched cs to valid data in ?22 + 2t a + t c ? 4 tcl - 28 + 2t a + t c ns t 18 sr data hold after rd rising edge 0? 0 ?ns t 19 sr data float after rd (1) ? 16.5 + t f ? 2 tcl - 8.5 + t f ns t 22 cc data valid to wr 10 + t c ? 2 tcl -15 + t c ?ns t 23 cc data hold after wr 4 + t f ? 2 tcl - 8.5 + t f ?ns t 25 cc ale rising edge after rd , wr 15 + t f ? 2 tcl -10 + t f ?ns t 27 cc address/unlatched cs hold after rd , wr 10 + t f ? 2 tcl -15 + t f ?ns t 38 cc ale falling edge to latched cs -4 - t a 10 - t a -4 - t a 10 - t a ns t 39 sr latched cs low to valid data in ? 18.5 + t c + 2t a ? 3 tcl - 19 + t c + 2t a ns t 40 cc latched cs hold after rd , wr 27 + t f ? 3 tcl - 10.5 + t f ?ns t 42 cc ale fall. edge to rdcs , wrcs (with r/w delay) 7 + t a ? tcl - 5.5+ t a ?ns t 43 cc ale fall. edge to rdcs , wrcs (no r/w delay) -5.5 + t a ?-5.5 + t a ?ns t 44 cc address float after rdcs , wrcs (with r/w delay) (1) ?0 ? 0ns t 45 cc address float after rdcs , wrcs (no r/w delay) (1) ?12.5 ? tclns t 46 sr rdcs to valid data in (with r/w delay) ?4 + t c ?2 tcl - 21 + t c ns t 47 sr rdcs to valid data in (no r/w delay) ? 16.5 + t c ?3 tcl - 21 + t c ns t 48 cc rdcs , wrcs low time (with r/w delay) 15.5 + t c ? 2 tcl - 9.5 + t c ?ns table 48. multiplexed bus characteristics (continued) symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max.
st10f280 electrical characteristics doc id 8673 rev. 3 217/239 t 49 cc rdcs , wrcs low time (no r/w delay) 28 + t c ? 3 tcl - 9.5 + t c ?ns t 50 cc data valid to wrcs 10 + t c ? 2 tcl - 15+ t c ?ns t 51 sr data hold after rdcs 0? 0 ?ns t 52 sr data float after rdcs (1) ? 16.5 + t f ? 2 tcl - 8.5+t f ns t 54 cc address hold after rdcs , wrcs 6 + t f ? 2 tcl - 19 + t f ?ns t 56 cc data hold after wrcs 6 + t f ? 2 tcl - 19 + t f ?ns 1. partially tested, guaranteed by design characterization. table 48. multiplexed bus characteristics (continued) symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max.
electrical characteristics st10f280 218/239 doc id 8673 rev. 3 figure 80. external memory cycle: multiplexed bus, with / without read / write delay, normal ale data in data out address address t 38 t 10 read cycle write cycle t 5 t 16 t 39 t 40 t 25 t 27 t 18 t 14 t 22 t 23 t 12 t 8 t 8 t 6m t 19 address t 17 t 6 t 7 t 9 t 11 t 13 t 15 t 16 t 12 t 13 address t 9 t 17 t 6 t 27 clkout ale csx a23-a16 (a15-a8) a ddress/data rd wr wrl bhe wrh bus (p0) address/data bus (p0) gapgcft00934
st10f280 electrical characteristics doc id 8673 rev. 3 219/239 figure 81. external memory cycle: multiplexed bus, with / without read / write delay, extended ale data out address data in address address t 5 t 16 t 6 t 7 t 39 t 40 t 14 t 8 t 18 t 23 t 6 t 27 t 38 t 10 t 19 t 25 t 17 t 9 t 11 t 15 t 12 t 13 t 8 t 10 t 9 t 11 t 12 t 13 t 22 t 27 t 17 t 6 read cycle write cycle clkout ale csx a23-a16 (a15-a8) rd wr wrl bhe wrh address/data bus (p0) address/data bus (p0) gapgcft00935
electrical characteristics st10f280 220/239 doc id 8673 rev. 3 figure 82. external memory cycle: multiplexed bus, with / without read / write delay, normal ale, read / write chip select read cycle write cycle clkout ale a23-a16 (a15-a8) bhe data in data out address address t 44 t 5 t 16 t 25 t 27 t 51 t 46 t 50 t 56 t 48 t 42 t 42 t 6 t 52 address t 17 t 6 t 7 t 43 t 45 t 49 t 47 t 16 t 48 t 49 address t 43 rdcsx wrcsx address/data bus (p0) address/data bus (p0) gapgcft00936
st10f280 electrical characteristics doc id 8673 rev. 3 221/239 figure 83. external memory cycle: multiplexed bus, with / without read / write delay, extended ale, read / write chip select data out address data in address address t 5 t 16 t 6 t 7 t 46 t 42 t 42 t 50 t 18 t 56 t 6 t 54 t 44 t 19 t 25 t 17 t 43 t 45 t 47 t 48 t 49 t 49 t 43 t 48 t 44 t 45 read cycle write cycle clkout ale a23-a16 (a15-a8) bhe rdcsx wrcsx address/data bus (p0) address/data bus (p0) gapgcft00937
electrical characteristics st10f280 222/239 doc id 8673 rev. 3 20.4.11 demultiplexed bus v dd = 5 v 10%, v ss = 0 v, t a = -40c to 125c, c l = 50 pf, ale cycle time = 4 tcl + 2t a + t c + t f (50 ns at 40 mhz cpu clock without wait states). table 49. demultiplexed bus characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 5 cc ale high time 4 + t a ?tcl - 8.5 + t a ?ns t 6 cc address setup to ale 2 + t a ? tcl - 10.5 + t a ?ns t 80 cc address/unlatched cs setup to rd , wr (with r/w-delay) 16.5 + 2t a ? 2 tcl - 8.5 + 2t a ?ns t 81 cc address/unlatched cs setup to rd , wr (no r/w- delay) 4 + 2t a ? tcl - 8.5 + 2t a ?ns t 12 cc rd , wr low time (with r/w-delay) 15.5 + t c ? 2 tcl - 9.5 + t c ?ns t 13 cc rd , wr low time (no r/w- delay) 28 + t c ? 3 tcl - 9.5 + t c ?ns t 14 sr rd to valid data in (with r/w-delay) ?6 + t c ? 2 tcl - 19 + t c ns t 15 sr rd to valid data in (no r/w-delay) ? 18.5 + t c ? 3 tcl - 19 + t c ns t 16 sr ale low to valid data in ? 18.5 + t a + t c ? 3 tcl - 19 + t a + t c ns t 17 sr address/unlatched cs to valid data in ? 22 + 2t a + t c ? 4 tcl - 28 + 2t a + t c ns t 18 sr data hold after rd rising edge 0? 0 ?ns t 20 sr data float after rd rising edge (with r/w-delay) (1)(2) ?16.5 + t f ? 2 tcl - 8.5 + t f + 2t a 1 ns t 21 sr data float after rd rising edge (no r/w-delay) (1)(2) ?4 + t f ? tcl - 8.5 + t f + 2t a 1 ns t 22 cc data valid to wr 10 + t c ? 2 tcl - 15 + t c ?ns t 24 cc data hold after wr 4 + t f ?tcl - 8.5 + t f ?ns t 26 cc ale rising edge after rd , wr -10 + t f ?-10 + t f ?ns t 28 cc address/unlatched cs hold after rd , wr (3) 0 (no t f ) -5 + t f (t f > 0) ? 0 (no t f ) -5 + t f (t f > 0) ?ns t 28h cc address/unlatched cs hold after wrh -5 + t f ?-5 + t f ?ns
st10f280 electrical characteristics doc id 8673 rev. 3 223/239 t 38 cc ale falling edge to latched cs -4 - t a 6 - t a -4 - t a 6 - t a ns t 39 sr latched cs low to valid data in ? 18.5 + t c + 2t a ? 3 tcl - 19 + t c + 2t a ns t 41 cc latched cs hold after rd , wr 2 + t f ? tcl - 10.5 + t f ?ns t 82 cc address setup to rdcs , wrcs (with r/w-delay) 14.5 + 2t a ? 2 tcl - 10.5 + 2t a ?ns t 83 cc address setup to rdcs , wrcs (no r/w-delay) 2 + 2t a ? tcl - 10.5 + 2t a ?ns t 46 sr rdcs to valid data in (with r/w-delay) ?4 + t c ? 2 tcl - 21 + t c ns t 47 sr rdcs to valid data in (no r/w-delay) ? 16.5 + t c ? 3 tcl - 21 + t c ns t 48 cc rdcs , wrcs low time (with r/w-delay) 15.5 + t c ? 2 tcl - 9.5 + t c ?ns t 49 cc rdcs , wrcs low time (no r/w-delay) 28 + t c ? 3 tcl - 9.5 + t c ?ns t 50 cc data valid to wrcs 10 + t c ? 2 tcl - 15 + t c ?ns t 51 sr data hold after rdcs 0? 0 ?ns t 53 sr data float after rdcs (with r/w-delay) (2) ?16.5 + t f ? 2 tcl - 8.5 + t f ns t 68 sr data float after rdcs (no r/w-delay) (2) ?4 + t f ? tcl - 8.5 + t f ns t 55 cc address hold after rdcs , wrcs -8.5 + t f ?-8.5 + t f ?ns t 57 cc data hold after wrcs 2 + t f ? tcl - 10.5 + t f ?ns 1. r/w-delay and t a refer to the next following bus cycle. 2. partially tested, guaranteed by design characterization. 3. read data are latched with the same clock edge that triggers the address change and the rising rd edge. therefore address changes before the end of rd have no impact on read cycles. table 49. demultiplexed bus characteristics (continued) symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max.
electrical characteristics st10f280 224/239 doc id 8673 rev. 3 figure 84. external memory cycle: demultiplexed bus, with / without read / write delay, normal ale 1. un-latched csx = t 41u = t 41 tcl =10.5 + t f . write cycle clkout ale a23-a16 a15-a0 (p1) bhe wr wrl wrh data in data out t 38 t 5 t 16 t 39 t 41 t 18 t 14 t 22 t 12 address t 17 t 13 t 15 t 12 t 13 t 21 t 20 t 81 t 80 t 26 t 24 t 17 t 6 t 41u t 6 t 80 t 81 t 28 (or t 28h ) csx read cycle data bus (p0) rd 1) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 gapgcft00938
st10f280 electrical characteristics doc id 8673 rev. 3 225/239 figure 85. external memory cycle: demultiplexed bus, with / without read / write delay, extended ale address t 5 t 16 t 39 t 41 t 14 t 24 t 6 t 38 t 20 t 26 t 17 t 15 t 12 t 13 t 12 t 13 t 22 data in t 18 t 21 t 6 t 17 t 28 t 28 data out t 80 t 81 t 80 t 81 read cycle write cycle clkout ale csx rd wr wrl wrh data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe gapgcft00939
electrical characteristics st10f280 226/239 doc id 8673 rev. 3 figure 86. external memory cycle: demultiplexed bus, with / without read / write delay, normal ale, read / write chip select read cycle write cycle clkout ale data in data out t 5 t 16 t 51 t 46 t 50 t 48 address t 17 t 49 t 47 t 48 t 49 t 68 t 53 t 83 t 82 t 26 t 57 t 55 t 6 t 82 t 83 rdcsx wrcsx data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe gapgcft00940
st10f280 electrical characteristics doc id 8673 rev. 3 227/239 figure 87. external memory cycle: demultiplexed bus, no read / write delay, extended ale, read /write chip select 20.4.12 clkout and ready v dd = 5 v 10%, v ss = 0 v, t a = -40c to 125c, c l = 50 pf address t 5 t 16 t 46 t 57 t 6 t 53 t 26 t 17 t 47 t 48 t 49 t 48 t 49 t 50 data in t 51 t 68 t 55 data out t 82 t 83 t 82 t 83 read cycle write cycle clkout ale rdcsx wrcsx data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe gapgcft00941 table 50. clkout and ready characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 29 cc clkout cycle time 25 25 2 tcl 2tcl ns t 30 cc clkout high time 4 ? tcl ? 8.5 ? ns t 31 cc clkout low time 3 ? tcl ? 9.5 ? ns t 32 cc clkout rise time ? 4 ? 4 ns t 33 cc clkout fall time ? 4 ? 4 ns
electrical characteristics st10f280 228/239 doc id 8673 rev. 3 t 34 cc clkout rising edge to ale falling edge -2 + t a 8 + t a -2 + t a 8 + t a ns t 35 sr synchronous ready setup time to clkout 12.5 ? 12.5 ? ns t 36 sr synchronous ready hold time after clkout 2? 2 ?ns t 37 sr asynchronous ready low time 35 ? 2 tcl + 10 ? ns t 58 sr asynchronous ready setup time (1) 12.5 ? 12.5 ? ns t 59 sr asynchronous ready hold time (1) 2? 2 ?ns t 60 sr asynchronous ready hold time after rd , wr high (demultiplexed bus) (2) 0 0 + 2t a + t c + t f (2) 0 tcl - 12.5 + 2t a + t c + t f (2) ns 1. these timings are given for test purposes only, in order to assure recognition at a specific clock edge. 2. demultiplexed bus is the worst case. for multiple xed bus 2 tcl are to be added to the maximum values. this adds even more time for deactivating ready. the 2t a and t c refer to the next following bus cycle, t f refers to the current bus cycle. table 50. clkout and ready characteristics (continued) symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max.
st10f280 electrical characteristics doc id 8673 rev. 3 229/239 figure 88. clkout and ready 1. cycle as programmed, including mctc wait states (example shows 0 mctc ws). 2. the leading edge of the respective command depends on r/w-delay. 3. ready sampled high at this sampling point generates a ready controlled wait state, ready sampled low at this sampling point terminates the currently running bus cycle. 4. ready may be deactivated in response to the traili ng (rising) edge of the corresponding command (rd or wr ). 5. if the asynchronous ready signal does not fulfill the indicated setup and hold times with respect to clkout (e.g. because clkout is not enabled), it must fulfill t 37 in order to be safely synchronized. this is guaranteed, if ready is removed in response to the command (see note 4)). 6. multiplexed bus modes have a mux wait state added after a bus cycle, and an additional mttc wait state may be inserted here. for a multiplexed bus with mttc wait state this delay is 2 clkout cycles, for a demultiplexed bus without mttc wait state this delay is zero. 7. the next external bus cycle may start here. 20.4.13 external bus arbitration v dd = 5 v 10%, v ss = 0 v, t a = -40c to 125c, c l = 50 pf t 30 t 34 t 35 t 36 t 35 t 36 t 58 t 59 t 58 t 59 wait state ready mux / tri-state 6) t 32 t 33 t 29 running cycle 1) t 31 t 37 3) 3) 5) t 60 4) 6) 2) 7) 3) 3) clkout ale rd , wr synchronous asynchronous ready ready gapgcft00942 table 51. external bus arbitration symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 61 sr hold input setup time to clkout 15 ? 15 ? ns t 62 cc clkout to hlda high or breq low delay ? 12.5 ? 12.5 ns t 63 cc clkout to hlda low or breq high delay ? 12.5 ? 12.5 ns
electrical characteristics st10f280 230/239 doc id 8673 rev. 3 figure 89. external bus arbitration, releasing the bus 1. the st10f280 will complete the currently r unning bus cycle before granting bus access. 2. this is the first possibility for breq to become active. 3. the cs outputs will be resistive high (pull-up) after t 64 . t 64 cc csx release (1) ?15 ? 15ns t 65 cc csx drive -4 15 -4 15 ns t 66 cc other signals release (1) ?15 ? 15ns t 67 cc other signals drive -4 15 -4 15 ns 1. partially tested, guaranteed by design characterization table 51. external bus arbitration (continued) symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 61 t 63 t 66 1) t 64 1) 2) t 62 3) clkout hold hlda breq others csx (p6.x) gapgcft00943
st10f280 electrical characteristics doc id 8673 rev. 3 231/239 figure 90. external bus arbitration, (regaining the bus) 1. 1. this is the last chance for breq to trigger the indicated regain-sequence. even if breq is activated earlier, the regain-sequenc e is initiated by hold going high. please note that hold may also be deactivated without the st10f280 requesting the bus 2. the next st10f280 driven bus cycle may start here. 20.4.14 high-speed sy nchronous serial interface (ssc) timing master mode v cc = 5 v 10%, v ss = 0 v, cpu clock = 40 mhz, t a = -40c to 125c, c l = 50 pf clkout hold hlda other signals t 62 csx (on p6.x) t 67 t 62 1) 2) t 65 t 61 breq t 63 t 62 gapgcft00944 table 52. ssc master timing symbol parameter maximum baud rate = 10m baud ( = 0001h) variable baud rate (=0001h- ffffh) unit min. max. min. max. t 300 cc ssc clock cycle time 100 100 8 tcl 262144 tcl ns t 301 cc ssc clock high time 40 ? t 300 /2 - 10 ? ns t 302 cc ssc clock low time 40 ? t 300 /2 - 10 ? ns t 303 cc ssc clock rise time ? 10 ? 10 ns t 304 cc ssc clock fall time ? 10 ? 10 ns t 305 cc write data valid after shift edge ? 15 ? 15 ns t 306 cc write data hold after shift edge (1) -2 ? -2 ? ns
electrical characteristics st10f280 232/239 doc id 8673 rev. 3 the formula for ssc clock cycle time is: t 300 = 4 tcl * ( + 1) where represents the content of the ssc baud rate register, taken as unsigned 16-bit integer. figure 91. ssc master timing 1. the phase and polarity of shift and latch edge of sclk is programmable. this figure uses the leading clock edge as shift edge (drawn in bold), with latch on trailing edge (sscph = 0b), idle clock line is low, leading clock edge is low-to-high transition (sscpo = 0b). 2. the bit timing is repeated for all bits to be transmitted or received. t 307p sr read data setup time before latch edge, phase error detection on (sscpen = 1) 37.5 ? 2 tcl + 12.5 ?ns t 308p sr read data hold time after latch edge, phase error detection on (sscpen = 1) 50 ? 4 tcl ? ns t 307 sr read data setup time before latch edge, phase error detection off (sscpen = 0) 25 ? 2 tcl ? ns t 308 sr read data hold time after latch edge, phase error detection off (sscpen = 0) 0?0?ns 1. timing guaranteed by design. table 52. ssc master timing (continued) symbol parameter maximum baud rate = 10m baud ( = 0001h) variable baud rate (=0001h- ffffh) unit min. max. min. max. t 303 t 304 t 305 t 305 t 305 t 306 t i b t u o t s a l t i b t u o t s 1 2nd out bit t 300 t 302 t 301 1) 2) t 307 2nd.in bit 1st.in bit t 308 t 307 last.in bit t 308 sclk mtsr mrst gapgcft00946
st10f280 electrical characteristics doc id 8673 rev. 3 233/239 slave mode v cc = 5 v 10%, v ss = 0 v, cpu clock = 40 mhz, t a = -40c to 125c, c l = 50 pf the formula for ssc clock cycle time is: t 310 = 4 tcl * ( + 1) where represents the content of the ssc baud rate register, taken as unsigned 16-bit integer. table 53. ssc slave timing symbol parameter maximum baud rate=10mbd ( = 0001h) variable baud rate (=0001h- ffffh) unit min. max. min. max. t 310 sr ssc clock cycle time 100 100 8 tcl 262144 tcl ns t 311 sr ssc clock high time 40 ? t 310 /2 - 10 ? ns t 312 sr ssc clock low time 40 ? t 310 /2 - 10 ? ns t 313 sr ssc clock rise time ? 10 ? 10 ns t 314 sr ssc clock fall time ? 10 ? 10 ns t 315 cc write data valid after shift edge ?39? 2 tcl + 14 ns t 316 cc write data hold after shift edge 0?0?ns t 317p sr read data setup time before latch edge, phase error detection on (sscpen = 1) 62 ? 4 tcl + 12 ?ns t 318p (1) 1. timing guaranteed by design. sr read data hold time after latch edge, phase error detection on (sscpen = 1) 87 ? 6 tcl + 12 ?ns t 317 sr read data setup time before latch edge, phase error detection off (sscpen = 0) 6?6?ns t 318 sr read data hold time after latch edge, phase error detection off (sscpen = 0) 31 ? 2 tcl + 6 ? ns
electrical characteristics st10f280 234/239 doc id 8673 rev. 3 figure 92. ssc slave timing 1. the phase and polarity of shift and latch edge of sclk is programmable. this figure uses the leading clock edge as shift edge (drawn in bold), with latch on trailing edge (sscph = 0b), idle clock line is low, leading clock edge is low-to-high transition (sscpo = 0b). 2. the bit timing is repeated for all bits to be transmitted or received. t 313 t 314 t 315 t 315 t 315 t 316 t i b t u o t s a l t i b t u o t s 12nd out bit t 310 t 312 t 311 1) 2) t 317 2nd.in bit 1st.in bit t 318 t 317 last.in bit t 318 sclk mrst mtsr gapgcft00947
st10f280 package information doc id 8673 rev. 3 235/239 21 package information 21.1 ecopack ? in order to meet environmental requirements, st offers these devices in different grades of ecopack ? packages, depending on their level of environmental compliance. ecopack ? specifications, grade definitions and product status are available at: www.st.com . ecopack ? is an st trademark. 21.2 pbga 208 (23 x 23 x 1.96 mm) mechanical data figure 93. package outline pbga 208 (23 x 23 x 1.96 mm) 1. pbga stands for plastic ball grid array. 2. the terminal a1 corner must be identified on the top surface of the package by us ing a corner chamfer, ink or metallized markings, identation or other feature of package body or integral heastslug. a distinguishing feature is allowable on the bottom of the package to identify the terminal a1 corner. exact shape and size of this feature is optional. a1 e1 b (208 + 25 balls) u t r p n m l k 10 11 12 13 14 15 16 17 000 6789 j g f h e d b a c 45 123 a1 ball pad corner 2 f e e e d1 d f a2 a3 c seating plane a c
package information st10f280 236/239 doc id 8673 rev. 3 table 54. pbga 208 (23 x 23 x 1.96 mm) mechanical data dimensions millimeters inches (approx) min. typ. max. min. typ. max. a 1.960 0.077 a1 0.500 0.600 0.700 0.019 0.024 0.028 a2 1.360 0.054 a3 0.560 0.022 b 0.600 0.760 0.900 0.024 0.030 0.035 d 22.900 23.000 23.100 0.902 0.906 0.909 d1 20.320 0.800 e 22.900 23.000 23.100 0.902 0.906 0.909 e1 20.320 0.800 e 1.270 0.50 f 1.240 1.340 1.440 0.049 0.053 0.057 aaa 0.150 0.006
st10f280 ordering information doc id 8673 rev. 3 237/239 22 ordering information table 55. device summary order codes package packing temperature range st10f280 pbga 208 (23 x 23 x 1.96 mm) tr ay -40c to +125c st10f280-q3tr tape and reel
revision history st10f280 238/239 doc id 8673 rev. 3 23 revision history table 56. document revision history date revision changes 13-mar-2003 1 initial release. 29-may-2008 2 changed document template. 20-aug-2012 3 changed document template. updated table 55: device summary
st10f280 doc id 8673 rev. 3 239/239 please read carefully: information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries (?st ?) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described he rein at any time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st as sumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. i f any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoev er of such third party products or services or any intellectual property contained therein. unless otherwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a particular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. unless expressly approved in writing by two authorized st representatives, st products are not recommended, authorized or warranted for use in military, air craft, space, life saving, or life sustaining applications, nor in products or systems where failure or malfunction may result in personal injury, death, or severe property or environmental damage. st products which are not specified as "automotive grade" may only be used in automotive applications at user?s own risk. resale of st products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoev er, any liability of st. st and the st logo are trademarks or register ed trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2012 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 - philippines - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com


▲Up To Search▲   

 
Price & Availability of ST10F28012

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