background image

ST10R272L - CENTRAL PROCESSING UNIT

65/320

and should never be user modified. Otherwise, a correct continuation of an 
interrupted multiply or divide operation cannot be guaranteed.

MDC (FF0Eh / 87h) 

SFR

Reset Value: 0000h   

The constant zeros register ZEROS 

All bits of this bit-addressable register are fixed to ’0’, by hardware. This register is read-only. 
Register ZEROS can be used as a register-addressable constant of all zeros, i.e. for bit 
manipulation or mask generation. It can be accessed via any instruction capable of 
addressing a SFR.

The constant ones register ONES 

All bits of this bit-addressable register are fixed to ’1’, by hardware. This register is read-only. 
Register ONES can be used as a register-addressable constant of all ones, i.e. for bit 

Bit

Function

MDRIU

Multiply/Divide Register In Use

‘0’:

Cleared, when register MDL is read via software.

‘1’:

Set when register MDL or MDH is written via software, or when a multiply or 
divide instruction is executed.

!!

Internal Machine Status

The multiply/divide unit uses these bits to control internal operations.
Never modify these bits without saving and restoring register MDC.

-

!!

-

-

5

4

3

2

1

0

11

10

9

8

7

6

15

14

13

12

-

r(w

-

-

-

-

-

-

-

-

!!

!!

!!

!!

!!

!!

-

-

-

-

r(w

r(w

r(w

r(w

r(w

r(w

r(w

MDR

IU

Содержание ST10R272L

Страница 1: ...ST10R272L USER S MANUAL Release 1 0...

Страница 2: ...and interrupt control 15 2 2 2 Memory areas 15 2 2 3 External bus interface 16 2 3 SYSTEM CLOCK GENERATOR 17 2 3 1 PLL operation 19 2 3 2 Prescaler operation 19 2 3 3 Direct drive 19 2 3 4 Oscillator...

Страница 3: ...stem configuration register SYSCON 47 5 MULTIPLY ACCUMULATE UNIT MAC 67 5 1 MAC FEATURES 68 5 2 MAC OPERATION 69 5 2 1 Instruction pipelining 69 5 2 2 Address generation 70 5 2 3 16 x 16 signed unsign...

Страница 4: ...PONSE TIMES 98 6 7 PEC RESPONSE TIMES 100 6 8 EXTERNAL INTERRUPTS 102 6 8 1 Fast external interrupts 103 6 9 TRAPS 105 6 9 1 Software traps 105 6 9 2 Hardware traps 105 6 9 3 Trap flag register 106 6...

Страница 5: ...S MODES 146 9 2 1 Multiplexed bus modes 147 9 2 2 Demultiplexed bus modes 148 9 2 3 Switching between bus modes 149 9 2 4 External data bus width 151 9 2 5 Disable enable control for pin BHE BYTDIS 15...

Страница 6: ...3Single shot mode 182 10 2 PWM MODULE REGISTERS 185 10 2 1Up down counter PT3 185 10 2 2Period register PP3 185 10 2 3Pulse width register PW3 186 10 2 4PWM control register PWMCON0 186 10 2 5PWM con...

Страница 7: ...gister 1 SSPCON1 242 13 2 3SSP transmit buffer registers SSPTBx 243 13 2 4Initialization 244 13 2 5Starting a transfer 244 13 2 6Performing a Write Operation 245 13 2 7Chip enable lines 247 13 2 8Usin...

Страница 8: ...RESET 270 15 10APPLICATION SPECIFIC INITIALIZATION ROUTINE 271 15 10 1System start up configuration 272 15 10 2Emulation mode 273 15 10 3Adapt mode 274 15 10 4System clock configuration 274 15 10 5Ex...

Страница 9: ...nal system stack 304 18 3 2Circular virtual Stack 305 18 3 3Linear stack 308 18 3 4User stacks 308 18 4 REGISTER BANKING 308 18 5 CALL PROCEDURE ENTRY AND EXIT 309 18 5 1Passing parameters on the syst...

Страница 10: ...ew gives a general description of the ST10R272L device It describes in brief the CPU performance the on chip system resources the clock generator the peripheral blocks and the protected bits The detai...

Страница 11: ...10R272L block diagram ST10 CORE 1KByte DPRAM Interrupt Controller Port 4 Port 1 8 bit 2x8 bit Port 0 2x8 bit Port 2 4 bit Port 6 8 bit I O CS 4 0 I O HOLD HLDA BREQ A 15 0 I O D 7 0 D 15 8 D 7 0 A 15...

Страница 12: ...ores temporary data The system stack is allocated in the on chip RAM area and is accessed by the CPU via the stack pointer SP register Two separate SFRs STKOV and STKUN are compared against the stack...

Страница 13: ...l registers from the decode stage PLAs Pipeline holds are primarily caused by wait states for external memory accesses and cause a signal to be held in the control registers Multiple cycle instruction...

Страница 14: ...4 High performance branch call and loop processing Branch instructions only require one extra machine cycle when a branch is taken because the target address is pre calculated while decoding the inst...

Страница 15: ...such as GPR or data4 for immediate shift value New MAC instruction addressing modes supply the MAC with up to 2 new operands per instruction cycle These allow indirect addressing with address pointer...

Страница 16: ...which store the count value and control bits for eight data transfer channels In addition the PEC uses a dedicated area of RAM which contains the source and destination addresses The PEC is controlled...

Страница 17: ...rformed by the External Bus Controller EBC It can be programmed either 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...

Страница 18: ...en by an external oscillator The oscillator can directly feed the external clock signal to the controller hardware through buffers and divides the external clock frequency by 2 or feeds an on chip pha...

Страница 19: ...0H 7 5 CPU frequency fCPU fXTAL F Notes 1 1 1 FXTAL 4 Default configuration 1 1 0 FXTAL 3 1 0 1 FXTAL 2 1 0 0 FXTAL 5 0 1 1 FXTAL 1 Direct drive1 0 1 0 FXTAL 1 5 0 0 1 FXTAL 2 CPU clock via 2 1 presca...

Страница 20: ...an interrupt request on PLL Unlock XP3INT interrupt node This occurs when the input clock is unstable and especially when the input clock fails completely e g due to a broken crystal In this case the...

Страница 21: ...On chip peripheral blocks The ST10 family separates its peripherals from the core allowing peripherals to be added or removed without modifications to the core Each functional block processes data ind...

Страница 22: ...odified by the peripheral the software write operation has priority Further details on peripheral timing are included in the specific sections about each peripheral 2 4 3 Programming hints All SFRs ar...

Страница 23: ...where segmentation is enabled to access more than 64 KBytes of memory Port 6 provides optional bus arbitration signals BREQ HLDA HOLD and chip select signals Port 3 includes alternate functions of ti...

Страница 24: ...due to hardware or software related failures the software fails to maintain the watchdog timer it will overflow generating an internal hardware reset and pulling the RSTOUT pin low to reset external h...

Страница 25: ...IR S0EIR ASC0 receive error interrupt request flags S0CON S0REN ASC0 receiver enable flag TFR TFR 15 14 13 Class A trap flags TFR TFR 7 6 3 2 1 0 Class B trap flags XPyIC y 1 3 XPyIR y 1 3 X Periphera...

Страница 26: ...ommon address space The ST10R272L provides a total addressable memory space of 16MBytes This address space is arranged as 256 segments of 64KBytes each and each segment is subdivided into four data pa...

Страница 27: ...addresses Words are stored in ascending memory locations with the low byte at an even byte address followed by the high byte at the next odd byte address Double words code only are stored in ascending...

Страница 28: ...CE0h 00 FCFFh and the bit addressable space 00 FD00h 00 FDFFh The internal special function registers SFR are in the address range 00 FE00h 00 FFFFh and extended special function registers ESFR are in...

Страница 29: ...se sequential boundary crossing from internal RAM to the SFR area is not supported and causes erroneous results Figure 6 Internal RAM and SFR areas XSSP Data Page 0 Data Page 1 Data Page 2 Data Page 3...

Страница 30: ...hip RAM is accessed via the Stack Pointer SP register The stack grows downward from higher towards lower RAM address locations Only word accesses are supported by the system stack A stack overflow STK...

Страница 31: ...bit in the currently active register bank can be accessed individually The ST10R272L supports fast register bank context switching Multiple register banks can physically exist within the internal RAM...

Страница 32: ...urce and destination pointers selected by the specified PEC channel number is accessed independently of the current DPP register contents Also the locations referred to by these pointers are accessed...

Страница 33: ...address word SFRs and their respective low bytes However this does not work for the respective high bytes Writing to any byte of an SFR causes the non addressed complementary byte to be cleared The u...

Страница 34: ...pied by internal memory areas All addresses which are not used for on chip RAM registers or internal Xperipherals may reference external memory locations through the External Bus Interface Four memory...

Страница 35: ...dress is implicitly divided into equally sized blocks of different granularity and into logical memory areas Crossing the boundaries between these blocks code or data or areas requires special attenti...

Страница 36: ...ake sure that the highest used code location of a segment contains an unconditional branch instruction to the respective following segment Data Pages are contiguous blocks of 16KByte each They are ref...

Страница 37: ...sing one 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...

Страница 38: ...pt vector jump table PEC interrupt processing steals one machine cycle from the current CPU activity to perform a single data transfer via the on chip Peripheral Event Controller PEC System errors det...

Страница 39: ...and if required the operand addresses are calculated and respective operands are fetched For all instructions which implicitly access the system stack the SP register is either decremented or incremen...

Страница 40: ...tion which has already been fetched is not usually the instruction which must be decoded next Thus at least one additional machine cycle is normally required to fetch the branch target instruction Thi...

Страница 41: ...ns the target instruction of a jump cache instruction JMPA JMPR JB JBC JNB JNBS is also stored in the cache For subsequent execution of the same jump cache instruction the jump target instruction is n...

Страница 42: ...on which calculates a physical GPR operand address via the CP register is not usually capable of using a new CP value which is to be updated by an immediately preceding instruction Therefore to make s...

Страница 43: ...register value without erroneously performed stack accesses at least one instruction must be inserted between an explicitly SP writing and any subsequent SP using instructions as shown in the followi...

Страница 44: ...sequences should not begin directly after the instruction disabling interrupts as shown in the following example Note A delay of one instruction also applies to the enabling of the interrupt system i...

Страница 45: ...ss area should be inserted Code accesses to the new address area should be made after an absolute branch to this area Note As a rule instructions that change external bus properties should not be exec...

Страница 46: ...ps internally use a read modify write sequence that accesses the whole word This method has several consequences Bits can only be modified within the internal address areas i e internal RAM and SFRs E...

Страница 47: ...the various instructions and the specific exceptions can be found in the ST10 Family Programming Manual The table below shows the minimum execution times required to process an instruction fetched fro...

Страница 48: ...s The PSW SP and MDC registers can be modified not only explicitly by the programmer but also implicitly by the CPU during normal instruction processing Note that any explicit write request via softwa...

Страница 49: ...uce the 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 ef...

Страница 50: ...code address space is restricted to 64 KBytes segment 0 and therefore 16 bits are sufficient to represent all code addresses For implicit stack operations CALL or RET the CSP register is totally igno...

Страница 51: ...es it possible to use a bigger virtual stack than this dedicated RAM area These techniques as well as the encoding of bitfield STKSZ are described in more detail in SYSTEM PROGRAMMING on page 303 Proc...

Страница 52: ...FFh for the word data type or from 80h to 7Fh for the byte data type For Boolean bit operations with only one operand the N flag represents the previous state of the specified bit For Boolean bit oper...

Страница 53: ...ag indicates an arithmetic overflow For multiplication and division the V flag is set to 1 if the result cannot be represented in a word data type otherwise it is cleared Note that a division by zero...

Страница 54: ...t service routine when a multiply or divide ALU operation is interrupted before completion Depending on the state of the MULIP bit the hardware decides whether a multiplication or division must be con...

Страница 55: ...ch while the upper 8 bits are reserved for future use Code memory addresses are generated by directly extending the 16 bit content of the IP register by the contents of the CSP register as shown in Fi...

Страница 56: ...ing active simultaneously at run time The lower 10 bits of each DPP register select one of the 1024 possible 16 Kbyte data pages and the upper 6 bits are reserved for future use The DPP registers give...

Страница 57: ...SFR Reset Value 0000h DPP1 FE02h 01h SFR Reset Value 0001h DPP2 FE04h 02h SFR Reset Value 0002h DPP3 FE06h 03h SFR Reset Value 0003h Data paging is performed by concatenating the lower 14 bits of an i...

Страница 58: ...ny instruction which is capable of modifying an SFR Due to the Internal Instruction Pipeline a new DPP value can not be used for the operand address calculation of an instruction immediately following...

Страница 59: ...lue can not be used for GPR address calculation of the instruction immediately following the instruction updating the CP register The switch context instruction SCXT saves the content of the CPregiste...

Страница 60: ...s are possible GPRs used as indirect address pointers are always accessed wordwise For some instructions only the first four GPRs can be used as indirect address pointers These GPRs are specified by s...

Страница 61: ...ver data is to be popped from the stack Therefore the system stack grows from higher toward lower memory locations Since the least significant bit the SPregister is tied to 0 and bits 15 through 12 ar...

Страница 62: ...1 by hardware the STKOV register can only contain values from F000h to FFFEh The Stack Overflow Trap entered when SP STKOV may be used in two different ways Fatal error indication treats the stack ov...

Страница 63: ...ck Underflow Trap entered when SP STKUN may be used in two different ways Fatal error indication treats the stack underflow as a system error through the associated trap service routine Automatic syst...

Страница 64: ...performed within the interrupt service routine registers MDH MDL and MDC must be saved to avoid erroneous results A detailed description of how to use the MDH register for programming multiply and di...

Страница 65: ...struction When a division or multiplication is interrupted before completion and the multiply divide unit is required the MDC register must first be saved with registers MDH and MDL to be able to rest...

Страница 66: ...ction capable of addressing a SFR The constant ones register ONES All bits of this bit addressable register are fixed to 1 by hardware This register is read only Register ONES can be used as a registe...

Страница 67: ...n capable of addressing an SFR ZEROS FF1Ch 8Eh SFR Reset Value 0000h ONES FF1Eh 8Fh SFR Reset Value FFFFh 0 0 0 0 0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 r r r r r r 0 0 0 r 0 0 0 0 0 0 0 0 r r r r r...

Страница 68: ...es 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 hav...

Страница 69: ...erations 16 x 16 signed unsigned parallel multiplier 40 bit signed arithmetic unit with automatic saturation mode 40 bit accumulator 8 bit left right shifter Scaler one bit left shifter Data limiter F...

Страница 70: ...red operand addresses are calculated and the resulting operands are fetched IDX and GPR pointers are post modified if necessary Figure 17 MAC architecture Operand2 Operand1 Control Unit Repeat Unit ST...

Страница 71: ...modes have been added to supply the MAC with two new operands per instruction cycle These allow indirect addressing with address pointer post modification Double indirect addressing requires two poin...

Страница 72: ...epending on the post modification of IDXi It is obtained by the reverse operation than the one used to calculate the new value of IDXi The following table shows these rules Rwn stands for Rwn Rwn Rwn...

Страница 73: ...ing two 16 bit signed 2 s complement fractional numbers if bit MP is set 5 2 4 40 bit signed arithmetic unit The arithmetic unit over 32 bits wide to allow intermediate overflow in a series of multipl...

Страница 74: ...s explicitly reset by the user 40 bit overflow of the Accumulator sets the SV flag in MSW This flag is also a sticky flag 5 2 5 40 bit accumulator register The 40 bit Accumulator consists of three SFR...

Страница 75: ...r zero If it is zero the instruction is terminated else the Repeat Count is decremented and the instruction is repeated During such a repeat sequence the Repeat Flag in MRW is set until the last execu...

Страница 76: ...er during the interrupt routine otherwise the interrupt processing restarts when returning from the interrupt routine The MAC interrupt is implemented as a Class B hardware trap trap number Ah trap pr...

Страница 77: ...ed only by multiply multiply accumulate instructions which specifies whether each operand is signed or unsigned In two s complement fractional format the N bit operand is represented using the 1 N 1 f...

Страница 78: ...Reset Value 0000h QR1 F006h 03h ESFR Reset Value 0000h 5 3 2 Accumulator control registers The MAC unit SFRs include the 40 bit Accumulator MAL MAH and the low byte of MSW and 3 control registers the...

Страница 79: ...pt Request Set when the MAC Unit generates an interrupt request SL Sticky Limit Flag Set when the result of a MAC operation is automatically saturated Also used for CoMIN CoMAX instructions to indicat...

Страница 80: ...ple loading the Accumulator with MOV instructions will not modify the condition flags SV Sticky Overflow Flag Set when a MAC operation produces a 40 bit arithmetic overflow It remains set until it is...

Страница 81: ...sk When set the SV Flag can generate a MAC interrupt request CM C Mask When set the C Flag can generate a MAC interrupt request MP Product Shift Mode When set enables the one bit left shift of the mul...

Страница 82: ...le gives the address of the MAC registers in this CoReg addressing mode 5 4 MAC instruction set summary The following table gives an overview of the MAC instruction set All the mnemonics are listed wi...

Страница 83: ...CoMACMRus CoMACsu CoMACMRsu CoMAC CoMACMR rnd CoMACu CoMACMRu rnd CoMACus CoMACMRus rnd CoMACsu CoMACMRsu rnd CoMAC rnd CoADD Rwn Rwm No CoMACu rnd CoADD2 IDXi Rwm Yes CoMACus rnd CoSUB Rwn Rwm Yes Co...

Страница 84: ...ocks of data The ST10R272L has 8 PEC channels each of which offers fast interrupt driven data transfer capabilities Trap Functions Software interrupts are supported by means of the TRAP instruction in...

Страница 85: ...caused the trap For the special software TRAP instruction the vector address is specified by the operand field of the instruction which is a seven bit trap number The reserved vector locations build...

Страница 86: ...priority is higher than the current CPU priority in the PSW register External Interrupt 3 CC11IR CC11IE CC11INT 6Ch 1Bh GPT1 Timer 2 T2IR T2IE T2INT 88h 22h GPT1 Timer 3 T3IR T3IE T3INT 8Ch 23h GPT1...

Страница 87: ...tion pointers which specify the PEC service channel task 6 1 4 Interrupt control registers All interrupt control registers are organized identically The lower 8 bits contain the source interrupt statu...

Страница 88: ...e respective source occurs It is cleared automatically on entry into the interrupt service routine or on a PEC service For PEC services the interrupt request flag remains set if the COUNT field in the...

Страница 89: ...gister contains zero In this case the request is serviced by normal interrupt processing Interrupt requests that are programmed to priority levels 13 through 1 will always be serviced by normal interr...

Страница 90: ...e Figure 20 Priority levels and PEC channels Priority Level Type of Service ILVL GLVL COUNT 00h COUNT 00h 1 1 1 1 1 1 CPU interrupt level 15 group priority 3 PEC service channel 7 1 1 1 1 1 0 CPU inte...

Страница 91: ...est sources will be acknowledged PEC transfers do not really interrupt the CPU but rather steal a single cycle so PEC services do not influence the ILVL field in the PSW Hardware Traps switch the CPU...

Страница 92: ...ween two locations in segment 0 data pages 3 0 This is the fastest possible interrupt response and in many cases is sufficient to service a peripheral request e g serial channels etc Each channel is c...

Страница 93: ...ers or no PEC service at all The table below summarizes how the COUNT field the interrupt requests flag IR and the PEC channel action depend on the previous content of COUNT The PEC transfer counter m...

Страница 94: ...stination pointers specify the locations between which the data is to be moved A pair of pointers SRCPx and DSTPx is associated with each of the 8 PEC channels These pointers do not reside in specific...

Страница 95: ...group of interrupt requests to be acknowledged disregarding all other requests The priority level of the source that wins the arbitration is compared against the CPU s current level The source is onl...

Страница 96: ...L Each interrupt service routine within this class sets the CPU level to the highest interrupt priority within the class All requests from the same or any lower level will be blocked i e no request fr...

Страница 97: ...tiplication or division is in progress when the interrupt request is acknowledged bit MULIP in the PSW register is set to 1 In this case the return location that is saved on the stack is not the next...

Страница 98: ...nter CP on the system stack and loads CP with the immediate value New_Bank which selects a new register bank The service routine can now use its own registers This register bank is preserved when the...

Страница 99: ...e of the pipeline replacing instruction N 1 and clearing the source s interrupt request flag to 0 Cycle 4 Saves PSW IP and CSP if segmented mode and fetches the first instruction I1 from the respectiv...

Страница 100: ...ands are located there are a number of combinations Note however that only access conflicts contribute to the delay The following examples illustrate these delays The worst case interrupt response tim...

Страница 101: ...ponse time is the time between the setting of the interrupt request flag of an enabled interrupt source to the start of the PEC data transfer This is 2 instruction cycles for the ST10R272L The PEC res...

Страница 102: ...s the PEC response time due to pipeline related access priorities The following conditions must be considered Instruction fetch from an external location Operand read from an external location Result...

Страница 103: ...positive a negative or both a positive and a negative external transition can be selected to cause an interrupt or PEC service request The edge selection is performed in the control register of the pe...

Страница 104: ...tive transition to set the interrupt request flag and with CI 11b both a positive and a negative transition will set the request flag When the interrupt enable bit CRIE is set an interrupt request for...

Страница 105: ...eld x 3 0 0 0 Fast external interrupts disabled standard mode 0 1 Interrupt on positive edge rising 1 0 Interrupt on negative edge falling 1 1 Interrupt on any edge rising or falling Register Address...

Страница 106: ...RETI return from interrupt instruction to ensure correct operation Note The CPU level in the PSW register is not modified by the TRAP instruction so the service routine is executed on the same priorit...

Страница 107: ...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 Pr...

Страница 108: ...on the lowest priority Bit Function ILLBUS Illegal External Bus Access Flag An external access has been attempted with no external bus defined ILLINA Illegal Instruction Access Flag A branch to an od...

Страница 109: ...detected the NMI flag in register TFR is set and the CPU enters the NMI trap routine The IP value pushed on the system stack is the address of the instruction following the one after which normal pro...

Страница 110: ...fault trap routine The protected instructions include DISWDT EINIT IDLE PWRDN SRST and SRVWDT The IP value pushed onto the system stack for the protection fault trap is the address of the instruction...

Страница 111: ...ST10R272L INTERRUPT AND TRAP FUNCTIONS 110 320 6 9 12 MAC interrupt on condition User defined in the MCW register...

Страница 112: ...e 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 The I O ports are true bidirectional p...

Страница 113: ...ers a high impedance state The high level must then be provided by an external pullup device With this feature it is possible to connect several port pins together to a Wired AND configuration saving...

Страница 114: ...put 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 Otherwis...

Страница 115: ...t 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...

Страница 116: ...1h ESFR Reset Value 00h Bit Function P0X y Port data register P0H or P0L bit y Bit Function DP0X y Port direction register DP0H or DP0L bit y DP0X y 0 Port line P0X y is an input high impedance DP0X y...

Страница 117: ...s 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...

Страница 118: ...g 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 Whe...

Страница 119: ...hows the structure of a PORT0 pin 7 2 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 withou...

Страница 120: ...l 16 port lines can be used for general purpose I O Bit Function P1X y Port data register P1H or P1L bit y Bit Function DP1X y Port direction register DP1H or DP1L bit y DP1X y 0 Port line P1X y is an...

Страница 121: ...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 intrasegment address While an exte...

Страница 122: ...register DP2 Each port line can be switched into push pull or open drain mode via the open drain control register ODP2 7 3 1 Alternate functions of port 2 Port 2 lines P2 11 P2 8 can serve as Fast Ext...

Страница 123: ...ontrol 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 Port 2 Pin Alternate Function P2 8 P2 9 P2 10 P2 11 EX0IN Fast Ex...

Страница 124: ...ST10R272L PARALLEL PORTS 123 320 Figure 31 Port 2 I O and alternate functions Port 2 Alternate Function a General Purpose Fast External Interrupt Input P2 11 P2 10 P2 9 P2 8 EX3IN EX2IN EX1IN EX0IN...

Страница 125: ...is 15 bit port is used for general purpose I O the direction of each line can be configured via the corresponding direction register DP3 Most port lines can be switched into push pull or open drain mo...

Страница 126: ...r 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 Bit Function ODP3 y Port 3 Open Drain control register bit y ODP3 y 0 Port line P3 y output driver in...

Страница 127: ...6 Toggle Output GPT2 Capture Input Timer 3 Toggle Output Timer 3 External Up Down Control Input Timer 4 Count Input Timer 3 Count Input Timer 2 Count Input ASC0 Transmit Data Output ASC0 Receive Data...

Страница 128: ...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 st...

Страница 129: ...e output function However its structure is slightly different see figure below because after reset the BHE or WRH function must be used depending on the system start up configuration In these cases th...

Страница 130: ...t port If the SSP is disabled bit SSPEN cleared in SYSCON register Port 4 is used for general purpose I O the direction of each line can be configured via the corresponding direction register DP4 If t...

Страница 131: ...ess 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 its alternate function automatica...

Страница 132: ...n I O SSPCE0 Gen I O SSPDAT Gen I O SSPCLK Seg Address A16 Seg Address A17 Gen purpose I O Gen purpose I O Gen I O SSPCE1 Gen I O SSPCE0 Gen I O SSPDAT Gen I O SSPCLK Seg Address A16 Seg Address A17 S...

Страница 133: ...MUX Write P4 y Read P4 y Enable Function Alternate 0 1 MUX Read DP4 y Write DP4 y Direction 1 Input Latch Clock Latch s u B l a n r e t n I P4 y y 3 0 VR02075C Output Buffer MUX 1 0 Alternate Data Ou...

Страница 134: ...to P5 will be lost P5 FFA2h D1h SFR Reset Value XX h Figure 41 Block diagram of port 4 pin SSPDAT A22 Bit Function P5 y Port data register P5 bit y Read only VR02075D Output Buffer Latch Port Output...

Страница 135: ...P5 12 P5 13 P5 14 P5 15 T6EUDTimer 6 external Up Down Control Input T5EUDTimer 5 external Up Down Control Input T6INTimer 6 Count Input T5INTimer 5 Count Input T4EUDTimer 4 external Up Down Control In...

Страница 136: ...sponding 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 SFR Reset Value 00h Figure 43 Block diagram of a...

Страница 137: ...ed value can be read from bitfield CSSEL in register RP0H read only e g in order to check the configuration during run time Bit Function DP6 y Port direction register DP6 bit y DP6 y 0 Port line P6 y...

Страница 138: ...6 1 P6 2 P6 3 P6 4 Gen purpose I O Gen purpose I O Gen purpose I O Gen purpose I O Gen 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...

Страница 139: ...up device will not be active during Hold mode external pullup devices must be used in this case When entering Hold mode the CS lines are actively driven high for one CPU clock cycle then the output le...

Страница 140: ...n register PSW When the bus arbitration signals are enabled via HLDEN also these pins are switched automatically to the appropriate direction Note that the pin drivers for HLDA and BREQ are automatica...

Страница 141: ...et Value 0h Bit Function P7 y Port data register P7 bit y Bit Function 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 Bit...

Страница 142: ...e below summarizes the alternate functions of Port 7 Port 7Pin Alternate Function P7 3 POUT3 PWM Channel 3 Output Table 23 Port 7 alternate functions Figure 48 Port 7 I O and Alternate Functions P7 3...

Страница 143: ...ception is however that the port output latch value and the alternate data output are not ANDed but EXORed This feature inverts the alternate output by writing a 1 into the respective output latch Wit...

Страница 144: ...ernate function of P3 12 BHE During reset and during Hold mode an internal pullup ensures an inactive high level on the WR WRL output READY READY Ready Input receives a control signal from an external...

Страница 145: ...All VCC pins and all VSS pins must be con nected to the power supply and ground respectively VPP RPD Flash Programming Voltage for ST10F262 or Exit From Powerdown for all derivtives If a Fast External...

Страница 146: ...gth waitstates READY control ALE RW delay These parameters are used for accesses within a specific address area which is defined via the corresponding register ADDRSELx The four pairs BUSCON1 ADDRSEL1...

Страница 147: ...its port lines together with some control lines to build the external bus The bus configuration BTYP for the address windows BUSCON4 BUSCON1 is selected via software typically during the initializati...

Страница 148: ...L multiplexes address and data a 16 bit data bus requires a word latch the least significant address line A0 is not relevant for word accesses The upper address lines An A16 are permanently output on...

Страница 149: ...No address latches are required The EBC initiates an external access by placing an address on the address bus After a programmable period of time the EBC activates the respective command signal RD WR...

Страница 150: ...s Reprogramming the BUSCON and or ADDRSEL registers allows to either change the bus mode for a given address window or change the size of an address window that uses a certain bus mode Reprogramming a...

Страница 151: ...When an access code fetch or data is initiated the respective generated physical address defines if the access is made internally uses one of the address windows defined by ADDRSEL4 1 or uses the defa...

Страница 152: ...bsequent byte accesses where the low byte is accessed first then the high byte The assembly of bytes to words and the disassembly of words into bytes is handled by the EBC and is transparent to the CP...

Страница 153: ...ed as standard I O pin The BHE pin is implicitly used by the External Bus Controller to select one of two byte organized memory chips which are connected to the ST10R272L via a word wide external data...

Страница 154: ...s and are driven active low for any access within the address area defined for the respective BUSCON register For any access outside this defined address area the respective CSx signal will go inactiv...

Страница 155: ...hip mode when the first instruction is fetched Internal pullup devices hold the selected CS lines high during reset After the end of a reset sequence the pullup devices are switched off and the pin dr...

Страница 156: ...defined via register pairs AD DRSELx BUSCONx which allow to access different resources with different bus character istics These address windows are arranged hierarchically where BUSCON4 overrides BU...

Страница 157: ...alling edge are controlled by the ALECTLx bits in the BUSCON registers When bit ALECTL is set to 1 external bus cycles accessing the respective address window will have their ALE signal prolonged by h...

Страница 158: ...ective memory or peripheral This access time is the total time required to move the data to the destination It represents the period of time during which the controller s signals do not change The ext...

Страница 159: ...after deactivation of the read command RD The output of the next address on the external bus can be delayed for a memory or peripheral which needs more time to switch off its bus drivers by introducin...

Страница 160: ...e falling edge of the command Without read write delay the falling edges of ALE and command s are coincident except for propagation delays With the delay enabled the command s become active half a CPU...

Страница 161: ...e waitstates are not enough or where the response access time of a peripheral is not constant the ST10R272L provides external bus cycles that are terminated by a READY or READY input signal synchronou...

Страница 162: ...hronous READY READY i e the READY READY signal is synchronized internally The Synchronous READY READY provides the fastest bus cycles but requires setup and hold times to be met The CLKOUT signal shou...

Страница 163: ...or a peripheral access it may be delayed see example b in the figure above As memories tend to be faster than peripherals there should be no impact on system performance When using the READY READY fun...

Страница 164: ...of these registers BUSCON4 BUSCON1 have an associated address select register ADDRSEL4 ADDRSEL1 which specifies up to four address areas and the individual bus characteristics within these areas All...

Страница 165: ...bypassed the CPU clock is always driven by XTAL1 signal The PLL is turned off to reduce the power supply current PWDCFG Power Down Mode Configuration Control 0 Power Down Mode can only be entered duri...

Страница 166: ...ined by the RDYPOL bit in the associated BUSCON register CLKEN System Clock Output Enable CLKOUT 0 CLKOUT disabled pin may be used for general purpose IO 1 CLKOUT enabled pin outputs the system clock...

Страница 167: ...with falling edge of ALE MTT C0 RWD C0 RDY EN0 5 4 3 2 1 0 11 10 9 8 7 6 15 14 13 12 rw rw rw rw rw CSW EN0 BUS ACT0 rw ALE CTL0 rw rw CSR EN0 rw RDY POL0 rw MCTC BTYP MTT C1 RWD C1 RDY EN1 5 4 3 2 1...

Страница 168: ...Bus Active Control 0 External bus disabled 1 External bus enabled within the respective address window see ADDRSEL RDYENx READY Input Enable 0 External bus cycle is controlled by bit field MCTC only...

Страница 169: ...BUSCON1 within the complete address space Bit Function RGSZ Range Size Selection Defines the size of the address area controlled by the respective BUSCONx ADDRSELx register pair See table below RGSAD...

Страница 170: ...esses inside the window The lower bits of the start address marked x are disregarded 9 4 3 Prioritizing address areas A prioritizing scheme is used to allow overlapping of address areas The ADDRSELs r...

Страница 171: ...an overlapping among address areas defined via registers ADDRSEL3 and 4 is allowed The BUSCON0 register always has the lowest priority and its address area can be overlapped by any of the other ADDRSE...

Страница 172: ...CS2 CS0 0 1 2 CS lines CS1 CS0 1 0 No CS lines at all 1 1 5 CS lines CS4 CS0 Default without pulldowns SALSEL Segment Address Line Selection Number of active segment address outputs 0 0 4 bit segment...

Страница 173: ...dance floating PORT1 if used for the bus interface drives the address used last Port 4 the activated pins drives the segment address used last Port 6 drives the CS signal corresponding to the address...

Страница 174: ...n after the arbitration mechanism has been switched off by clearing HLDEN All three pins are used for bus arbitration after bit HLDEN was set once 9 6 1 Entering the hold state Access to the ST10R272L...

Страница 175: ...re The figure above shows the first chance that BREQ has to become active 9 6 2 Exiting the hold state The external bus master returns the access rights to the ST10R272L by driving the HOLD input high...

Страница 176: ...e The ST10R272L provides an on chip interface the XBUS interface which allows to connect integrated customer application specific peripherals to the standard controller core The XBUS is an internal re...

Страница 177: ...may be bytewide or wordwide with or without a separate address bus Interrupt nodes and configuration pins on PORT0 are provided for X Peripherals to be integrated Note If you plan to develop your own...

Страница 178: ...t clock and pulse width resolution Figure 0 1 SFRs and port pins associated with PWM unit The pulse width modulation module operates on channel 3 of the PWM module This channel has a 16 bit up down co...

Страница 179: ...a greater than or equal to comparison PWM Output Signal PT3 PW3 10 1 Operating Modes The PWM module provides three different operating modes Mode 0 standard PWM generation edge aligned PWM Mode 1 symm...

Страница 180: ...reater than the contents of the pulse width shadow register The signal is switched back to a low level when the timer is reset to 0000h i e below the pulse width shadow register The period of the resu...

Страница 181: ...related to the clearing of the timer Figure 65 Operation and output waveform in Mode 0 0 1 3 2 PW3 2 PW3 4 PW3 6 PW3 7 PW3 8 PW3 1 PW3 0 Duty Cycle 100 87 5 75 50 25 12 5 0 LSR LSR Latch Shadow Regist...

Страница 182: ...nt pulses The PWM 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 sign...

Страница 183: ...mer contents are equal to or greater than the contents of the pulse width shadow register The signal is switched back to a low level when the timer is cleared i e is below the pulse width shadow regis...

Страница 184: ...g on whether the pulse has already started i e the output is high or not i e the output is still low This multiple retriggering is always possible while the timer is running i e after the pulse has st...

Страница 185: ...waveform in single shot mode 0 1 3 2 PW3 4 4 5 6 7 PP3 Period 7 PT3 Count Value 0 1 3 2 4 5 6 7 LSR PTR3 reset by Hardware PT3 stopped LSR Set PTR3 by Software for Next Pulse Set PTR3 by Software Pul...

Страница 186: ...of counter PT3 rather than controlling the PWM output signal PT3 F036h 1Bh ESFR Reset Value 0000h The following table summarizes the PWM frequencies that result from various combinations of operating...

Страница 187: ...the hardware compares the contents of the shadow register with the content of the counter PT3 The shadow register is loaded from the PW3 register at the beginning of every new PWM cycle or upon a wri...

Страница 188: ...can be used for general purpose I O and the PWM signal can only be used to generate an interrupt request Bit Function PTR3 PWM Timer PT3 Run Control 0 Timer PT3 is disconnected from its input clock 1...

Страница 189: ...t value The module interrupt for all channels is controlled by the PWM Module Interrupt Control register PWMIC This register is organized like any other standard interrupt control register shown herea...

Страница 190: ...ss of how many channel interrupts were active However it will be set again if during execution of the service routine a new channel interrupt request is generated 10 4 PWM output signals In the ST10R2...

Страница 191: ...zed below The portions of port and direction registers which are used by the GPT1for alternate functions are shaded Figure 68 SFRs and port pins associated with timer block GPT1 ODP3 Port 3 Open Drain...

Страница 192: ...al 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 the contents of the respective timer Tx...

Страница 193: ...Timer with Gate active high 1 X X Reserved Do not use this combination T3R Timer 3 Run Bit T3R 0 Timer Counter 3 stops T3R 1 Timer Counter 3 runs T3UD Timer 3 Up Down Control 1 1 For bits T3UD and T3U...

Страница 194: ...an be changed regardless of whether the timer is running or not When pin T3EUD P3 4 is used as external count direction control input it must be configured as input i e its corresponding direction con...

Страница 195: ...d T3M in the T3CON register to 000B In this mode T3 is clocked with the internal system clock CPU clock divided by a programmable pre scaler selected by bit field T3I The input frequency fT3 for timer...

Страница 196: ...an alternate function of P3 6 To enable this operation pin T3IN P3 6 must be configured as input i e direction control bit DP3 6 must contain 0 If T3M 0 0 the timer is enabled when T3IN shows a low le...

Страница 197: ...e a positive a negative or both a positive and a negative tran sition at this pin Bit field T3I in control the T3CON register selects the triggering transition see table below For counter operation pi...

Страница 198: ...to interface to an incremental encoder T3 is clocked by Figure 72 Block diagram of core timer T3 in counter mode T3I Triggering Edge for Counter Increment Decrement 0 0 0 None Counter T3 is disabled...

Страница 199: ...ording to the speed and the direction of the incremental encoder its contents therefore always represent the encoder s current position Figure 73 Core timer T3 in incremental interface mode T3I Trigge...

Страница 200: ...gger a reset timer T3 e g via PEC transfer from ZEROS For incremental interface operation the following conditions must be met Bitfield T3M must be 110B Both pins T3IN and T3EUD must be configured as...

Страница 201: ...control and input jitter is compensation Input jitter is compensation might occur if the sensor rests near to one of the switching points Level on respective other input T3IN Input T3EUD Input Rising...

Страница 202: ...ode with the same options for the timer frequencies and the count signal as the core timer T3 In addition to these 3 counting modes the auxiliary timers can be concatenated with the core timer or they...

Страница 203: ...rating Mode TxM Timer x Mode Control Basic Operating Mode 0 0 0 Timer Mode 0 0 1 Counter Mode 0 1 0 Gated Timer with Gate active low 0 1 1 Gated Timer with Gate active high 1 0 0 Reload Mode 1 0 1 Cap...

Страница 204: ...d tables apply accordingly with one exception There is no output toggle latch and no alternate output pin for T2 and T4 Timers T2 and T4 in counter mode Counter mode for the auxiliary timers T2 and T4...

Страница 205: ...lock source for an auxiliary timer in counter mode concatenates the core timer T3 with the respective auxiliary timer Depending on which transition of T3OTL is selected to clock the auxiliary timer th...

Страница 206: ...y timers T2 and T4 is selected by setting bit field TxM in the respective register TxCON to 100B In reload mode the core timer T3 is reloaded with the contents of an auxiliary timer register triggered...

Страница 207: ...he following functions can be performed If both a positive and a negative transition of T3OTL is selected to trigger a reload the core timer will be reloaded with the contents of the auxiliary timer e...

Страница 208: ...tions The PWM signal can be output on T3OUT with T3OE 1 P3 3 1 and DP3 3 1 With this method the high and low time of the PWM signal can be varied in a wide range Note The output toggle latch T3OTL is...

Страница 209: ...re mode It is recommended to keep this bit cleared TxI 2 0 Note When programmed for capture mode the respective auxiliary timer T2 or T4 stops independent of its run flag T2R or T4R Upon a trigger sel...

Страница 210: ...interrupt control register for each of the three timers T2IC FF60h B0h SFR Reset Value 00h T3IC FF62h B1h SFR Reset Value 00h T4IC FF64h B2h SFR Reset Value 00h Note Please refer to the general Interr...

Страница 211: ...utput on an alternate function port pin In addition T6 may be reloaded with the contents of CAPREL The toggle bit also supports the concatenation of T6 with auxiliary timer T5 while concatenation of T...

Страница 212: ...it Function T6I Timer 6 Input Selection Depends on the Operating Mode see respective sections 2n n 2 9 2n n 2 9 T5EUD T5IN CPUClock CPUClock T6IN T6EUD T5 Mode Control T6 Mode Control GPT2Tim er T5 GP...

Страница 213: ...mer Counter 6 stops T6R 1 Timer Counter 6 runs T6UD Timer 6 Up Down Control 1 T6UDE Timer 6 External Up Down Enable 1 T6OE Alternate Output Function Enable T6OE 0 Alternate Output Function Disabled T6...

Страница 214: ...With a high level at T6EUD the timer is counting down If T6UD 1 a high level at pin T6EUD specifies counting up and a low level specifies counting down The count direction can be changed regardless o...

Страница 215: ...n be used as general purpose IO pin In addition T6OTL can be used in conjunction with the timer over underflows as an input for the counter function of the auxiliary timer T5 For this purpose the stat...

Страница 216: ...and to the auxiliary timer T5 in timer and gated timer mode Refer to the device datasheet for a table of timer input frequencies resolution and periods for the range of pre scaler options Figure 84 B...

Страница 217: ...vel at this pin stops the timer If T6M 0 1 pin T6IN must have a high level in order to enable the timer In addition the timer can be turned on or off by software using bit T6R The timer will only run...

Страница 218: ...cles before it changes 11 2 2 GPT2 Auxiliary Timer T5 The auxiliary timer T5 can be configured for timer gated timer or counter mode with the same options for the timer frequencies and the count signa...

Страница 219: ...on Depends on the Operating Mode see respective sections T5M Timer 5 Mode Control Basic Operating Mode 0 0 Timer Mode 0 1 Counter Mode 1 0 Gated Timer with Gate active low 1 1 Gated Timer with Gate ac...

Страница 220: ...gly with one exception There is no output toggle latch and no alternate output pin for T5 Timer T5 in counter mode Counter mode for the auxiliary timer T5 is selected by setting bit field T5M in regis...

Страница 221: ...Depending on which transition of T6OTL is selected to clock the auxiliary timer this concatenation forms a 32 bit or a 33 bit timer counter 32 bit Timer Counter If both a positive and a negative trans...

Страница 222: ...transitions on input T3IN or input T3EUD or both inputs T3IN and T3EUD The active edge is controlled by bit field CI in register T5CON The maximum input frequency for the capture trigger signal at CA...

Страница 223: ...med or not If T5SC 0 the input pin CAPIN can still be used to clear timer T5 or as an external interrupt input This interrupt is controlled by the CAPREL interrupt control register CRIC GPT2 capture r...

Страница 224: ...r CAPREL in capture and reload mode Since the reload function and the capture function of register CAPREL can be enabled individually by bits T5SC and T6SR the two functions can be enabled simultaneou...

Страница 225: ...s contains the correct time between two events measured in timer T5 increments Timer T6 which runs in timer mode counting down with a frequency of e g fCPU 4 uses the value in register CAPREL to perfo...

Страница 226: ...CAPIN interrupt request flag CRIR in register CRIC is set Setting any request flag will cause an interrupt to the respective timer or CAPREL interrupt vector T5INT T6INT or CRINT or trigger a PEC serv...

Страница 227: ...register contains control bits for mode and error check selection and status flags for error identification A transmission is started by writing to the write only transmit buffer register S0TBUF by a...

Страница 228: ...of the serial interface S0CON FFB0h D8h SFR Reset Value 0000h Bit Function S0M ASC0 Mode Control 0 0 0 8 bit data synchronous operation 0 0 1 8 bit data async operation 0 1 0 Reserved Do not use this...

Страница 229: ...1 Must be reset by software S0FE Framing Error Flag Set by hardware on a framing error S0FEN 1 Must be reset by software S0OE Overrun Error Flag Set by hardware on an overrun error S0OEN 1 Must be res...

Страница 230: ...ta mode The parity error flag S0PE will be set along with the error interrupt request flag if a wrong parity bit is received The parity bit itself will be stored in bit S0RBUF 7 9 bit data frames cons...

Страница 231: ...errupted by a data byte An address byte will interrupt all slaves operating in 8 bit data wake up bit mode so each slave can examine the 8 LSBs of the received character the address The addressed slav...

Страница 232: ...0 when the start bit is sampled the receive circuit is reset and waits for the next 1 to 0 transition at pin RXD0 If the start bit proves valid the receive circuit continues sampling and shifts the in...

Страница 233: ...t and S0REN 0 half duplex no reception Data transmission is double buffered When the transmitter is idle the transmit data loaded into S0TBUF is immediately moved to the transmit shift register thus f...

Страница 234: ...buffer register at the time the reception of the next byte is complete both the error interrupt request flag S0EIR and the overrun error status flag S0OE will be set provided the overrun check has be...

Страница 235: ...egister S0BG is the dual function Baud Rate Generator Reload register Reading S0BG returns the content of the timer bits 15 13 return zero while writing to S0BG always updates the reload register bits...

Страница 236: ...ck speed 12 5 ASC0 interrupt control Four bit addressable interrupt control registers are provided for serial channel ASC0 Register S0TIC controls the transmit interrupt S0TBIC controls the transmit b...

Страница 237: ...terrupts For normal operation i e apart from the error interrupt the ASC0 provides three interrupt requests to control data exchange via this serial channel S0TBIR activated when data is moved from S0...

Страница 238: ...for the handler to respond to the transmitter interrupt request in synchronous mode it is not possible at all Using the transmit buffer interrupt S0TBIR to reload transmit data allows the time to tra...

Страница 239: ...connected to the SSP for transfer The SSP transmits 1 3 bytes or receives 1 byte after sending 1 3 bytes synchronously to a shift clock which is generated by the SSP The SSP can start shifting with th...

Страница 240: ...e disable control for the SSP module This bit is named XSSPEN Xperipheral SSP ENable Control After reset XSSPEN is set to 0 and the SSP is disabled The four upper pins of Port4 can be used for segment...

Страница 241: ...operation for the SSP Figure 98 Synchronous serial port register XP1IC SSPTB0 SSPTB1 SSPTB2 SSPRB0 Data Registers 8 bit registers Control Registers Interrupt Control SSPTB0 SSPCON0 SSPTB SSPTB SSPRB...

Страница 242: ...ages Improper use for read operations may cause line conflicts among several selected slaves SSPCM SSP Continuous Mode Selection 0 Single Transfer Mode Chip enable line deactivated after end of transf...

Страница 243: ...n The figure below is a summary 13 2 2 SSP Control Register 1 SSPCON1 This register contains all bits which are required to configure the output lines of the SSP It contains control bits which are nor...

Страница 244: ...1 SSPCEN1 Polarity Control Bit 0 Inactive Chip Enable line is low active level is high 1 Inactive Chip Enable line is high active level is low SSPCKO SSP Clock Line Output SSPCLK Control Bit 0 Clock...

Страница 245: ...ring initialization while the clock line polarity and active edge might be switched between transfers to different peripheral slaves This can be handled by a write to only one control register SSPCON0...

Страница 246: ...a write operation of the SSP The length of the transfer is determined through which transmit buffers were written to prior to the transfer Internal flags TBx_Full are used for this purpose These flags...

Страница 247: ...rite operation controlled through transmit buffer full signal Transmit Buffers written Transfer length Transfer sequence SSPTB2 SSPTB1 SSPTB0 24 bit 3 byte transfer SSPTB2 SSPTB1 SSPTB0 SSPTB1 SSPTB2...

Страница 248: ...tes in the Transmit Buffers After writing to SSPTB0 first the content of the transmit buffers are shifted out Then the data line SSPDAT is switched to input high impedance After a gap of one bit clock...

Страница 249: ...s However if no transfer is in progress or the SSP is not used at all the polarity and output control bit can be used to perform general purpose output functions on the pins SSPCLK SSPCE0 and SSPCE1...

Страница 250: ...writes to the slave device The gap between the transfers is application dependent since the CPU first has to react on the interrupt request at the end of one transfer and rewrite the transmit buffer r...

Страница 251: ...in register XP1IC is set This can cause the following effects an interrupt to the XP1INT interrupt vector trigger a PEC service if the interrupt enable bit XP1IE in register XP1IC is set poll the XP1...

Страница 252: ...as accesses to the external bus SSP accesses cannot be executed in parallel to external instruction fetches or data read writes but are arbitrated and inserted into the external bus access stream How...

Страница 253: ...RSELx registers except that it uses the reduced address ranges which are defined for XBUS Peripherals With the mask programmed value shown above the following options are selected Fixing the SSP addre...

Страница 254: ...Port 0 Port 1 Port 4 and Port 6 can be used for general purpose I O When bit VISIBLE in register SYSCON is set then accesses to the SSP can be made visible to the external world To do so one of the BU...

Страница 255: ...executed in this mode if bit VISIBLE in register SYSCON is cleared In this case an access to the SSP is completely invisible to the external world If bit VISIBLE is set then SSP accesses have to wait...

Страница 256: ...og Timer overflows and generates an internal hardware reset and pulls the RSTOUT pin low in order to allow external hardware components to be reset The Watchdog Timer is a 16 bit timer clocked with th...

Страница 257: ...ill pull the external reset indication pin RSTOUT low It differs from a software or external hardware reset in that bit WDTR watchdog timer reset indication flag of register WDTCON will be set A hardw...

Страница 258: ...be programmed in register WDTCON The period PWDT between servicing the watchdog timer and the next overflow can therefore be determined by the following formula Refer to the device datasheet for a ta...

Страница 259: ...rogram execution from the memory location 00 0000h in code segment zero When a reset other than asynchronous reset is initiated pending internal hold states are cancelled and the current internal acce...

Страница 260: ...ronized before exiting the reset condition Therefore only the entry of the this hardware reset is asynchronous An asynchronous hardware reset is triggered when a low logic level on RSTIN and RPD Vpp p...

Страница 261: ...the other to RPD Vpp pin is sufficient for an automatic power on reset RSTIN may also be connected to the output of other logic gates When reset sequence is finished the RPD Vpp capacitor will be cha...

Страница 262: ...ance RSTOUT is driven After RSTIN negation is detected a short transition period approximately 6 CPU clock cycles elapses during which pending internal hold states are cancelled and the current intern...

Страница 263: ...clock cycles if the PLL is bypassed and the prescaler is on fCPU fXTAL 2 else it is 4 CPU clock cycles Figure 109 Synchronous warm reset external low pulse on RSTIN shorter than reset sequence CPU Cl...

Страница 264: ...operation and 2 0V for 3 3V operation the asynchronous reset is then immediately entered Figure 110 Synchronous warm reset external low pulse on RSTIN longer than reset sequence CPU Clock RSTIN Intern...

Страница 265: ...en charge the capacitor C Note that an internal pull down device on RPD Vpp pin is turned on when RSTIN pin is low and causes the external capacitor C to begin discharging at a typical rate of 100 A t...

Страница 266: ...the voltage above VIL for short low pulses applied on RSTIN pin Figure 10 5 shows an example of a system reset circuit In this example R1C1 external circuit is only used to generate power up or manua...

Страница 267: ...hdog timer reset When the watchdog timer is not disabled during the initialization or serviced regularly during program execution is will overflow and trigger the reset sequence Other than hardware an...

Страница 268: ...us and control signals are activated immediately after the reset sequence according to the configuration latched from PORT0 so either external accesses can takes place or the external control signals...

Страница 269: ...synchronously upon software or watchdog reset 3 The reset condition ends here The ST10R272L starts program execution 4 Activation of the IO pins is controlled by software 5 Execution of the EINIT ins...

Страница 270: ...eted It will be clocked with the internal system clock divided by 2 and its default reload value is 00h so a watchdog timer overflow will occur 131072 CPU clock cycles after completion of the internal...

Страница 271: ...rivers are switched to the high impedance state This ensures that the ST10R272L and external devices will not try to drive the same pin to different levels Pin ALE is held low through an internal pull...

Страница 272: ...vector in the trap interrupt vector table the reset vector 4 words locations 00 0000h through 00 0007h are provided in this table to start the initialization after reset As a rule this location holds...

Страница 273: ...size etc must be selected before the execution of EINIT 15 10 1 System start up configuration Although most of the programmable features of the ST10R272L are either selected during the initialization...

Страница 274: ...configuration options The default modes refer to pins at high level i e without external pulldown devices connected The above note on reserved pins remains applicable 15 10 2 Emulation mode When low...

Страница 275: ...n Adapt Mode 15 10 4 System clock configuration Pins P0H 7 to P0H 5 CLKSEL selects the system clock configuration at reset The system clock CPU Clock can be selected to be 0 5 1 2 2 5 3 4 or 5 times t...

Страница 276: ...H Depending on the system architecture the required address space is chosen and accessible right from the start so the initialization routine can directly access all locations without prior programmin...

Страница 277: ...terpret the format A word register looks like this Elements REG_NAME A16h A8h E SFR Reset Value h A byte register looks like this REG_NAME Name of this register A16 A8 Long 16 bit address Short 8 bit...

Страница 278: ...R2 CP 4 F2h CPU General Purpose Word Register R2 UUUUh R3 CP 6 F3h CPU General Purpose Word Register R3 UUUUh R4 CP 8 F4h CPU General Purpose Word Register R4 UUUUh R5 CP 10 F5h CPU General Purpose Wo...

Страница 279: ...F1h CPU General Purpose Byte Register Rh0 UUh RL1 CP 2 F2h CPU General Purpose Byte Register RL1 UUh RH1 CP 3 F3h CPU General Purpose Byte Register RH1 UUh RL2 CP 4 F4h CPU General Purpose Byte Regis...

Страница 280: ...4 FEh CPU General Purpose Byte Register RL7 UUh RH7 CP 14 FFh CPU General Purpose Byte Register RH7 UUh Name Physical Address 8 Bit Address Description Reset Value ADDRSEL1 FE18h 0Ch Address Select Re...

Страница 281: ...H b F106h E 83h P1h Direction Control Register 00h DP2 b FFC2h E1h Port 2 Direction Control Register 0 h DP3 b FFC6h E3h Port 3 Direction Control Register 0000h DP4 b FFCAh E5h Port 4 Direction Contro...

Страница 282: ...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...

Страница 283: ...Register 0000h PECC6 FECCh 66h PEC Channel 6 Control Register 0000h PECC7 FECEh 67h PEC Channel 7 Control Register 0000h PP3 F03Eh E 1Fh PWM Module Period Register 3 0000h PSW b FF10h 88h CPU Program...

Страница 284: ...Transmit Interrupt Control Regis ter 0000h SP FE12h 09h CPU System Stack Pointer Register FC00h SSPCON0 EF00h X SSP Control Register 0 0000h SSPCON1 EF02h X SSP Control Register 1 0000h SSPRTB EF04h...

Страница 285: ...IC b FF66h B3h GPT2 Timer 5 Interrupt Control Register 0000h T6 FE48h 24h GPT2 Timer 6 Register 0000h T6CON b FF48h A4h GPT2 Timer 6 Control Register 0000h T6IC b FF68h B4h GPT2 Timer 6 Interrupt Cont...

Страница 286: ...Module Period Register 3 0000h F078h E IDPROG 3Ch Programming Voltage Identifier Register Refer to Data Sheetor Errata Sheet for val ues F07Ah E IDMEM 3Dh On chip Memory Identifier Register F07Ch E ID...

Страница 287: ...bits 0002h FE06h DPP3 03h CPU Data Page Pointer 3 Register 10 bits 0003h FE08h CSP 04h CPU Code Segment Pointer Register read only 0000h FE0Ch MDH 06h CPU Multiply Divide Register High Word 0000h FE0...

Страница 288: ...rate generator reload reg 0000h FEC0h PECC0 60h PEC Channel 0 Control Register 0000h FEC2h PECC1 61h PEC Channel 1 Control Register 0000h FEC4h PECC2 62h PEC Channel 2 Control Register 0000h FEC6h PE...

Страница 289: ...ant Value 1 s Register read only FFFFh FF30h PWMCON0 b 98h PWM Module Control Register 0 0000h FF32h PWMCON1 b 99h PWM Module Control Register 1 0000h FF40h T2CON b A0h GPT1 Timer 2 Control Register 0...

Страница 290: ...h FFACh TFR b D6h Trap Flag Register 0000h FFAEh WDTCON D7h Watchdog Timer Control Register 000xh2 FFB0h S0CON b D8h Serial Channel 0 Control Register 0000h FFC0h P2 b E0h Port 2 Register 4 bits 0 h F...

Страница 291: ...with its revision a internal memory and size identifier programming voltage description FFDCh MCW EEh MAC Unit Control Word 0000h FFDEh MSW b EFh MAC Unit Status Word 0200h 1 The system configuration...

Страница 292: ...on REVID Device Revision Identifier Refer to datasheet for values CHIPID Device Identifier Refer to datasheet for values Bit Function MEMSIZE Internal Memory Size Refer to datasheet for values MEMTYP...

Страница 293: ...ge for FLASH devices is calculated using the formula Vdd 20 PROGVDD 256 V Refer to datasheet for values PROGVPP Programming Vpp Voltage Vpp voltage for FLASH devices is calculated using the formula Vp...

Страница 294: ...rate normally only the CPU operation is halted Idle Mode is entered AFTER the IDLE instruction has been executed AND the instruction before IDLE has completed all stages of the pipeline This guarantee...

Страница 295: ...will always be entered Any interrupt request whose individual Interrupt Enable flag is set before Idle Mode is entered terminates Idle Mode regardless of the current CPU priority The CPU will not go b...

Страница 296: ...on is effective only if the NMI Non Maskable Interrupt pin is externally pulled low while PWRDN is executed The microcontroller enters Power Down mode after the PWRDN instruction has completed Protect...

Страница 297: ...orts to their default state but does not change the contents of the internal RAM The initialization routine executed upon reset checks the identification flag or bit pattern within RAM to determine wh...

Страница 298: ...able bit bit CCxIE in the respective CCxIC register need not to be set to bring the device out of Power Down mode An external RC circuit must be connected on the Vpp RPD pin as shown in the following...

Страница 299: ...rns on an internal weak pull down on the Vpp RPD pin to discharge the capacitor C1 The discharging of the external capacitor provides a delay for the oscillator and PLL circuits to stabilize before th...

Страница 300: ...e 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...

Страница 301: ...stabilization time then use the following formula to calculate the C value where Examples Figure 119 Simplified Powerdown Exit Circuitry C is the external capacitor on Vpp RPD in F TDIS is the worst...

Страница 302: ...ion of a port pin is used by a peripheral the state of the pin is determined by the operation of the peripheral Port pins which are used for bus control functions go into that state which represents t...

Страница 303: ...ed buses with 8 bit data bus A15 A8 2 Float PORT1 Last Address 3 Port Latch Data 3 For demultiplexed buses Last Address 3 Port Latch Data Port 4 Port Latch Data Last segment Port Latch Data Last segme...

Страница 304: ...ructions can access the PSW register so instructions such as CLEAR CARRY or ENABLE INTERRUPTS are NOT required External Memory Data Access does not require special instructions to load data pointers o...

Страница 305: ...only Bytes must either be converted to words or the respective other byte must be disregarded Register SP can only be loaded with even byte addresses The LSB of SP is always 0 Detection of stack overf...

Страница 306: ...rs very infrequently If this is not true for a given program environment this technique should not be used because of the overhead of flushing and filling The basic mechanism is the transformation of...

Страница 307: ...FEh 00 F600h Note No circular stack SP 11 SP 0 Figure 120 Physical stack address generation MOV SP 0F802h Set SP before last entry of physical stack of 256 words SP F802h Physical stack address FA02h...

Страница 308: ...inters are updated to reflect the newly allocated space on the internal stack Thus the user is free to write code without concern for the internal stack limits User programs are only affected by the e...

Страница 309: ...to off load data from the system stack The user may push both bytes and words onto a user stack but is responsible for using the appropriate instructions when popping data from the specific user stack...

Страница 310: ...d and POP instructions during execution of the subroutine Base plus offset indirect addressing permits access to parameters without popping the parameters from the stack during subroutine execution In...

Страница 311: ...e of the System Stack for Local Registers It is possible to use the SP and CP to set up local subroutine register frames This allows subroutines to dynamically allocate local variables as needed withi...

Страница 312: ...mode and the E end of table flag stored in the PSW decrease the number of overhead instructions executed in the loop The two examples below illustrate searching ordered tables and non ordered tables...

Страница 313: ...oftware by setting or clearing user specific bits and conditionally branching based on these specific bits It is recommended that bit fields in control SFRs are updated using the BFLDH and BFLDL instr...

Страница 314: ...de illegal bus access etc however will interrupt the ATOMIC sequence since it indicates a severe hardware problem The interrupt inhibit caused by an ATOMIC instruction becomes active immediately i e n...

Страница 315: ...t addressing modes to the ESFR space for 1 4 instructions Additional registers can also be accessed this way The EXTPR and EXTSR instructions combine the DPP override mechanism with re direction to th...

Страница 316: ...72L SYSTEM PROGRAMMING 315 320 Note Interrupt latencies may be increased when using locked code sequences PEC requests are not serviced during idle mode if the IDLE instruction is part of a locked seq...

Страница 317: ...et Value FC00h 58 CRIC FF6Ah B5h SFR Reset Value 00h 225 CSP FE08h 04h SFR Reset Value 0000h 55 DP0H F102h 81h ESFR Reset Value 00h 115 DP0L F100h 80h ESFR Reset Value 00h 115 DP1H F106h 83h ESFR Rese...

Страница 318: ...ue 0000h 80 MSW FFDEh EFh SFR Reset Value 0200h 78 ODP2 F1C2h E1h ESFR Reset Value 00 h 122 ODP3 F1C6h E3h ESFR Reset Value 0000h 125 ODP6 F1CEh E7h ESFR Reset Value 00h 136 ODP7 F1D2h E9h ESFR Reset...

Страница 319: ...77 RP0H F108h 84h SFR Reset Value XXh 171 S0CON FFB0h D8h SFR Reset Value 0000h 227 S0EIC FF70h B8h SFR Reset Value 00h 236 S0RIC FF6Eh B7h SFR Reset Value 00h 236 S0TBIC F19Ch CEh ESFR Reset Value 00...

Страница 320: ...T4IC FF64h B2h SFR Reset Value 00h 209 T5CON FF46h A3h SFR Reset Value 0000h 218 T5IC FF66h B3h SFR Reset Value 00h 225 T6CON FF48h A4h SFR Reset Value 0000h 211 T6IC FF68h B4h SFR Reset Value 00h 225...

Страница 321: ...reviously supplied STMicroelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of STMicroelectronics The ST lo...

Отзывы: