Part Number Hot Search : 
9XS31D SD0520LS TDA4340X BA455 FN2433 4ABZAPT LWE67C 2N508
Product Description
Full Text Search
 

To Download S3P7538 Datasheet File

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


  Datasheet File OCR Text:
  s3c7524/c7528/p7528/c7534/c7538/p7538 p roduct overview 1- 1 1 product overview the s3c7524/c7528/c7534/c7538 single-chip cmos microcontroller has been designed for high-performance using sam 47 (samsung arrangeable microcontrollers). sam 47, samsung's newest 4-bit cpu core is notable for its low energy consumption and low operating voltage. you can select from two rom sizes: 4k or 8k bytes except for the difference in rom size, the features and functions of the s3c7524 and the s3c7528, the s3c7534 and the s3c7538 are identical. with it's dtmf generator, watchdog timer function, and versatile 8-bit timer/counters, thes3c7524/c7528 /c5304/c5308 offers an excellent design solution for a wide variety of telecommunication applications. up to 35 pins of the available 42-pin sdip or 44-pin qfp package for the s3c7524/c7528, and up to 23 pins of the available 30-pin sdip or 32-pin sop package for the s3c7534/c7538 can be assign to i/o. six vectored interrupts for s3c7524/c7528 and four vectored interrupts for s3c7534/c7538 provide fast response to internal and external events. in addition, the s3c7524/c7528/c7534/c7538 's advanced cmos technology provides for low power consumption and a wide operating voltage range. otp the s3c7524/c7528 microcontroller is also available in otp (one time programmable) version, s3p7528. the s3c7534/c7538 microcontroller is also available in otp (one time programmable) version, S3P7538. the s3p7528/p7538 microcontroller has an on-chip 8k-byte one-time-programable eprom instead of masked rom. the s3p7528 is comparable to s3c7524/c7528, both in function and in pin configuration. also, the S3P7538 is comparable to the s3c7534/c7538, both in function and in pin configuration.
product overview s3 c7524/c7528/p7528/c7534/c7538/p7538 1- 2 features summary memory 768 4-bit ram 4,096 8-bit rom (s3c7524/c7534) 8,192 8-bit rom (s3c7528/c7538) 35 i/o pins input only: 4 pins (s3c7524/c7528) 1 pins (s3c7534/c7538) i/o: 23 pins (s3c7524/c7528) 14 pins ( s3c7534/c7538) n-channel open-drain i/o: 8 pins memory-mapped i/o structure data memory bank 15 dtmf generator 16 dual-tone frequencies for tone dialing 8-bit basic timer programmable interval timer watchdog timer two 8-bit timer/counters programmable 8-bit timer external event counter function arbitrary clock frequency output watch timer real-time and interval time measurement four frequency outputs to the buz pin bit sequential carrier supports 8-bit serial data transfer in arbitrary format interrupts 3 external interrupt vectors (s3c7524/c7528) 1 external interrupt vectors (s3c7534/c7538) 3 internal interrupt vectors 2 quasi-interrupts power-down modes idle: only cpu clock stops stop: system clock stops oscillation sources crystal, or ceramic for main system clock main system clock frequency: 0.4?6.0 mhz (typical) cpu clock divider circuit (by 4, 8, or 64) instruction execution times 0.95, 1.91, and 15.3 m s at 4.19 mhz 1.12, 2.23, 17.88 m s at 3.58 mhz 0.67, 1.33, 10.7 m s at 6.0 mhz operating temperature ? 40 c to 85 c operating voltage range 2.0 v to 5.5 v package types 42 sdip, 44 qfp (s3c7524/c7528) 30 sdip, 32 sop (s3c7534/c7538)
s3c7524/c7528/p7528/c7534/c7538/p7538 p roduct overview 1 - 3 block diagram p6.0?p6.3 / ks0?ks3 arithmetic and logic unit interrupt control block stack pointer program counter program status word flags instruction decoder clock reset xin xout internal interrupts p8.0?p8.3 p5.0?p5.3 p4.0 / btco p4.1 - p4.3 p7.0?p7.3 / ks4?ks7 p9.0?p9.2 dtmf int0, int1, int2, int4 8-bit timer/ counter 0 8-bit timer/ counter 1 i/o port 6 i/o port 7 p2.0 / tclo0 p2.1 / tclo1 p2.2 / clo p2.3 / buz p3.0 / tcl0 p3.1 / tcl1 p3.2 p3.3 i/o port 4 i/o port 5 dtmf generator p1.0 / int0 p1.1 / int1 p1.2 / int2 p1.3 / int4 input port 1 768 x 4-bit data memory program memory s3c7524/c7534: 4 kbytes s3c7528/c7538: 8 kbytes i/o port 9 i/o port 8 i/o port 2 i/o port 3 basic timer watch timer watch-dog timer note: s3c7534/c7538 does not use p1.1/int1, p1.2/int2, p1.3/int3, p3.2, p3.3, int1, int2, int4, p8.0-p8.3, and p9.0-p9.2. figure 1?1. s3c7524/c7528 simplified block diagram
product overview s3 c7524/c7528/p7528/c7534/c7538/p7538 1- 4 pin assignments p1.0 / int0 p1.1 / int1 p1.2 / int2 p1.3 / int4 p2.0 / tclo0 p2.1 / tclo1 p2.2 / clo p2.3 / buz p3.0 / tcl0 p3.1 / tcl1 v dd v ss x out x in test p4.0 / btco p4.1 reset p3.2 p3.3 p4.2 p9.2 p9.1 p9.0 dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 p6.1 / ks1 p6.0 / ks0 p5.3 p5.2 p5.1 p5.0 p8.3 p8.2 p8.1 p8.0 p4.3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 s3c7524/c7528 (42-sdip-600) 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 figure 1?2. s3c7524/c7528 pin assignment diagrams (42?sdip)
s3c7524/c7528/p7528/c7534/c7538/p7538 p roduct overview 1 - 5 reset p3.2 p3.3 p4.2 nc p4.3 p8.0 p8.1 p8.2 p8.3 p5.0 1 2 3 4 5 6 7 8 9 10 11 p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 p6.1 / ks1 p6.0 / ks0 p5.3 p5.2 p5.1 p2.2 / clo p2.3 / buz p3.0 / tcl0 p3.1 / tcl1 v dd v ss x out x in test p4.0 / btco p4.1 ks57c5204/c5208 (44-qfp-1010b) 12 1 3 1 4 1 5 1 6 1 7 1 8 1 9 20 21 22 33 32 31 30 29 28 27 26 25 24 23 4 4 43 42 41 40 3 9 38 37 36 35 34 p2.1 / tclo1 p2.0 / tclo0 p1.3 / int4 p1.2 / int2 p1.1 / int1 p1.0 / int0 nc p9.2 p9.1 p9.0 dtmf figure 1?3. s3c7524/c7528 pin assignment diagrams (44?qfp)
product overview s3 c7524/c7528/p7528/c7534/c7538/p7538 1- 6 v ss x out x in test p4.0 / btco p4.1 reset p4.2 p4.3 p5.0 p5.1 p5.2 p5.3 p6.0 / ks0 p6.1 / ks1 v dd p3.1 / tcl1 p3.0 / tcl0 p2.3 / buz p2.2 / clo p2.1 / tclo1 p2.0 / tclo0 p1.0 / int0 dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 (30-sdip-400) s3c7534/c7538 figure 1?4. s3c7534/c7538 pin assignment diagrams (30?sdip) v ss x out x in test p4.0 / btco p4.1 reset p4.2 nc p4.3 p5.0 p5.1 p5.2 p5.3 p6.0 / ks0 p6.1 / ks1 v dd p3.1 / tcl1 p3.0 / tcl0 p2.3 / buz p2.2 / clo p2.1 / tclo1 p2.0 / tclo0 p1.0 / int0 nc dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (32-sop-405a) 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 s3c7534/c7538 figure 1?5. s3c7534/c7538 pin assignment diagrams (32?sop)
s3c7524/c7528/p7528/c7534/c7538/p7538 p roduct overview 1 - 7 pin descriptions table 1-1. s3c7524/c7528 pin descriptions pin name pin type reset value description pin number share pin circuit type p1.0 p1.1 p1.2 p1.3 i i 4-bit input port. 1-bit and 4-bit read and test is possible. each pull-up resistors are assignable by software. 1 (39) 2 (40) 3 (41) 4 (42) int0 int1 int2 int4 a-4 p2.0 p2.1 p2.2 p2.3 i/o i 4-bit i/o port. 1-bit and 4-bit read/write and test is possible. individual pins are software configurable as input or output. 5 (43) 6 (44) 7 (1) 8 (2) tclo0 tclo1 clo buz d-2 p3.0 p3.1 p3.2 p3.3 4-bit pull-up resistors are software assignable to input pins and are automatically disabled for output pins. ports 2 and 3 can be paired to enable 8-bit data transfer. 9 (3) 10 (4) 19 (13) 20 (14) tcl0 tcl1 d-4 p4.0 p4.1 p4.2 p4.3 p5.0?p5.3 i/o i 4-bit i/o ports. 1-bit and 4-bit read/write and test is possible. individual pins are software configurable as input or output. 4-bit pull-up resistors are software assignable to input pins and are automatically disabled for output pins. n-channel open-drain or push-pull output can be selected by software (1-bit unit) ports 4 and 5 can be paired to support 8-bit data transfer. 16 (10) 17 (11) 21 (15) 22 (17) 27?30 (22?25) btco e-2 p6.0?p6.3 p7.0?p7.3 i/o i 4-bit i/o ports. 1-bit or 4-bit read/write and test is possible. individual pins are software configurable as input or output. 4-bit pull-up resistors are software assignable to input pins and are automatically disabled for output pins. ports 6 and 7 can be paired to enable 8-bit data transfer. 31?34 (26?29) 35?38 (30?33) ks0?ks3 ks4?ks7 d-4 p8.0?p8.3 p9.0?p9.2 i/o i 4-bit i/o port. 1-bit or 4-bit read/write and test is possible. individual pins are software configurable as input or output. 4-bit pull-up resistors are software assignable to input pins and are automatically disabled for output pins. ports 8 and 9 can be paired to enable 8-bit data transfer. 23?26 (18?21) 40?42 (35?37) ? d-2
product overview s3 c7524/c7528/p7528/c7534/c7538/p7538 1- 8 table 1-1. s3c7524/c7528 pin descriptions (continued) pin name pin type reset value description pin number share pin circuit type dtmf o ? dtmf output. 39 (34) ? g-6 btco i/o i basic timer clock output 16 (10) p4.0 e-2 int0 int1 i i external interrupts. the triggering edge for int0 and int1 is selectable. 1 (39) 2 (40) p1.0 p1.1 a-3 int2 i i quasi-interrupt with detection of rising edges 3 (41) p1.2 a-3 int4 i i external interrupt with detection of rising and falling edges. 4 (42) p1.3 a-3 tclo0 i/o i timer/counter 0 clock output 5 (43) p2.0 d-2 tclo1 i/o i timer/counter 1 clock output 6 (44) p2.1 d-2 clo i/o i clock output 7 (1) p2.2 d-2 buz i/o i 2 khz, 4 khz, 8 khz, or 16 khz frequency output at the watch timer clock frequency of 4.19 mhz for buzzer sound 8 (2) p2.3 d-2 tcl0 i/o i external clock input for timer/counter 0 9 (3) p3.0 d-4 tcl1 i/o i external clock input for timer/counter 1 10 (4) p3.1 d-4 ks0?ks3 ks4?ks7 i/o i quasi-interrupt inputs with falling edge detection 31?34 (26?29) 35?38 (30?33) p6.0? p6.3 p7.0? p7.3 d-4 v dd ? ? power supply 11 (5) ? ? v ss ? ? ground 12 (6) ? ? reset ? ? reset signal 18 (12) ? b x in x out ? ? crystal, or ceramic oscillator signal for main system clock. (for external clock input, use x in and input x in 's reverse phase to x out ) 14 (8) 13 (7) ? ? test ? ? test signal input 15 (9) ? ? nc ? ? no connection (16, 38) ? ? note: parentheses indicate pin number for 44 qfp package.
s3c7524/c7528/p7528/c7534/c7538/p7538 p roduct overview 1 - 9 table 1-2. s3c7534/c7538 pin descriptions pin name pin type description pin number share pin circuit type p1.0 i 1-bit input port. 1-bit and 4-bit read and test is possible. each bit pull-up resistors are assignable. 23 (25) int0 a-4 p2.0 p2.1 p2.2 p2.3 i/o 4-bit i/o port. 1-bit and 4-bit read/write and test is possible. each individual pin can be assignable as input or output. 4-bit pull-up resisters are software assignable to input pins and are automatically disabled for output pins. 24 (26) 25 (27) 26 (28) 27 (29) tclo0 tclo1 clo buz d-2 p3.0 p3.1 ports 2 and 3 can be paired to enable 8-bit data transfer. 28 (30) 29 (31) tcl0 tcl1 d-4 p4.0 p4.1 p4.2 p4.3 p5.0?p5.3 i/o 4-bit i/o ports. 1-bit and 4-bit read/write and test is possible. each individual pin can be assignable as input or output. 4-bit pull-up resisters are software assignable to input pins and are automatically disabled for output pins. the n-channel open-drain or push-pull output can be selected by software (1-bit unit). ports 4 and 5 can be paired to enable 8-bit data transfer. 5 (5) 6 (6) 8 (8) 9 (10) 10?13 (11?14) btco e-2 p6.0?p6.3 p7.0?p7.3 i/o 4-bit i/o ports. 1-bit and 4-bit read/write and test is possible. each individual pin can be assignable as input or output. 4-bit pull-up resisters are software assignable to input pins and are automatically disabled for output pins. ports 6 and 7 can be paired to enable 8-bit data transfer. 14?17 (15?18) 18?21 (19?22) ks0?ks3 ks4?ks7 d-4
product overview s3 c7524/c7528/p7528/c7534/c7538/p7538 1- 10 table 1-1. s3c7534/c7538 pin descriptions (continued) pin name i/o type description pin number share pin circuit type dtmf o dtmf output. 22 (23) ? g-6 int0 i external interrupt input. the triggering edge for int0 is selectable. 23 (25) p1.0 a-3 tclo0 i/o timer/counter 0 clock output 24 (26) p2.0 d-2 tclo1 i/o timer/counter 1 clock output 25 (27) p2.1 d-2 clo i/o clock output 26 (28) p2.2 d-2 buz i/o 2 khz, 4 khz, 8 khz, or 16 khz frequency output at the watch timer clock frequency of 4.19 mhz for buzzer sound 27 (29) p2.3 d-2 tcl0 i/o external clock input for timer/counter 0 28 (30) p3.0 d-4 tcl1 i/o external clock input for timer/counter 1 29 (31) p3.1 d-4 btco i/o basic timer clock output 5 (5) p4.0 e-2 v dd ? power supply 30 (32) ? ? v ss ? ground 1 (1) ? ? x in x out ? crystal, or ceramic oscillator signal for main system clock. (for external clock input, use x in and input x in 's reverse phase to x out ) 3 (3) 2 (2) ? ? nc ? no connection (9, 24) ? ? test ? test signal input 4 (4) ? ? reset ? reset signal 7 (7) ? b ks0?ks3 ks4?ks7 i/o quasi-interrupt inputs with falling edge detection 14?17 (15?18) 18?21 (19?22) p6.0? p6.3 p7.0? p7.3 d-4 note: parentheses indicate the pin number for 32-sop package.
s3c7524/c7528/p7528/c7534/c7538/p7538 p roduct overview 1 - 11 pin circuit diagrams v dd p - channel in n - channel figure 1?6. pin circuit type a schmitt trigger v dd pull-up resistor in figure 1?7. pin circuit type b p - channel resistor enable v dd pull-up resistor schmitt trigger in figure 1?8. pin circuit type a-4 data output disable out v dd p - channel n - channel figure 1?9. pin circuit type c
product overview ks 57c5204/c5208/p5208/c5304/c5308/p5308 microcontroller 1- 12 p-channel pull-up resistor resistor enable data output disable i/o v dd circuit type c figure 1?10. pin circuit type d-2 p-channel pull-up resistor resistor enable data output disable schmitt triger i/o v dd circuit type c figure 1?11. pin circuit type d-4 data output disable v dd p - channel pull-up resistor enable n - channel pne v dd pull-up resistor i/o figure 1?12. pin circuit type e-2 output disable dtmf out figure 1?13. pin circuit type g-6
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 1 2 address spaces program memory (rom) overview rom maps for the s3c7524/c7528/c7534/c7538 are mask programmable at the factory. in its standard configuration, the device's 4,096 x 8-bit (s3c7524/c7534) or 8,192 8-bit (s3c7528/c7538) program memory have three areas that are directly addressable by the program counter (pc): ? 16-byte area for vector addresses ? 16-byte general-purpose area ? 96-byte instruction reference area ? 3,968-byte general-purpose area ( s3c7524/c7534) 8,064-byte general-purpose area (s3c7528/c7538) general-purpose program memory two program memory areas are allocated for general-purpose use: one area is 16 bytes in size and the other is 3,968 bytes(s3c7524/c7534) or 8,064 bytes(s3c7528/c7538). vector addresses a 16-byte vector address area is used to store the vector addresses required to execute system resets and interrupts. start addresses for interrupt service routines are stored in this area, along with the values of the enable memory bank (emb) and enable register bank (erb) flags that are used to initialize the corresponding service routines. the 16-byte area can be used alternately as general-purpose rom. ref instructions locations 0020h?007fh are used as a reference area (look-up table) for 1-byte ref instructions. the ref instruction reduces the byte size of instruction operands. ref can reference one 2 -byte instruction, two 1-byte instructions, and three-byte instructions which are stored in the look-up table. unused look-up table addresses can be used as general-purpose rom.
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 2 table 2?1. program memory address ranges rom area function address ranges area size (in bytes) vector address area 0000h?000fh 16 general-purpose program memory 0010h?001fh 16 ref instruction look-up table area 0020h?007fh 96 general-purpose program memory 0080h?0fffh 0080h?1fffh 3,968 (s3c7524/c7534) 8,064 (s3c7528/c7538) general-purpose memory areas the 16-byte area at rom locations 0010h?001fh and 3,968-byte (s3c7524/c7534) area at rom locations 0080h?0fffh or the 8,064-byte (s3c7528/c7538) area at rom locations 0080h?1fffh are used as general- purpose program memory. unused locations in the vector address area and ref instruction look-up table areas can be used as general-purpose program memory. however, care must be taken not to overwrite live data when writing programs that use special-purpose areas of the rom. vector address area the 16-byte vector address area of the rom is used to store the vector addresses for executing system resets and interrupts. the starting addresses of interrupt service routines are stored in this area, along with the enable memory bank (emb) and enable register bank (erb) flag values that are needed to initialize the service routines. 16-byte vector addresses are organized as follows: emb erb 0 pc12 pc11 pc10 pc9 pc8 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 to set up the vector address area for specific programs, use the instruction ventn. the programming tips on the next page explain how to do this. note: pc12 is not used in the s3c7524/c7534 and the value of pc 12 is always ?0?.
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 3 general-purpose area (16 bytes) general-purpose area vector address area (16 bytes) instruction reference area (96 bytes) 0000h 000fh 0010h 0 01fh 0020h 007fh 0080h 1fffh general-purpose area 0fffh 1 000h s3c7524/c7534 (3,968 bytes) s3c7528/c7538 (8,064 bytes) figure 2?1. rom address structure 7 6 5 4 3 2 1 0 reset intb / int4 (note) int0 int1 (note) not implemonted intt0 intt1 0000h 0002h 0004h 0006h 0008h 000ah 000ch 000eh not implemented (reserved for future use) (reserved for future use) note: s3c7534/c7538 does not use the int1 and int4 interrupts. figure 2?2. vector address map
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 4 + + p rogramming tip ? defining vectored interrupts the following examples show you several ways you can define the vectored interrupt and instruction reference areas in program memory: 1. when all vector interrupts are used: org 0000h vent0 1,0,reset ; emb ? 1, erb ? 0; jump to reset address vent1 0,0,intb ; emb ? 0, erb ? 0; jump to intb address vent2 0,0,int0 ; emb ? 0, erb ? 0; jump to int0 address vent3 0,0,int1 (note) ; emb ? 0, erb ? 0; jump to int1 address nop nop vent5 0,0,intt0 ; emb ? 0, erb ? 0; jump to intt0 address vent6 0,0,intt1 ; emb ? 0, erb ? 0; jump to intt1 address 2. when a specific vectored interrupt such as int0, and intt0 is not used, the unused vector interrupt locations must be skipped with the assembly instruction org so that jumps will address the correct locations: org 0000h ve nt0 1,0,reset ; emb ? 1, erb ? 0; jump to reset address vent1 0,0,intb ; emb ? 0, erb ? 0; jump to intb address org 0006h ; int0 interrupt not used vent3 0,0,int1 (note) ; emb ? 0, erb ? 0; jump to int1 address org 000ch ; intt0 interrupt not used vent6 0,0,intt1 ; emb ? 0, erb ? 0; jump to intt1 address org 0010h 3. if an int0 interrupt is not used and if its corresponding vector interrupt area is not fully utilized, or if it is not written by a org instruction as in example 2, a cpu malfunction will occur: org 0000h vent0 1,0,reset ; emb ? 1, erb ? 0; jump to reset address vent1 0,0,intb ; emb ? 0, erb ? 0; jump to intb address vent3 0,0,int1 (note) ; emb ? 0, erb ? 0; jump to int0 address nop nop vent5 0,0,intt0 ; emb ? 0, erb ? 0; jump to int1 address vent6 0,0,intt1 ; emb ? 0, erb ? 0; jump to intt0 address org 0010h general-purpose rom area in this example, when an intt0 interrupt is generated, the corresponding vector area is not ven t5 intt0, but vent6 intt1. this causes an intt0 interrupt to jump incorrectly to the intt1 address and causes a cpu malfunction to occur. note : s3c7534/c7538 does not use the int1 interrupt.
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 5 instruction reference area using 1-byte ref instructions, you can easily reference instructions with larger byte sizes that are stored in addresses 0020h?007fh of program memory. this 96-byte area is called the ref instruction reference area, or look-up table. locations in the ref look-up table may contain two one-byte instructions, a single two-byte instruction, or three-byte instruction such as a jp (jump) or call. the starting address of the instruction you are referencing must always be an even number. to reference a jp or call instruction, it must be written to the reference area in a two-byte format: for jp, this format is tjp; for call, it is tcall. you can use ref instructions to execute instructions larger than one byte. there are tree ways you can use ref instruction: ? using the 1-byte ref instruction to execute one 2-byte or two 1-byte instructions, ? branching to any location by referencing a branch instruction stored in the look-up table, ? calling subroutines at any location by referencing a call instruction stored in the look-up table. + + programming tip ? using the ref look-up table here is one example of how to use the ref instruction look-up table: org 0020h jmain tjp main ; 0, main keyck btsf keyfg ; 1, keyfg check watch tcall clock ; 2, call clock inchl ld @hl,a ; 3, (hl) ? a incs hl ? ? ? abc ld ea,#00h ; 47, ea ? #00h org 0080 main nop nop ? ? ? ref keyck ; btsf keyfg (1-byte instruction) ref jmain ; keyfg = 1, jump to main (1-byte instruction) ref watch ; keyfg = 0, call clock (1-byte instruction) ref inchl ; ld @hl,a ; incs hl ref abc ; ld ea,#00h (1-byte instruction) ? ? ?
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 6 data memory (ram) overview in its standard configuration, the 896 4 -bit data memory has five areas: ? 32 4-bit working register area ? 224 4-bit general-purpose area (also used as stack area) ? 2 256 4-bit general-purpose area ? 128 4-bit area for peripheral hardware to make it easier to reference, the data memory area has four memory banks ? bank 0, bank 1, bank 2, and bank 15. the select memory bank instruction (smb) is used to select the bank you want to select as working data memory. data stored in ram locations are 1-, 4-, and 8-bit addressable. initialization values for the data memory area are not defined by hardware and must therefore be initialized by program software following reset . however, when reset signal is generated in power-down mode, the data memory contents are held. general-purpose registers and stack area (224 x 4 bits) working registers (32 x 4 bits) general-purpose registers (256 x 4 bits) general-purpose registers (256 x 4 bits) memory-mapped i/o aeeress registers (128 x 4 bits) 000h 01fh 020h 0ffh 100h 1ffh 200h fffh 2ffh f80h ~ ~ bank 0 bank 1 bank 15 bank 2 figure 2?3. data memory (ram) map
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 7 memory banks 0, 1, 2, and 15 bank 0 (000h?0ffh) the lowest 32 nibbles of bank 0 (000h?01fh) are used as working registers; the next 224 nibbles (020h?0ffh) can be used both as stack area and as general-purpose data memory. use the stack area for implementing subroutine calls and returns, and for interrupt processing. bank 1 (100h?1ffh) the 256 nibbles of bank 1 (100h?1ffh) are for general-purpose use. bank 2 (200h?2ffh) the 256 nibbles of bank 2 (200h?2ffh) are for general-purpose use bank 15 (f80h?fffh) the microcontroller uses bank 15 for memory-mapped peripheral i/o. fixed ram locations for each peripheral hardware register: the port latches, timers, peripherals controls, etc. are mapped into this area. data memory addressing modes the enable memory bank (emb) flag controls the addressing mode for data memory banks 0, 1, 2 or 15. when the emb flag is logic zero, the addressable area is restricted to specific locations, depending on whether direct or indirect addressing is used. with direct addressing, you can access locations 000h?07fh of bank 0 and bank 15. with indirect addressing, only bank 0 (000h?0ffh) can be accessed. when the emb flag is set to logic one, all four data memory banks can be accessed according to the current smb value. for 8-bit addressing, two 4-bit registers are addressed as a register pair. also, when using 8-bit instructions to address ram locations, remember to use the even-numbered register address as the instruction operand. working registers the ram working register area in data memory bank 0 is further divided into four register banks (bank 0, 1, 2, and 3). each register bank has eight 4-bit registers and paired 4-bit registers are 8-bit addressable. register a is used as a 4-bit accumulator and register pair ea as an 8-bit extended accumulator. the carry flag bit can also be used as a 1-bit accumulator. register pairs wx, wl, and hl are used as address pointers for indirect addressing. to limit the possibility of data corruption due to incorrect register addressing, it is advisable to use register bank 0 for the main program and banks 1, 2, and 3 for interrupt service routines.
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 8 table 2?2. data memory organization and addressing addresses register areas bank emb value smb value 000h?01fh working registers 0 0, 1 0 020h?0ffh stack and general-purpose registers 100h?1ffh general-purpose registers 1 1 1 200h?2ffh general-purpose registers 2 1 2 f80h?fffh peripheral hardware registers 15 0, 1 15 + + programming tip ? clearing data memory banks 0 and 1 clear banks 0 and 1 of the data memory area: ramclr smb 1 ; ram (100h?1ffh) clear ld hl,#00h ld a,#0h rmcl1 ld @hl,a incs hl jr rmcl1 smb 0 ; ram (010h?0ffh) clear ld hl,#10h rmcl0 ld @hl,a incs hl jr rmcl0
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 9 working registers working registers, mapped to ram address 000h?01fh in data memory bank 0, are used to temporarily store intermediate results during program execution, as well as pointer values used for indirect addressing. unused registers may be used as general-purpose memory. working register data can be manipulated as 1-bit units, 4-bit units or, using paired registers, as 8-bit units. 000h 0001 002h 003h 004h 005h 006h 007h 00fh 010h 017h 018h 01fh 008h a e l h x w z y a ... y register bank 1 register bank 2 register bank 3 a ... y a ... y working register bank 0 data memory bank 0 figure 2?4. working register map
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 10 working register banks for addressing purposes, the working register area is divided into four register banks ? bank 0, bank 1, bank 2, and bank 3. any one of these banks can be selected as the working register bank by the register bank selection instruction (srb n) and by setting the status of the register bank enable flag (erb). generally, working register bank 0 is used for the main program, and banks 1, 2, and 3 for interrupt service routines. following this convention helps to prevent possible data corruption during program execution due to contention in register bank addressing. table 2?3. working register organization and addressing erb setting srb settings selected register bank 3 2 1 0 0 0 0 x x always set to bank 0 0 0 bank 0 1 0 0 0 1 bank 1 1 0 bank 2 1 1 bank 3 note : x = not applicable. paired working registers each of the register banks is subdivided into eight 4-bit registers. these registers, named y, z, w, x, h, l, e and a, can either be manipulated individually using 4-bit instructions, or together as register pairs for 8-bit data manipulation. the names of the 8-bit register pairs in each register bank are ea, hl, wx, yz and wl. registers a, l, x and z always become the lower nibble when registers are addressed as 8-bit pairs. this makes a total of eight 4-bit registers or four 8-bit double registers in each of the four working register banks. (msb) (lsb) (msb) (lsb) y w h e z x l a figure 2?5. register pair configuration
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 11 special-purpose working registers register a is used as a 4-bit accumulator and double register ea as an 8-bit accumulator. the carry flag can also be used as a 1-bit accumulator. 8-bit double registers wx, wl and hl are used as data pointers for indirect addressing. when the hl register serves as a data pointer, the instructions ldi, ldd, xchi, and xchd can make very efficient use of working registers as program loop counters by letting you transfer a value to the l register and increment or decrement it using a single instruction. c a ea 8-bit accumulator 1-bit accumulator 4-bit accumulator figure 2?6. 1-bit, 4-bit, and 8-bit accumulator recommendation for multiple interrupt processing if more than four interrupts are being processed at one time, you can avoid possible loss of working register data by using the push rr instruction to save register contents to the stack before the service routines are executed in the same register bank. when the routines have executed successfully, you can restore the register contents from the stack to working memory using the pop instruction.
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 12 + + programming tip ? selecting the working register area the following examples show the correct programming method for selecting working register area: 1. when erb = "0": vent2 1,0,int0 ; emb ? 1, erb ? 0, jump to int0 address ; int0 push sb ; push current smb, srb srb 2 ; instruction does not execute because erb = "0" push hl ; push hl register contents to stack push wx ; push wx register contents to stack push yz ; push yz register contents to stack push ea ; push ea register contents to stack smb 0 ld ea,#00h ld 80h,ea ld hl,#40h incs hl ld wx,ea ld yz,ea pop ea ; pop ea register contents from stack pop yz ; pop yz register contents from stack pop wx ; pop wx register contents from stack pop hl ; pop hl register contents from stack pop sb ; pop current smb, srb iret the pop instructions execute alternately with the push instructions. if an smb n instruction is used in an interrupt service routine, a push and pop sb instruction must be used to store and restore the current smb and srb values, as shown in example 2 below. 2. when erb = "1": vent2 1,1, int0 ; emb ? 1, erb ? 1, jump to int0 address ; int0 push sb ; store current smb, srb srb 2 ; select register bank 2 because of erb = "1" smb 0 ld ea,#00h ld 80h,ea ld hl,#40h incs hl ld wx,ea ld yz,ea pop sb ; restore smb, srb iret
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 13 + + programming tip ? selecting the working register area the following examples show the correct programming method for selecting working register area: 1. when erb = "0": vent2 1,0 ,int0 ; emb ? 1, erb ? 0, jump to int0 address int0 push sb ; push current smb, srb srb 2 ; instruction does not execute because erb = "0" push hl ; push hl register contents to stack push wx ; push wx register contents to stack push yz ; push yz register contents to stack push ea ; push ea register contents to stack smb 0 ld ea,#00h ld 80h,ea ld hl,#40h incs hl| ld wx,ea ld yz,ea pop ea ; pop ea register contents from stack pop yz ; pop yz register contents from stack pop wx ; pop wx register contents from stack pop hl ; pop hl register contents from stack pop sb ; pop current smb, srb iret the pop instructions execute alternately with the push instructions. if an smb n instruction is used in an interrupt service routine, a push and pop sb instruction must be used to store and restore the current smb and srb values, as shown in example 2 below. 2. when erb = "1": vent2 1,1,int0 ; emb ? 1, erb ? 1, jump to int0 address int0 push sb ; store current smb, srb srb 2 ; select register bank 2 because of erb = "1" smb 0 ld ea,#00h ld 80h,ea ld hl,#40h incs hl ld wx,ea ld yz,ea pop sb ; restore smb, srb iret
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 14 stack operations stack pointer (sp) the stack pointer (sp) is an 8-bit register that stores the address used to access the stack, an area of data memory set aside for temporary storage of stack addresses. the sp can be read or written by 8 -bit control instructions. when addressing the sp, bit 0 must always remain cleared to logic zero. f80h sp3 sp2 sp1 "0" f81h sp7 sp6 sp5 sp4 there are two basic stack operations: writing to the top of the stack (push), and reading from the top of the stack (pop). a push decrements the sp and a pop increments it so that the sp always points to the top address of the last data to be written to the stack. the program counter contents and program status word are stored in the stack area prior to the execution of a call or a push instruction, or during interrupt service routines. stack operation is a lifo (last in-first out) type. the stack area is located in general-purpose data memory bank 0. during an interrupt or a subroutine, the pc value and the psw are saved to the stack area. when the routine has completed, the stack pointer is referenced to restore the pc and psw, and the next instruction is executed. the sp can address stack registers in bank 0 (addresses 000h-0ffh) regardless of the current value of the enable memory bank (emb) flag and the select memory bank (smb) flag. although general-purpose register areas can be used for stack operations, be careful to avoid data loss due to simultaneous use of the same register(s). since the reset value of the stack pointer is not defined in firmware, we recommend that you initialize the stack pointer by program code to location 00h. this sets the first register of the stack area to 0ffh. note a subroutine call occupies six nibbles in the stack; an interrupt requires six. when subroutine nesting or interrupt routines are used continuously, the stack area should be set in accordance with the maximum number of subroutine levels. to do this, estimate the number of nibbles that will be used for the subroutines or interrupts and set the stack area correspondingly. + + p rogramming tip ? initializing the stack pointer to initialize the stack pointer (sp): 1. when emb = "1": smb 15 ; select memory bank 15 ld ea,#00h ; bit 0 of accumulator a is always cleared to "0" ld sp,ea ; stack area initial address (0ffh) ? (sp) ? 1 2. when emb = "0": ld ea,#00h ld sp,ea ; memory addressing area (00h?7fh, f80h?fffh)
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 15 push operations three kinds of push operations reference the stack pointer (sp) to write data from the source register to the stack: push instructions, call instructions, and interrupts. in each case, the sp is decreased by a number determined by the type of push operation and then points to the next available stack location. push instructions a push instruction references the sp to write two 4-bit data nibbles to the stack. two 4-bit stack addresses are referenced by the stack pointer: one for the upper register value and another for the lower register. after the push has executed, the sp is decreased by two and points to the next available stack location. call instructions when a subroutine call is issued, the call instruction references the sp to write the pc's contents to six 4 -bit stack locations. current values for the enable memory bank (emb) flag and the enable register bank (erb) flag are also pushed to the stack. since six 4-bit stack locations are used per call, you may nest subroutine calls up to the number of levels permitted in the stack. interrupt routines an interrupt routine references the sp to push the contents of the pc and the program status word (psw) to the stack. six 4-bit stack locations are used to store this data. after the interrupt has executed, the sp is decreased by six and points to the next available stack location. during an interrupt sequence, subroutines may be nested up to the number of levels which are permitted in the stack area. sp ? 2 sp ? 1 sp lower upper push (after push, sp sp ? sp ? 6 sp ? 5 sp ? 4 sp ? 3 sp ? 2 sp ? 1 sp call (after call, sp sp ? 0 0 pc3 ? pc7 ? 0 0 emb erb 0 0 0 0 (note) pc12 0 pc11-pc8 interrup (when int is acknowledged, sp ? 6 sp ? 5 sp ? 4 sp ? 3 sp ? 2 sp ? 1 sp 0 0 pc3 ? pc7 ? is1 is0 emb erb psw c sc2 sc1 sc0 0 pc11-pc8 psw note: s3c7524/c7534 does not use pc12. (note) pc12 figure 2?7. push-type stack operations
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 16 pop operations for each push operation there is a corresponding pop operation to write data from the stack back to the source register or registers: for the push instruction it is the pop instruction; for call, the instruction ret or sret; for interrupts, the instruction iret. when a pop operation occurs, the sp is incremented by a number determined by the type of operation and points to the next free stack location. pop instructions a pop instruction references the sp to write data stored in two 4-bit stack locations back to the register pairs and sb register. the value of the lower 4-bit register is popped first, followed by the value of the upper 4-bit register. after the pop has executed, the sp is incremented by two and points to the next free stack location. ret and sret instructions the end of a subroutine call is signaled by the return instruction, ret or sret. the ret or sret uses the sp to reference the six 4-bit stack locations used for the call and to write this data back to the pc, the emb, and the erb. after the ret or sret has executed, the sp is incremented by six and points to the next free stack location. iret instructions the end of an interrupt sequence is signaled by the instruction iret. iret references the sp to locate the six 4- bit stack addresses used for the interrupt and to write this data back to the pc and the psw. after the iret has executed, the sp is incremented by six and points to the next free stack location. lower upper pop (sp sp + 2) ret or sret (sp sp + 6) 0 0 pc3 ? pc7 ? 0 0 emb erb 0 0 0 0 0 pc11 ? pc8 iret (sp sp + 6) 0 0 pc3 ? pc7 ? is1 is0 emb erb psw c sc2 sc1 sc0 0 pc11 ? pc8 sp sp + 1 sp + 2 sp + 3 sp + 4 sp + 5 sp + 6 sp sp + 1 sp + 2 sp + 3 sp + 4 sp + 5 sp + 6 sp sp + 1 sp + 2 psw (note) pc12 (note) pc12 note: s3c7524/c7534 does not use pc12. figure 2?8. pop-type stack operations
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 17 bit sequential carrier (bsc) the bit sequential carrier (bsc) is a 8-bit general register that can be manipulated using 1-, 4-, and 8-bit ram control instructions. reset clears all bsc bit values to logic zero. using the bsc, you can specify sequential addresses and bit locations using 1-bit indirect addressing (memb.@l). (bit addressing is independent of the current emb value.) this way, programs can process 8-bit data by moving the bit location sequentially and then incrementing or decreasing the value of the l register. bsc data can also be manipulated using direct addressing. if the values of the l register are 0h at bsc2.@l, the address and bit location assignment is fc2h.0. if the l register content is 8h at bsc2.@l, the address and bit location assignment is fc3h.3. table 2?4. bsc register organization name address bit 3 bit 2 bit 1 bit 0 bsc0 fc0h bsc0.3 bsc0.2 bsc0.1 bsc0.0 bsc1 fc1h bsc1.3 bsc1.2 bsc1.1 bsc1.0 bsc2 fc2h bsc2.3 bsc2.2 bsc2.1 bsc2.0 bsc3 fc3h bsc3.3 bsc3.2 bsc3.1 bsc3.0 + + programming tip ? using the bsc register to output 16-bit data to use the bit sequential carrier (bsc) register to output 8-bit data (59h) to the p2.3 pin: bits emb smb 15 ld ea,#59h ; ld bsc2,ea ; bsc2 ? a, bsc3 ? e smb 0 ld l,#8h ; agn ldb c,bsc2.@l ; ldb p2.3,c ; p2.3 ? c incs l jr agn ret
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 18 program counter (pc) a 13-bit program counter (pc) stores addresses for instruction fetches during program execution. whenever a reset operation or an interrupt occurs, bits pc11 (s3c7524/c7534) or bits pc12 (s3c7528/c7538) through pc0 are set to the vector address. usually, the pc is incremented by the number of bytes of the instruction being fetched. one exception is the 1- byte ref instruction which is used to reference instructions stored in the rom. program status word (psw) the program status word (psw) is an 8-bit word that defines system status and program execution status and which permits an interrupted process to resume operation after an interrupt request has been serviced. psw values are mapped as follows: fb0h is1 is0 emb erb fb1h c sc2 sc1 sc0 the psw can be manipulated by 1-bit or 4-bit read/write and by 8-bit read instructions, depending on the specific bit or bits being addressed. the psw can be addressed during program execution regardless of the current value of the enable memory bank (emb) flag. part or all of the psw is saved to stack prior to execution of a subroutine call or hardware interrupt. after the interrupt has been processed, the psw values are popped from the stack back to the psw address. when a reset is generated, the emb and erb values are set according to the reset vector address, and the carry flag is left undefined (or the current value is retained). psw bits is0, is1, sc0, sc1, and sc2 are all cleared to logical zero. table 2?5. program status word bit descriptions psw bit identifier description bit addressing read/write is1, is0 interrupt status flags 1, 4 r/w emb enable memory bank flag 1 r/w erb enable register bank flag 1 r/w c carry flag 1 r/w sc2, sc1, sc0 program skip flags 8 r
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 19 interrupt status flags (is0, is1) psw bits is0 and is1 contain the current interrupt execution status values. you can manipulate is0 and is1 flags directly using 1-bit ram control instructions by manipulating interrupt status flags in conjunction with the interrupt priority register (ipr), you can process multiple interrupts by anticipating the next interrupt in an execution sequence. the interrupt priority control circuit determines the is0 and is1 settings in order to control multiple interrupt processing. when both interrupt status flags are set to "0", all interrupts are allowed. the priority with which interrupts are processed is then determined by the ipr. when an interrupt occurs, is0 and is1 are pushed to the stack as part of the psw and are automatically incremented to the next status. then, when the interrupt service routine ends with an iret instruction, is0 and is1 values are restored to the psw. table 2?6 shows the effects of is0 and is1 flag settings. table 2?6. interrupt status flag bit settings is1 value is0 value status of currently executing process effect of is0 and is1 settings on interrupt request control 0 0 0 all interrupt requests are serviced 0 1 1 only high-priority interrupt as determined in the interrupt priority register (ipr) is serviced 1 0 2 no more interrupt requests are serviced 1 1 ? not applicable; these bit settings are undefined since interrupt status flags can be addressed by write instructions, programs can exert direct control over interrupt processing status. before interrupt status flags can be addressed, however, you must first execute a di instruction to inhibit additional interrupt routines. when the bit manipulation has been completed, execute an ei instruction to re -enable interrupt processing. + + programming tip ? setting isx flags for interrupt processing the following instruction sequence shows how to use the is0 and is1 flags to control interrupt processing: intb di ; disable interrupt bitr is1 ; is1 ? 0 bits is0 ; allow interrupts according to ipr priority level ei ; enable interrupt
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 20 emb flag (emb) the emb flag is used to enable whether the memory bank selected by smb register is to be valid or not. in this way, it controls the addressing mode for data memory banks 0, 1, or 15. when the emb flag is "0", the data memory address space is restricted to bank 15 and addresses 000h?07fh of memory bank 0, regardless of the smb register contents. when the emb flag is set to "1", the general-purpose areas of bank 0, 1, and 15 can be accessed by using the appropriate smb value. + + programming tip ? using the emb flag to select memory banks emb flag settings for memory bank selection: 1. when emb = "0": smb 1 ; non-essential instruction since emb = "0" ld a,#9h ld 90h,a ; (f90h) ? a, bank 15 is selected ld 34h,a ; (034h) ? a, bank 0 is selected smb 0 ; non-essential instruction since emb = "0" ld 90h,a ; (f90h) ? a, bank 15 is selected ld 34h,a ; (034h) ? a, bank 0 is selected smb 15 ; non-essential instruction, since emb = "0" ld 20h,a ; (020h) ? a, bank 0 is selected ld 90h,a ; (f90h) ? a, bank 15 is selected 2. when emb = "1": smb 1 ; select memory bank 1 ld a,#9h ld 90h,a ; (190h) ? a, bank 1 is selected ld 34h,a ; (134h) ? a, bank 1 is selected smb 0 ; select memory bank 0 ld 90h,a ; (090h) ? a, bank 0 is selected ld 34h,a ; (034h) ? a, bank 0 is selected smb 15 ; select memory bank 15 ld 20h,a ; program error, but assembler does not detect it ld 90h,a ; (f90h) ? a, bank 15 is selected
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 21 erb flag (erb) the 1-bit register bank enable flag (erb) determines the range of addressable working register area. when the erb flag is "1", the working register area from register banks 0 to 3 is selected according to the register bank selection register (srb). when the erb flag is "0", register bank 0 is the selected working register area, regardless of the current value of the register bank selection register (srb). when an internal reset is generated, bit 6 of program memory address 0000h is written to the erb flag. this automatically initializes the flag. when a vectored interrupt is generated, bit 6 of the respective address table in program memory is written to the erb flag, setting the correct flag status before the interrupt service routine is executed. during the interrupt routine, the erb value is automatically pushed to the stack area along with the other psw bits. afterwards, it is popped back to the fb0h.0 bit location in the psw. the initial erb flag settings for each vectored interrupt are defined using ventn instructions. + + programming tip ? using the erb flag to select register banks erb flag settings for register bank selection: 1. when erb = "0": srb 1 ; register bank 0 is selected (since erb = "0", the ; srb is configured to bank 0) ld ea,#34h ; bank 0 ea ? #34h ld hl,ea ; bank 0 hl ? ea srb 2 ; register bank 0 is selected ld yz,ea ; bank 0 yz ? ea srb 3 ; register bank 0 is selected ld wx,ea ; bank 0 wx ? ea 2. when erb = "1": srb 1 ; register bank 1 is selected ld ea,#34h ; bank 1 ea ? #34h ld hl,ea ; bank 1 hl ? bank 1 ea srb 2 ; register bank 2 is selected ld yz,ea ; bank 2 yz ? bank2 ea srb 3 ; register bank 3 is selected ld wx,ea ; bank 3 wx ? bank 3 ea
address spaces s3c7 524/c7528/p7528/c7534/c7538/p7538 2? 22 skip condition flags (sc2, sc1, sc0) the skip condition flags sc2, sc1, and sc0 indicate the current program skip conditions and are set and reset automatically during program execution. skip condition flags can only be addressed by 8-bit read instructions. direct manipulation of the sc2, sc1, and sc0 bits is not allowed. carry flag (c) the carry flag is used to save the result of an overflow or borrow when executing arithmetic instructions involving a carry (adc, sbc). the carry flag can also be used as a 1-bit accumulator for performing boolean operations involving bit-addressed data memory. if an overflow or borrow condition occurs when executing arithmetic instructions with carry (adc, sbc), the carry flag is set to "1". otherwise, its value is "0". when a reset occurs, the current value of the carry flag is retained during power-down mode, but when normal operating mode resumes, its value is undefined. the carry flag can be directly manipulated by predefined set of 1-bit read/write instructions, independent of other bits in the psw. only the adc and sbc instructions, and the instructions listed in table 2?7, affect the carry flag. table 2?7. valid carry flag manipulation instructions operation type instructions carry flag manipulation direct manipulation scf set carry flag to "1" rcf clear carry flag to "0" (reset carry flag) ccf invert carry flag value (complement carry flag) btst c test carry and skip if c = "1" bit transfer ldb (operand) (1) ,c load carry flag value to the specified bit ldb c,(operand) (1) load contents of the specified bit to carry flag data transfer rrc a rotate right through carry flag boolean manipulation band c,(operand) (1) and the specified bit with contents of carry flag and save the result to the carry flag bor c,(operand) (1) or the specified bit with contents of carry flag and save the result to the carry flag bxor c,(operand) (1) xor the specified bit with contents of carry flag and save the result to the carry flag interrupt routine intn (2) save carry flag to stack with other psw bits return from interrupt iret restore carry flag from stack with other psw bits notes 1. the operand has three bit addressing formats: mema.a, memb.@l, and @h + da.b. 2. 'intn' refers to the specific interrupt being executed and is not an instruction.
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddress spaces 2? 23 + + programming tip ? using the carry flag as a 1-bit accumulator 1. set the carry flag to logic one: scf ; c ? 1 ld ea,#0c3h ; ea ? #0c3h ld hl,#0aah ; hl ? #0aah adc ea,hl ; ea ? #0c3h + #0aah + #1h, c ? 1 2. logical-and bit 3 of address 3fh with p3.3 and output the result to p5.0: ld h,#3h ; set the upper four bits of the address to the h register value ldb c,@h+0fh.3 ; c ? bit 3 of 3fh band c,p3.3 ; c ? c and p3.3 ldb p5.0,c ; output result from carry flag to p5.0
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddressing modes 3? 1 3 addressing modes overview the enable memory bank flag, emb, controls the two addressing modes for data memory. when the emb flag is set to logic one, you can address the entire ram area; when the emb flag is cleared to logic zero, the addressable area in the ram is restricted to specific locations. the emb flag works in connection with the select memory bank instruction, smbn. you will recall that the smbn instruction is used to select ram bank 0, 1, 2 or 15. the smb setting is always contained in the upper four bits of a 12-bit ram address. for this reason, both addressing modes (emb = "0" and emb = "1") apply specifically to the memory bank indicated by the smb instruction, and any restrictions to the addressable area within banks 0, 1, 2 or 15. direct and indirect 1-bit, 4-bit, and 8-bit addressing methods can be used. several ram locations are addressable at all times, regardless of the current emb flag setting. here are a few guidelines to keep in mind regarding data memory addressing: ? when you address peripheral hardware locations in bank 15, the mnemonic for the memory-mapped hardware component can be used as the operand in place of the actual address location. ? always use an even-numbered ram addre ss as the operand in 8-bit direct and indirect addressing. ? with direct addressing, use the ram address as the instruction operand; with indirect addressing, the instruction specifies a register which contains the operand's address.
addressing modes s3 c7524/c7528/p7528/c7534/c7538/p7538 3? 2 da da.b @hl @h + da.b @wx @wl mema.b memb.@l emb = 0 emb = 1 x x x 000h working registers bank 0 ( g eneral registers and stack) 01fh 020h 0ffh 100h 1ffh 200h 2ffh f80h bank 1 (general registers) ram areas addressing mode fffh bank 15 (peripheral hardware registers) fb0h fbfh fc0h smb = 15 smb = 15 notes 1. 'x' means don't care. 2. blank columns indicate ram areas that are not addressable, given the addressing method and enable memory bank (emb) flag setting shown in the column headers. emb = 1 emb = 0 smb = 0 smb = 0 smb = 1 smb = 1 smb = 2 smb = 2 bank 2 (general registers) 07fh 080h figure 3?1. ram address structure
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddressing modes 3? 3 emb and erb initialization values the emb and erb flag bits are set automatically by the values of the reset vector address and the interrupt vector address. when a reset is generated internally, bit 7 of program memory address 0000h is written to the emb flag, initializing it automatically. when a vectored interrupt is generated, bit 7 of the respective vector address table is written to the emb. this automatically sets the emb flag status for the interrupt service routine. when the interrupt is serviced, the emb value is automatically saved to stack and then restored when the interrupt routine has completed. at the beginning of a program, the initial emb and erb flag values for each vectored interrupt must be set by using vent instruction. the emb and erb can be set or reset by bit manipulation instructions (bits, bitr) despite the current smb setting. + + programming tip ? initializing the emb and erb flags the following assembly instructions show how to initialize the emb and erb flag settings: org 0000h ; rom address assignment vent0 1,0,reset ; emb ? 1, erb ? 0, branch reset vent1 0,1,intb ; emb ? 0, erb ? 1, branch intb vent2 0,1,int0 ; emb ? 0, erb ? 1, branch int0 vent3 0,1,int1 (note) ; emb ? 0, erb ? 1, branch int1 nop nop vent5 0,1,intt0 ; emb ? 0, erb ? 1, branch intt0 vent6 0,1,intt1 ; emb ? 0, erb ? 1, branch intt1 ? ? ? reset bitr emb note: s3c7534/c7538 does not use the int1 interrupt.
addressing modes s3 c7524/c7528/p7528/c7534/c7538/p7538 3? 4 enable memory bank settings emb = "1" when the enable memory bank flag emb is set to logic one, you can address the data memory bank specified by the select memory bank (smb) value (0, 1, 2 or 15) using 1-, 4-, or 8-bit instructions. you can use both direct and indirect addressing modes. the addressable ram areas when emb = "1" are as follows: ? if smb = 0, 000h?0ffh ? if smb = 1, 100h?1ffh ? if smb = 2, 200h?2ffh ? if smb = 15, f80h?fffh emb = "0" when the enable memory bank flag emb is set to logic zero, the addressable area is defined independently of the smb value, and is restricted to specific locations depending on whether a direct or indirect address mode is used. if emb = "0", the addressable area is restricted to locations 000h?07fh in bank 0 and to locations f80h?fffh in bank 15 for direct addressing. for indirect addressing, only locations 000h?0ffh in bank 0 are addressable, regardless of smb value. to address the peripheral hardware register (bank 15) using indirect addressing, the emb flag must first be set to "1" and the smb value to "15". when a reset occurs, the emb flag is set to the value contained in bit 7 of rom address 0000h. emb-independent addressing at any time, several areas of the data memory can be addressed independently of the current status of the emb flag. these exceptions are described in table 3?1. table 3?1. ram addressing not affected by the emb value address addressing method affected hardware program examples 000h?0ffh 4-bit indirect addressing using wx and wl register pairs; 8-bit indirect addressing using sp not applicable ld a,@wx push pop fb0h?fbfh ff0h?fffh 1-bit direct addressing psw, iex, irqx, i/o bits emb bitr ie4 fc0h?fffh 1-bit indirect addressing using the l register i/o band c,p3.@l
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddressing modes 3? 5 select bank register (sb) the select bank register (sb) is used to assign the memory bank and register bank. the 8-bit sb register consists of the 4-bit select register bank register (srb) and the 4-bit select memory bank register (smb), as shown in figure 3?2. during interrupts and subroutine calls, sb register contents can be saved to stack in 8-bit units by the push sb instruction. you later restore the value to the sb using the pop sb instruction. smb 3 smb 2 smb 1 smb 0 0 0 srb 1 srb 0 srb (f82h) smb (f83h) sb register figure 3?2. smb and srb values in the sb register select register bank (srb) instruction the select register bank (srb) value specifies which register bank is to be used as a working register bank. the srb value is set by the 'srb n' instruction, where n = 0, 1, 2, 3. one of the four register banks is selected by the combination of erb flag status and the srb value that is set using the 'srb n' instruction. the current srb value is retained until another register is requested by program software. push sb and pop sb instructions are used to save and restore the contents of srb during interrupts and subroutine calls. reset clears the 4-bit srb value to logic zero. select memory bank (smb) instruction to select one of the four available data memory banks, you must execute an smb n instruction specifying the number of the memory bank you want (0, 1, 2 or 15). for example, the instruction 'smb 1' selects bank 1 and 'smb 15' selects bank 15. (and remember to enable the selected memory bank by making the appropriate emb flag setting. the upper four bits of the 12-bit data memory address are stored in the smb register. if the smb value is not specified by software (or if a reset does not occur) the current value is retained. reset clears the 4-bit smb value to logic zero. the push sb and pop sb instructions save and restore the contents of the smb register to and from the stack area during interrupts and subroutine calls.
addressing modes s3 c7524/c7528/p7528/c7534/c7538/p7538 3? 6 direct and indirect addressing 1-bit, 4-bit, and 8-bit data stored in data memory locations can be addressed directly using a specific register or bit address as the instruction operand. indirect addressing specifies a memory location that contains the required direct address. the s3c7 instruction set supports 1-bit, 4-bit, and 8 -bit indirect addressing. for 8-bit indirect addressing, an even-numbered ram address must always be used as the instruction operand. 1-bit addressing table 3?2. 1-bit direct and indirect ram addressing operand notation addressing mode description emb flag setting addressable area memory bank hardware i/o mapping da.b direct: bit is indicated by the 0 000h?07fh bank 0 ? ram address (da), memory bank selection, and specified bit number (b). f80h?fffh bank 15 all 1-bit addressable peripherals (smb = 15) 1 000h?fffh smb = 0, 1, 2, 15 mema.b direct: bit is indicated by addressable area (mema) and bit number (b). x fb0h?fbfh ff0h?fffh bank 15 is0, is1, emb, erb, iex, irqx, pn.n memb.@l indirect: lower two bits of register l as indicated by the upper 10 bits of ram area (memb) and the upper two bits of register l. x fc0h?fffh bank 15 pn.n @h + da.b indirect: bit indicated by the lower four bits of the address (da), memory bank selection, and the h register identifier. 0 000h?0ffh bank 0 all 1-bit addressable peripherals (smb = 15) 1 000h?fffh smb = 0, 1, 2, 15 note : x = not applicable.
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddressing modes 3? 7 + + programming tip ? 1-bit addressing modes 1-bit direct addressing 1. if emb = "0": aflag equ 34h.3 bflag equ 85h.3 cflag equ 0bah.0 smb 0 bits aflag ; 34h.3 ? 1 bits bflag ; f85h.3 (bmod.3) ? 1 btst cflag ; if fbah.0 (irqw) = 1, skip bits bflag ; else if, fbah.0 (irqw) = 0, f85h.3 (bmod.3) ? 1 bits p3.0 ; ff3h.0 (p3.0) ? 1 2. if emb = "1": aflag equ 34h.3 bflag equ 85h.3 cflag equ 0bah.0 smb 0 bits aflag ; 34h.3 ? 1 bits bflag ; 85h.3 ? 1 btst cflag ; if 0bah.0 = 1, skip bits bflag ; else if 0bah.0 = 0, 085h.3 ? 1 bits p3.0 ; ff3h.0 (p3.0) ? 1 1-bit indirect addressing 1. if emb = "0": aflag equ 34h.3 bflag equ 85h.3 cflag equ 0bah.0 smb 0 ld h, #0bh ; h ? #0bh btstz @h+cflag ; if 0bah.0 = 1, 0bah.0 ? 0 and skip bits cflag ; else if 0bah.0 = 0, fbah.0 (irqw) ? 1 2. if emb = "1": aflag equ 34h.3 bflag equ 85h.3 cflag equ 0bah.0 smb 0 ld h,#0bh ; h ? #0bh btstz @h+cflag ; if 0bah.0 = 1, 0bah.0 ? 0 and skip bits cflag ; else if 0bah.0 = 0, 0bah.0 ? 1
addressing modes s3 c7524/c7528/p7528/c7534/c7538/p7538 3? 8 4-bit addressing table 3?3. 4-bit direct and indirect ram addressing operand notation addressing mode description emb flag setting addressable area memory bank hardware i/o mapping da direct: 4-bit address indicated 0 000h?07fh bank 0 ? by the ram address (da) and the memory bank selection f80h?fffh bank 15 all 4-bit addressable peripherals 1 000h?fffh smb = 0, 1, 2 15 (smb = 15) @hl indirect: 4-bit address indicated by the memory bank selection and register hl 0 000h?0ffh bank 0 ? 1 000h?fffh smb = 0, 1, 2 15 all 4-bit addressable peripherals (smb = 15) @wx indirect: 4-bit address indicated by register wx x 000h?0ffh bank 0 ? @wl indirect: 4-bit address indicated by register wl x 000h?0ffh bank 0 note : x = not applicable. + + programming tip ? 4-bit addressing modes 4-bit direct addressing 1. if emb = "0": adata equ 46h bdata equ 8eh smb 15 ; non-essential instruction, since emb = "0" ld a,p3 ; a ? (p3) smb 0 ; non-essential instruction, since emb = "0" ld adata,a ; (046h) ? a ld bdata,a ; (f8eh ) ? a 2. if emb = "1": adata equ 46h bdata equ 8eh smb 15 ld a,p3 ; a ? (p3) smb 0 ld adata,a ; (046h) ? a ld bdata,a ; (08eh) ? a
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddressing modes 3? 9 + + programming tip ? 4-bit addressing modes (continued) 4-bit indirect addressing (example 1) 1. if emb = "0", compare bank 0 locations 040h?046h with bank 0 locations 060h?066h: adata equ 46h bdata equ 66h smb 1 ; non-essential instruction, since emb = "0" ld hl,#bdata ld wx,#adata comp ld a,@wl ; a ? bank 0 (040h?046h) cpse a,@hl ; if bank 0 (0 60h?066h) = a, skip sret decs l jr comp ret 2. if emb = "1", compare bank 0 locations 040h?046h to bank 1 locations 160h?166h: adata equ 46h bdata equ 66h smb 1 ld hl,#bdata ld wx,#adata comp ld a,@wl ; a ? bank 0 (040h?046h) cpse a,@hl ; if bank 1 (160h?166h) = a, skip sret decs l jr comp ret
addressing modes s3 c7524/c7528/p7528/c7534/c7538/p7538 3? 10 + + programming tip ? 4-bit addressing modes (concluded) 4-bit indirect addressing (example 2) 1. if emb = "0", exchange bank 0 locations 040h?046h with bank 0 locations 060h?066h: adata equ 46h bdata equ 66h smb 1 ; non-essential instruction, since emb = "0" ld hl,#bdata ld wx,#adata trans ld a,@wl ; a ? bank 0 (040h?046mh) xchd a,@hl ; bank 0 (060h?066h) ? a jr trans 2. if emb = "1", exchange bank 0 locations 040h?046h to bank 1 locations 160h?166h: adata equ 46h bdata equ 66h smb 1 ld hl,#bdata ld wx,#adata trans ld a,@wl ; a ? bank 0 (040h?046h) xchd a,@hl ; bank 1 (160h?166h) ? a jr trans
s3c7524/c7528/p7528/c7534/c7538/p7538 a ddressing modes 3? 11 8-bit addressing table 3?4. 8-bit direct and indirect ram addressing instruction notation addressing mode description emb flag setting addressable area memory bank hardware i/o mapping da direct: 8-bit address indicated 0 000h?07fh bank 0 ? by the ram address ( da = even number ) and memory bank selection f80h?fffh bank 15 all 8-bit addressable peripherals 1 000h?fffh smb = 0, 1, 2, 15 (smb = 15) @hl indirect: the 8-bit address indicated by the memory bank selection and register hl; (the 4 -bit l register value must be an even number) 0 000h?0ffh bank 0 ? 1 000h?fffh smb = 0, 1, 2, 15 all 8-bit addressable peripherals (smb = 15)
addressing modes s3 c7524/c7528/p7528/c7534/c7538/p7538 3? 12 + + programming tip ? 8-bit addressing modes 8-bit direct addressing 1. if emb = "0": adata equ 46h bdata equ 8eh smb 15 ; non-essential instruction, since emb = "0" ld ea,p4 ; e ? (p5), a ? (p4) smb 0 ld adata,ea ; (046h) ? a, (047h) ? e ld bdata,ea ; (f8eh) ? a, (f8fh) ? e 2. if emb = "1": adata equ 46h bdata equ 8eh smb 15 ld ea,p4 ; e ? (p5), a ? (p4) smb 0 ld adata,ea ; (046h) ? a, (047h) ? e ld bdata,ea ; (08eh) ? a, (08fh) ? e 8-bit indirect addressing 1. if emb = "0": adata equ 146h smb 1 ; non-essential instruction, since emb = "0" ld hl,#adata ld ea,@hl ; a ? (046h), e ? (047h) 2. if emb = "1": adata equ 146h smb 1 ld hl,#adata ld ea,@hl ; a ? (146h), e ? (147h)
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 1 4 memory map overview to support program control of peripheral hardware, i/o addresses for peripherals are memory-mapped to bank 15 of the ram. memory mapping lets you use a mnemonic as the operand of an instruction in place of the specific memory location. access to bank 15 is controlled by the select memory bank (smb) instruction and by the enable memory bank flag (emb) setting. if the emb flag is ?0?, bank 15 can be addressed using direct addressing, regardless of the current smb value. 1-bit direct and indirect addressing can be used for specific locations in bank 15, regardless of the current emb value. i/o map for hardware registers table 4?1 contains detailed information about i/o mapping for peripheral hardware in bank 15 (register locations f80h?fffh). use the i/o map as a quick-reference source when writing application programs. the i/o map gives you the following information: ? register address ? register name (mnemonic for program addressing) ? bit values (both addressable and non-manipulable) ? read-only, write-only, or read and write addressability ? 1-bit, 4-bit, or 8-bit data manipulation characteristics
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 2 table 4?1. i/o map for memory bank 15 memory bank 15 addressing mode address register bit 3 bit 2 bit 1 bit 0 r/w 1-bit 4-bit 8-bit f80h sp .3 .2 .1 ? 0 ? r/w no no yes f81h .7 .6 .5 .4 locations f82h?f84h are not mapped. f85h bmod .3 .2 .1 .0 w .3 yes no f86h bcnt r no no yes f87h f88h wmod ? 0 ? .2 .1 ?0? (1) w no no yes f89h .7 ? 0 ? .5 .4 locations f8ah?f8fh are not mapped. f90h tmod0 .3 .2 ? 0 ? ? 0 ? w .3 no yes f91h ? 0 ? .6 .5 .4 f92h toe1 toe0 boe ? 0 ? r/w yes yes no f93h ? 0 ? tol1 tol0 ? 0 ? f94h tcnt0 r no no yes f95h f96h tref0 w no no yes f97h f9 8 h wdmod .3 .2 .1 .0 w no no yes f9 9 h .7 .6 .5 .4 f9 a h wdflag wdtcf ?0? ?0? ?0? w yes yes no locations f9bh?f9fh are not mapped. fa0h tmod1 .3 .2 ? 0 ? ? 0 ? w .3 no yes fa1h ? 0 ? .6 .5 .4 locations fa2h?fa3h are not mapped. fa4h tcnt1 r no no yes fa5h locations fa6h?fa7h are not mapped. fa8h tref1 w no no yes fa9h locations faah?fafh are not mapped. fb0h psw is1 is0 emb erb r/w yes yes yes fb1h c ( 2 ) sc2 sc1 sc0 r no no fb2h ipr ime .2 .1 .0 w ime yes no
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 3 table 4?1. i/o map for memory bank 15 (continued) fb3h pcon .3 .2 .1 .0 w .3, .2 yes no fb4h imod0 ?0? ? 0 ? .1 .0 w no yes no fb5h imod1 (3) ? 0 ? ? 0 ? ? 0 ? .0 fb6h imod2 ? 0 ? ? 0 ? .1 .0 locations fb7h is not mapped. fb8h ie4 (3) irq4 (3) ieb irqb r/w yes yes no locations fb9h is not mapped. fbah ? 0 ? ? 0 ? iew irqw r/w yes yes no fbbh ? 0 ? ? 0 ? iet1 irqt1 fbch ? 0 ? ? 0 ? iet0 irqt0 locations fbdh is not mapped. fbeh ie1 (3) irq1 (3) ie0 irq0 r/ w yes no no fbfh ? 0 ? ? 0 ? ie2 irq2 fc0h bsc0 r/ w yes no yes fc1h bsc1 fc2h bsc2 fc3h bsc3 locations fc4h?fcfh are not mapped. fd0h clmod .3 ? 0 ? .1 .0 w no yes no locations fd1h is not mapped. fd 2 h dtmr ?0? .2 .1 .0 w no no yes fd 3 h .7 .6 .5 .4 locations fd4h?fd9h are not mapped. fd a h pne1 pne4.3 pne4.2 pne4.1 pne4.0 w no no yes fdbh pne5.3 pne5.2 pne5.1 pne5.0 fdch pumod1 pur 1. 3 (4) pur 1. 2 (4) pur 1. 1 (4) pur 1. 0 w no no yes fddh pur5 pur 4 pur 3 pur 2 fdeh pumod2 pur 9 (4) p u r 8 (4) pur 7 pur 6 w no yes no locations fdfh?fe7h are not mapped. fe8h pmg1 pm2.3 pm2.2 pm2.1 pm2.0 w no no yes fe9h pm3.3 (4) pm3.2 (4) pm3.1 pm3.0 feah pmg2 pm 4 .3 pm 4 .2 pm 4 .1 pm 4 .0 febh pm 5 .3 pm 5 .2 pm 5 .1 pm 5 .0 fech pmg3 pm6.3 pm6.2 pm6.1 pm6.0 fedh pm 7 .3 pm 7 .2 pm 7 .1 pm 7 .0
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 4 table 4?1. i/o map for memory bank 15 (continued) feeh pmg4 (4) pm 8 .3 (4) pm 8 .2 (4) pm 8 .1 (4) pm 8 .0 (4) w no no yes fefh ?0? pm 9.2 (4) pm 9.1 (4) pm9 .0 (4) locations ff0h is not mapped. ff1h port 1 .3 .2 .1 .0 r yes yes no ff2h port 2 .3 .2 .1 .0 r/w yes yes yes ff3h port 3 .3 / .7 .2 / .6 .1 / .5 .0 / .4 ff4h port 4 .3 .2 .1 .0 r/w yes yes yes ff5h port 5 .3 / .7 .2 / .6 .1 / .5 .0 / .4 ff6h port 6 .3 .2 .1 .0 r/w yes yes yes ff7h port 7 .3 / .7 .2 / .6 .1 / .5 .0 / .4 ff8h port 8 .3 .2 .1 .0 r/w yes yes yes ff9h port 9 ?0? .2 / .6 .1 / .5 .0 / .4 note s 1. bit 0 in the wmod register must be set to logic ?0? 2. the carry flag can be read or written by specific bit manipulation instructions only. 3. s3c7534/c7538 does not use the int1 and int4 interrupts. 4. s3c7534/c7538 does not use the pmg4, p1.1?p1.3, p3.2?p3.3, p8, p9. register descriptions in this section, register descriptions are presented in a consistent format to familiarize you with the memory- mapped i/o locations in bank 15 of the ram. figure 4?1 describes features of the register description format. register descriptions are arranged in alphabetical order. programmers can use this section as a quick-reference source when writing application programs. counter registers, buffer registers, and reference registers, as well as the stack pointer and port i/o latches, are not included in these descriptions. more detailed information about how these registers are used is included in part ii of this manual, ?hardware descriptions,? in the context of the corresponding peripheral hardware module descriptions.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 5 clmod - - clock output mode control register fb2h bit identifier reset value read/write bit addressing clmod.3 w 4 0 3 .3 register id register name register location in ram bank 15 bit number in msb to lsb order bit identifier used for bit addressing bit value immediately following a reset type of addressing that must be used to address the bit (1-bit, 4-bit, or 8-bit) r = read-only w = write-only r/w = read/write register and bit ids used for bit addressing description of the effect of specific bit settin g s name of individual bit or related bits w 0 2 .2 4 w 0 1 .1 4 w 0 0 .0 4 clmod.2 clmod.1 - .0 associated hardware module cpu bit 2 0 always logic zero enable/disable clock output control bit 0 1 disable interrupt processing globally enable interrupt processing globally clock source and frequency selection control bits select cpu clock source select system clock fxx/8 (524 khz at 4.19 mhz) 0 0 1 1 0 1 0 1 select system clock fxx/64 (65.5 khz at 4.19 mhz) select system clock fxx/16 (262 khz at 4.19 mhz) figure 4?1. register description format
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 6 bmod ? basic timer mode register bt f85h bit 3 2 1 0 identifier .3 .2 .1 .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 1/4 4 4 4 bmod.3 basic timer restart bit 1 restart basic timer, then clear irqb flag, bcnt and bmod.3 to logic zero bmod.2 ? .0 input clock frequency and signal stabilization interval control bits 0 0 0 input clock frequency: signal stabilization interval: fx / 2 12 (1.02 khz) 2 20 / fx (250 ms) 0 1 1 input clock frequency: signal stabilization interval: fx / 2 9 (8.18 khz) 2 17 / fx (31.3 ms) 1 0 1 input clock frequency: signal stabilization interval: fx / 2 7 (32.7 khz) 2 15 / fx (7.82 ms) 1 1 1 input clock frequency: signal stabilization interval: fx / 2 5 (131 khz) 2 13 / fx (1.95 ms) notes 1. signa l stabilization interval is the time required to stabilize clock signal oscillation after stop mode is terminated by an interrupt. the stabilization interval can also be interpreted as ?interrupt interval time?. 2. when a reset occurs, the oscillation stabilization time is 31.3 ms (2 17 /fx) at 4.19 mhz. 3. ?fx? is the system clock rate, given a clock frequency of 4.19 mhz.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 7 clmod ? clock output mode register cpu fd0h bit 3 2 1 0 identifier .3 ?0? .1 .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 4 4 4 4 clmod.3 enable/disable clock output control bit 0 disable clock output 1 enable clock output clmod.2 bit 2 0 always logic zero clmod.1 ? .0 clock source and frequency selection control bits 0 0 select cpu clock source fx/4, fx/8 or fx/64 (1.05 mhz, 524 khz or 65.5 khz) 0 1 select system clock fx/8 (524 khz) 1 0 select system clock fx/16 (262 khz) 1 1 select system clock fx/64 (65.5khz) note : ?fx? is the system clock, given a clock frequency of 4.19 mhz.
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 8 dtmr ? dtmf mode register dtmf fd3h, fd2h bit 3 2 1 0 3 2 1 0 identifier .7 .6 .5 .4 ?0? .2 .1 .0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 dtmr.7 ? .4 dtmr bit values for keyboard inputs 0 0 0 0 function key d 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 0 1 0 1 1 * 1 1 0 0 # 1 1 0 1 function key a 1 1 1 0 function key b 1 1 1 1 function key c dtmr.3 bit 3 0 always logic zero dtmr.2 ? .1 tone selection bits 0 0 dual-tone enable 1 0 dual-tone enable (alternate setting) 0 1 single-column tone enable 1 1 single-low tone enable dtmr.0 dtmf operation enable/disable bit 0 disable dtmf operation 1 enable dtmf operation
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 9 imod0 ? external interrupt 0 (int0) mode register cpu fb4h bit 3 2 1 0 identifier ?0? ?0? .1 .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 4 4 4 4 imod0.3 ? .2 bits 3?2 0 always logic zero imod0.1 ? .0 external interrupt mode control bits 0 0 interrupt requests are triggered by a rising signal edge 0 1 interrupt requests are triggered by a falling signal edge 1 0 interrupt requests are triggered by both rising and falling signal edges 1 1 interrupt request flag (irqx) cannot be set to logic one
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 10 imod1 ? external interrupt 1 (int1) mode register ( note ) cpu fb5h bit 3 2 1 0 identifier ?0? ?0? ?0? .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 4 4 4 4 imod1.3 ? .1 bits 3?1 0 always logic zero imod1.0 external interrupt 1 edge detection control bit 0 rising edge detection 1 falling edge detection note: s3c7534/c7538 does not use the imod1.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 11 imod2 ? external interrupt 2 (int2) mode register cpu fb6h bit 3 2 1 0 identifier ?0? ?0? .1 .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 4 4 4 4 imod2.3 ? .2 bits 3?2 0 always logic zero imod2.1 ? .0 external interrupt 2 edge detection selection bit 0 0 interrupt request at int2 pin triggered by rising edge (s3c7524/7528 only) 0 1 interrupt request at ks4?ks7 triggered by falling edge 1 0 interrupt request at ks2?ks7 triggered by falling edge 1 1 interrupt request at ks0?ks7 triggered by falling edge
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 12 ie0, 1, irq0, 1 ? int0, 1 interrupt enable/request flags cpu fbeh bit 3 2 1 0 identifier ie1 (note) irq1 (note) ie0 irq0 reset reset value 0 0 0 0 read/write r/w r/w r/w r/w bit addressing 1/4 1/4 1/4 1/4 ie1 (note) int1 interrupt enable flag 0 disable interrupt requests at the int1 pin 1 enable interrupt requests at the int1 pin irq1 (note) int1 interrupt request flag ? generate int1 interrupt (this bit is set and cleared by hardware when rising or falling edge detected at int1 pin.) ie0 int0 interrupt enable flag 0 disable interrupt requests at the int0 pin 1 enable interrupt requests at the int0 pin irq0 int0 interrupt request flag ? generate int0 interrupt (this bit is set and cleared automatically by hardware when rising or falling edge detected at int0 pin.) note: s3c7534/c7538 does not use ie1, irq1, and int1 pin.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 13 ie2 , irq2 ? int2 interrupt enable/request flags cpu fbfh bit 3 2 1 0 identifier ?0? ?0? ie2 irq2 reset reset value 0 0 0 0 read/write r/w r/w r/w r/w bit addressing 1/4 1/4 1/4 1/4 .3 ? .2 bits 3?2 0 always logic zero ie2 int2 interrupt enable flag 0 disable int2 interrupt requests at the int2 pin (note) or ks0?ks7 pins 1 enable int2 interrupt requests at the int2 pin (note) or ks0?ks7 pins irq2 int2 interrupt request flag ? generate int2 quasi-interrupt (this bit is set and is not cleared automatically by hardware when a rising edge is detected at int2 pin (note) or when a falling edge is detected at one of the ks0?ks7 pins. since int2 is a quasi-interrupt, irq2 flag must be cleared by software.) note: s3c7534/c7538 does not use int2 pin.
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 14 ie4, irq4 ? int4 interrupt enable/request flags ( note ) cpu fb8h ieb, irqb ? intb interrupt enable/request flags cpu fb8h bit 3 2 1 0 identifier ie4 (note) irq4 (note) ieb irqb reset reset value 0 0 0 0 read/write r/w r/w r/w r/w bit addressing 1/4 1/4 1/4 1/4 ie4 (note) int4 interrupt enable flag 0 disable interrupt requests at the int4 pin 1 enable interrupt requests at the int4 pin irq4 (note) int4 interrupt request flag ? generate int4 interrupt (this bit is set and cleared automatically by hardware when rising and falling signal edge detected at int4 pin.) ieb intb interrupt enable flag 0 disable intb interrupt requests 1 enable intb interrupt requests irqb intb interrupt request flag ? generate intb interrupt (this bit is set and cleared automatically by hardware when reference interval signal received from basic timer.) note: s3c7534/c7538 does not use ie4, irq4, and int4 pin.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 15 iet0 , irqt0 ? intt0 interrupt enable/request flags cpu fbch bit 3 2 1 0 identifier ?0? ?0? iet0 irqt0 reset reset value 0 0 0 0 read/write r/w r/w r/w r/w bit addressing 1/4 1/4 1/4 1/4 .3 ? .2 bits 3?2 0 always logic zero iet0 intt0 interrupt enable flag 0 disable intt0 interrupt requests 1 enable intt0 interrupt requests irqt0 intt0 interrupt request flag ? generate intt0 interrupt (this bit is set and cleared automatically by hardware when contents of tcnt0 and tref0 registers match.)
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 16 iet1 , irqt1 ? intt1 interrupt enable/request flags cpu fbbh bit 3 2 1 0 identifier ?0? ?0? iet1 irqt1 reset reset value 0 0 0 0 read/write r/w r/w r/w r/w bit addressing 1/4 1/4 1/4 1/4 .2 ? .3 bits 2?3 0 always logic 0 iet1 intt1 interrupt enable flag 0 disable intt1 interrupt requests 1 enable intt1 interrupt requests irqt1 intt1 interrupt request flag ? generate intt1 interrupt (this bit is set and cleared automatically by hardware when contents of tcnt1 and tref1 registers match.)
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 17 iew , irqw ? intw interrupt enable/request flags cpu fbah bit 3 2 1 0 identifier ?0? ?0? iew irqw reset reset value 0 0 0 0 read/write r/w r/w r/w r/w bit addressing 1/4 1/4 1/4 1/4 .3 ? .2 bits 3?2 0 always logic zero iew intw interrupt enable flag 0 disable intw interrupt requests 1 enable intw interrupt requests irqw intw interrupt request flag ? generate intw interrupt (this bit is set when the timer interval is set to 0.5 seconds or 3.19 milliseconds at the watch timer frequency of 32.768 khz.) note : since intw is a quasi-interrupt, the irqw flag mu st be cleared by software.
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 18 ipr ? interrupt priority register cpu fb2h bit 3 2 1 0 identifier ime .2 .1 .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 1/4 4 4 4 ime interrupt master enable bit (msb) 0 disable all interrupt processing 1 enable processing of all interrupt service requests ipr.2 ? .0 interrupt priority assignment bits 0 0 0 normal interrupt processing according to default priority settings 0 0 1 process intb and int4 (note) interrupts at highest priority 0 1 0 process int0 interrupts at highest priority 0 1 1 process int1 (note) interrupts at highest priority 1 0 1 process intt0 interrupts at highest priority 1 1 0 process intt1 interrupts at highest priority notes 1. s3c7534/c7538 does not use the int1 and int4 interrupts. 2. during normal interrupt processing, interrupts are processed in the order in which they occur. if two or more interrupts occur simultaneously, the processing order is determined by the default interrupt priority settings shown below. using the ipr settings, you can select specific interrupts for high-priority processing in the event of contention. when the high-priority (ipr) interrupt has been processed, waiting interrupts are handled according to their default priorities. the default priorities are as follows (?1? is highest priority; ?5? is lowest priority): intb, int4 1 int0 2 int1 3 intt0 4 intt1 5
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 19 pcon ? power control register cpu fb3h bit 3 2 1 0 identifier .3 .2 .1 .0 reset reset value 0 0 0 0 read/write w w w w bit addressing 1/4 1/4 4 4 pcon.3 ? .2 cpu operating mode control bits 0 0 enable normal cpu operating mode 0 1 initiate idle power-down mode 1 0 initiate stop power-down mode pcon.1 ? .0 cpu clock frequency selection bits 0 0 select fx/64 1 0 select fx/8 1 1 select fx/4 note : ?fx? is the system clock.
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 20 psw ? program status word cpu fb1h, fb0h bit 7 6 5 4 3 2 1 0 identifier c sc2 sc1 sc0 is1 is0 emb erb reset reset value (1) 0 0 0 0 0 0 0 read/write r/w r r r r/w r/w r/w r/w bit addressing (2) 8 8 8 1/4 1/4 1 1 c carry flag 0 no overflow or borrow condition exists 1 an overflow or borrow condition does exist sc2 ? sc0 skip condition flags 0 no skip condition exists; no direct manipulation of these bits is allowed 1 a skip condition exists; no direct manipulation of these bits is allowed is1, is0 interrupt status flags 0 0 service all interrupt requests 0 1 service only the high-priority interrupt(s) as determined in the interrupt priority register (ipr) 1 0 do not service any more interrupt requests 1 1 undefined emb enable data memory bank flag 0 restrict program access to data memory to bank 15 (f80h?fffh) and to the locations 000h?07fh in the bank 0 only 1 enable full access to data memory banks 0, 1, and 15 erb enable register bank flag 0 select register bank 0 as working register area 1 select register banks 0, 1, 2 or 3 as working register area in accordance with the select register bank (srb) instruction operand notes 1. the value of the carry flag after a reset occurs during normal operation is undefined. if a reset occurs during power-down mode (idle or stop), the current value of the carry flag is retained. 2. the carry flag can only be addressed by a specific set of 1-bi t manipulation instructions. see section 2 for detailed information.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 21 pmg1 ? port i/o mode flags ( group 1: ports 2, 3) i/o fe9h, fe8h bit 7 6 5 4 3 2 1 0 identifier pm3.3 (note) pm3.2 (note) pm3.1 pm3.0 pm2.3 pm2.2 pm2.1 pm2.0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 pm3.3 (note) p3.3 i/o mode selection flag 0 set p3.3 to input mode 1 set p3.3 to output mode pm3.2 (note) p3.2 i/o mode selection flag 0 set p3.2 to input mode 1 set p3.2 to input mode pm3.1 p3.1 i/o mode selection flag 0 set p3.1 to input mode 1 set p3.1 to output mode pm3.0 p3.0 i/o mode selection flag 0 set p3.0 to input mode 1 set p3.0 to output mode pm2.3 p2.3 i/o mode selection flag 0 set p2.3 to input mode 1 set p2.3 to output mode pm2.2 p2.2 i/o mode selection flag 0 set p2.2 to input mode 1 set p2.2 to output mode pm2.1 p0.1 i/o mode selection flag 0 set p2.1 to input mode 1 set p2.1 to output mode pm2.0 p2.0 i/o mode selection flag 0 set p2.0 to input mode 1 set p2.0 to output mode note: s3c7534/c7538 does not use the pm3.2?pm3.3.
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 22 pmg2 ? port i/o mode flags (group 2: ports 4, 5) i/o febh, feah bit 7 6 5 4 3 2 1 0 identifier pm5.3 pm5.2 pm5.1 pm5.0 pm4.3 pm4.2 pm4.1 pm4.0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 pm5.3 p5.3 i/o mode selection flag 0 set p5.3 to input mode 1 set p5.3 to output mode pm5.2 p5.2 i/o mode selection flag 0 set p5.2 to input mode 1 set p5.2 to output mode pm5.1 p5.1 i/o mode selection flag 0 set p5.1 to input mode 1 set p5.1 to output mode pm5.0 p5.0 i/o mode selection flag 0 set p5.0 to input mode 1 set p5.0 to output mode pm4.3 p4.3 i/o mode selection flag 0 set p4.3 to input mode 1 set p4.3 to output mode pm4.2 p4.2 i/o mode selection flag 0 set p4.2 to input mode 1 set p4.2 to output mode pm4.1 p4.1 i/o mode selection flag 0 set p4.1 to input mode 1 set p4.1 to output mode pm4.0 p4.0 i/o mode selection flag 0 set p4.0 to input mode 1 set p4.0 to output mode
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 23 pmg3 ? port i/o mode flags (group 3: ports 6, 7) i/o fedh, fech bit 7 6 5 4 3 2 1 0 identifier pm7.3 pm7.2 pm7.1 pm7.0 pm6.3 pm6.2 pm6.1 pm6.0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 pm7.3 p7.3 i/o mode selection flag 0 set p7.3 to input mode 1 set p7.3 to output mode pm7.2 p7.2 i/o mode selection flag 0 set p7.2 to input mode 1 set p7.2 to output mode pm7.1 p7.1 i/o mode selection flag 0 set p7.1 to input mode 1 set p7.1 to output mode pm7.0 p7.0 i/o mode selection flag 0 set p7.0 to input mode 1 set p7.0 to output mode pm6.3 p6.3 i/o mode selection flag 0 set p6.3 to input mode 1 set p6.3 to output mode pm6.2 p6.2 i/o mode selection flag 0 set p6.2 to input mode 1 set p6.2 to output mode pm6.1 p6.1 i/o mode selection flag 0 set p6.1 to input mode 1 set p6.1 to output mode pm6.0 p6.0 i/o mode selection flag 0 set p6.0 to input mode 1 set p6.0 to output mode
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 24 pmg4 ? port i/o mode flags (group 3: ports 8, 9) (note) i/o fefh, feeh bit 7 6 5 4 3 2 1 0 identifier ?0? pm9.2 pm9.1 pm9.0 pm8.3 pm8.2 pm8.1 pm8.0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 .7 bit 7 0 always logic zero pm9.2 p9.2 i/o mode selection flag 0 set p9.2 to input mode 1 set p9.2 to output mode pm9.1 p9.1 i/o mode selection flag 0 set p9.1 to input mode 1 set p9.1 to output mode pm9.0 p9.0 i/o mode selection flag 0 set p 9.0 to input mode 1 set p 9.0 to output mode pm8.3 p8.3 i/o mode selection flag 0 set p8.3 to input mode 1 set p8.3 to output mode pm8.2 p8.2 i/o mode selection flag 0 set p8.2 to input mode 1 set p8.2 to output mode pm8.1 p8.1 i/o mode selection flag 0 set p8.1 to input mode 1 set p8.1 to output mode pm8.0 p8.0 i/o mode selection flag 0 set p8.0 to input mode 1 set p8.0 to output mode note: s3c7534/c7538 does not use the pmg4.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 25 pne 1 ? port open-drain enable register fdbh, fdah bit 7 6 5 4 3 2 1 0 identifier pne5.3 pne5.2 pne5.1 pne5.0 pne4.3 pne4.2 pne4.1 pne4.0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 pne5.3 p5.3 output mode control bit 0 push-pull output 1 n-channel open-drain output pne5.2 p5.2 output mode control bit 0 push-pull output 1 n-channel open-drain output pne5.1 p5.1 output mode control bit 0 push-pull output 1 n-channel open-drain output pne5.0 p5.0 output mode control bit 0 push-pull output 1 n-channel open-drain output pne4.3 p4.3 output mode control bit 0 push-pull output 1 n-channel open-drain output pne4.2 p4.2 output mode control bit 0 push-pull output 1 n-channel open-drain output pne4.1 p4.1 output mode control bit 0 push-pull output 1 n-channel open-drain output pne4.0 p4.0 output mode control bit 0 push-pull output 1 n-channel open-drain output
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 26 pumod1 ? pull-up resistor mode register 1 i/o fddh, fdch bit 7 6 5 4 3 2 1 0 identifier pur5 pur4 pur3 pur2 pur1.3 (note) pur1.2 (note) pur1.1 (note) pur1.0 reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 pur5 connect/disconnect port 5 pull-up resistor control bit 0 disconnect port 5 pull-up resistor 1 connect port 5 pull-up resistor pur4 connect/disconnect port 4 pull-up resistor control bit 0 disconnect port 4 pull-up resistor 1 connect port 4 pull-up resistor pur3 connect/disconnect port 3 pull-up resistor control bit 0 disconnect port 3 pull-up resistor 1 connect port 3 pull-up resistor pur2 connect/disconnect port 2 pull-up resistor control bit 0 disconnect port 2 pull-up resistor 1 connect port 2 pull-up resistor pur1.3 (note) connect/disconnect p1.3 pull-up resistor control bit 0 disconnect p1.3 pull-up resistor 1 connect p1.3 pull-up resistor pur1.2 (note) connect/disconnect p1.2 pull-up resistor control bit 0 disconnect p1.2 pull-up resistor 1 connect p1.2 pull-up resistor pur1.1 (note) connect/disconnect p1.1 pull-up resistor control bit 0 disconnect p1.1 pull-up resistor 1 connect p1.1 pull-up resistor pur1.0 connect/disconnect p1.0 pull-up resistor control bit 0 disconnect p1.0 pull-up resistor 1 connect p1.0 pull-up resistor note: s3c7534/c7538 does not use the pur1.1?pur1.3.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 27 pumod2 ? pull-up resistor mode register 2 i/o fdeh bit 3 2 1 0 identifier pur9 (note) pur8 (note) pur7 pur6 reset reset value 0 0 0 0 read/write w w w w bit addressing 4 4 4 4 pur9 (note) connect/disconnect port 9 pull-up resistor control bit 0 disconnect port 9 pull-up resistor 1 connect port 9 pull-up resistor pur8 (note) connect/disconnect port 8 pull-down resistor control bit 0 disconnect port 8 pull-down resistor 1 connect port 8 pull-down resistor pur7 connect/disconnect port 7 pull-up resistor control bit 0 disconnect port 7 pull-up resistor 1 connect port 7 pull-up resistor pur6 connect/disconnect port 6 pull-up resistor control bit 0 disconnect port 6 pull-up resistor 1 connect port 6 pull-up resistor note: s3c7534/c7538 does not use the pur8 and pur9.
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 28 tmod0 ? timer/counter 0 mode register t/c0 f91h, f90h bit 3 2 1 0 3 2 1 0 identifier ?0? .6 .5 .4 .3 .2 ?0? ?0? reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 1/8 8 8 8 tmod0.7 bit 7 0 always logic zero tmod0.6 ? .4 timer/counter 0 input clock selection bits 0 0 0 external clock input at tcl0 pin on rising edge 0 0 1 external clock input at tcl0 pin on falling edge 1 0 0 internal system clock fx/2 10 (4.09 khz) 1 0 1 select clock: fx/2 6 (65.5 khz) 1 1 0 select clock: fx/2 4 (262 khz) 1 1 1 select clock: fx (4.19 mhz) tmod0.3 clear counter and resume counting control bit 1 clears tcnt0 and irqt0. tol0 is remained and resume counting immediately (this bit is cleared automatically when counting starts.) tmod0.2 enable/disable timer/counter 0 bit 0 disable timer/counter 0; retain tcnt0 contents 1 enable timer/counter 0 tmod0.1 bit 1 0 always logic zero tmod0.0 bit 0 0 always logic zero
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 29 tmod1 ? timer/counter 1 mode register t/c1 fa1h, fa0h bit 3 2 1 0 3 2 1 0 identifier ?0? .6 .5 .4 .3 .2 ?0? ?0? reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 1/8 8 8 8 tmod1.7 bit 7 0 always logic zero tmod1.6 ? .4 timer/counter 0 input clock selection bits 0 0 0 external clock input at tcl1 pin on rising edge 0 0 1 external clock input at tcl1 pin on falling edge 1 0 0 internal system clock fx/2 12 (1.02 khz) 1 0 1 select clock: fx/2 10 (4.09 khz) 1 1 0 select clock: fx/2 8 (16.4 khz) 1 1 1 select clock: fx/2 6 (65.5 khz) tmod1.3 clear counter and resume counting control bit 1 clears tcnt1 and irqt1. tol1 is remained and resume counting immediately (this bit is cleared automatically when counting starts.) tmod1.2 enable/disable timer/counter 0 bit 0 disable timer/counter 1; retain tcnt1 contents 1 enable timer/counter 1 tmod1.1 bit 1 0 always logic zero tmod1.0 bit 0 0 always logic zero
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 30 toe ? timer output enable flag register t/c f92h bit 3 2 1 0 identifier toe1 toe0 boe ?0? reset reset value 0 0 0 0 read/write r/w r/w r/w w bit addressing 1/4 1/4 1/4 1/4 toe1 timer/counter 1 output enable flag 0 disable timer/counter 1 output to the tclo1 pin 1 enable timer/counter 1 output to the tclo1 pin toe0 timer/counter 0 output enable flag 0 disable timer/counter 0 output at the tclo0 pin 1 enable timer/counter 0 output at the tclo0 pin boe basic timer output enable flag 0 disable basic timer output at the btco pin 1 enable basic timer output at the btco pin .0 bit 0 0 always logic zero
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 31 wdmod ? watchdog timer mode register f99h, f98h bit 7 6 5 4 3 2 1 0 identifier .7 .6 .5 .4 .3 .2 .1 .0 reset reset value 1 0 1 0 0 1 0 1 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 wdmod watchdog timer enable/disable control 5ah disable watchdog timer function any other value enable watchdog timer function
memory map s3c7524/ c7528/p7528/c7534/c7538/p7538 4? 32 wdflag ? watchdog timer counter clear flag register f9ah bit 3 2 1 0 identifier wdtcf ?0? ?0? ?0? reset reset value 0 0 0 0 read/write w w w w bit addressing 1/4 1/4 1/4 1/4 wdtcf watchdog timer counter clear flag 1 clears the watchdog timer counter .2?.0 bits 2-0 0 always logic zero note: after watchdog timer is cleared by writing ?1?, this bit is cleared to ?0? automatically.
s3c7524/c7528/p7528/c7534/c7538/p7538 m emory map 4? 33 wmod ? watch timer mode register wt f89h, f88h bit 3 2 1 0 3 2 1 0 identifier .7 ?0? .5 .4 ?0? .2 .1 ?0? reset reset value 0 0 0 0 0 0 0 0 read/write w w w w w w w w bit addressing 8 8 8 8 8 8 8 8 wmod.7 enable/disable buzzer output bit 0 disable buzzer (buz) signal output 1 enable buzzer (buz) signal output wmod.6 bit 6 0 always logic zero wmod.5 ? .4 output buzzer frequency selection bits 0 0 fw/16 buzzer (buz) signal output (2 khz) 0 1 fw/8 buzzer (buz) signal output (4 khz) 1 0 fw/4 buzzer (buz) signal output (8 khz) 1 1 fw/2 buzzer (buz) signal output (16 khz) wmod.3 bit 3 0 always logic zero wmod.2 enable/disable watch timer bit 0 disable watch timer and clear frequency dividing circuits 1 enable watch timer wmod.1 watch timer speed control bit 0 normal speed; set irqw to 0.5 seconds 1 high-speed operation; set irqw to 3.91 ms wmod.0 bit 0 0 always logic zero note: system clock of 4.19 mhz is assumed.
s3c7524/c7528/p7528/c7534/c7538/p7538 oscillator circuits 6? 1 6 oscillator circuits overview the s3c7524/c7528/c7534/c7538 microcontrollers have one oscillator circuit, the system clock circuit, (fx). the cpu and peripheral hardware operates on the system clock frequency supplied through this circuit. specifically, a clock pulse is required by the following peripheral modules: ? basic timer ? timer/counters 0 ? watch timer ? clock output circuit clock control registers the power control register, pcon, is used to select normal cpu operating mode or one of two power-down modes ? stop or idle. bits 3 and 2 of the pcon register can be manipulated by a stop or idle instruction to engage stop or idle power-down mode. the system clock frequencies can be divided by 4, 8, or 64. by manipulating pcon bits 1 and 0, you select one of the following frequencies as the selected system clock. fx 4 , fx 8 , fx 64
oscillator circuits s3c7524/c7528/p7528/c7534/c7538/p7538 6? 2 oscillator stop 1/4 cpu clock oscillator control circuit wait release signal pcon.3, .2 clear main system oscillator circuit x in x out 1 - 1/4096 frequency dividing circuit 1/2 1/16 selector pcon.0 fx cpu stop signal ( idle mode) idle stop watch timer basic timer timer/counter 0, 1 clock output circuit pcon.1 pcon.2 pcon.3 power-down release signal internal reset reset signal dtmf generator figure 6?1. clock circuit diagram
s3c7524/c7528/p7528/c7534/c7538/p7538 oscillator circuits 6? 3 system oscillator circuits xin xout figure 6?2. crystal/ceramic oscillator xin xout figure 6?3. external oscillator
oscillator circuits s3c7524/c7528/p7528/c7534/c7538/p7538 6? 4 power control register (pcon) the power control register, pcon, is a 4-bit register that is used to select the cpu clock frequency and to control cpu operating and power-down modes. pcon can be addressed directly by 4-bit write instructions or indirectly by the instructions idle and stop. fb3h pcon.3 pcon.2 pcon.1 pcon.0 pcon bits 3 and 2 are addressed by the stop and idle instructions, respectively, to engage the idle and stop power-down modes. idle and stop modes can be initiated by these instruction despite the current value of the enable memory bank flag (emb). by manipulating bits 1 and 0 of the pcon register, the system clock frequency can be divided by 4, 8, or 64. reset sets pcon register values to logic zero: pcon.1 and pcon.0 divide the fx frequency by 64, and pcon.3 and pcon.2 enable normal cpu operating mode. table 6?1. power control register (pcon) organization pcon bit settings resulting cpu operating mode pcon.3 pcon.2 0 0 normal cpu operating mode 0 1 idle power-down mode 1 0 stop power-down mode pcon bit settings resulting cpu clock frequency pcon.1 pcon.0 0 0 fx/64 1 0 fx/8 1 1 fx/4 + + programmingng tip ? setting the cpu clock to set the cpu clock to 1.05 mhz at 4.19 mhz: bits emb smb 15 ld a,#3h ld pcon,a
s3c7524/c7528/p7528/c7534/c7538/p7538 oscillator circuits 6? 5 instruction cycle times the unit of time that equals one machine cycle varies depending on how the oscillator clock signal is divided (by 4, 8, or 64) by the system clock. table 6?2 shows corresponding cycle times in microseconds. selected cpu clock resulting frequency oscillation source cycle time (sec) fx/64 65.5 khz fx = 4.19 mhz 15.3 fx/8 524.0 khz 1.91 fx/4 1.05 mhz 0.95 table 6?2. instruction cycle times for cpu clock rates clock output mode register (clmod) the clock output mode register, clmod, is a 4-bit register that is used to enable or disable clock output to the clo pin and to select the cpu clock source and frequency. clmod is addressable by 4-bit write instruction only. fd0h clmod.3 ?0? clmod.1 clmod.0 reset clears clmod to logic zero, which automatically selects the cpu clock as the clock source (without initiating clock oscillation), and disable clock output. clomd.3 is the enable/disable clock output control bit; clomd.1 and clomd.0 are used to select one of four possible clock sources and frequencies: normal cpu clock, fx/8, fx/16, or fx/64. table 6?3. clock output mode register (clmod) organization clmod bit setting resulting clock output clmod.1 clmod.0 clock source frequency 0 0 cpu clock (fx/4, fx/8, fx/64) 1.05 mhz,524 khz, 65.5 khz 0 1 fx/8 524 khz 1 0 fx/16 262 khz 1 1 fx/64 65.5 khz clmod.3 result of clmod.3 setting 0 clock output is disable 1 clock output is enable note: frequencies assume that fx = 4.19 mhz.
oscillator circuits s3c7524/c7528/p7528/c7534/c7538/p7538 6? 6 clock output circuit the clock output circuit, used to output clock pulses to the clo pin, has the following components: ? 4-bit clock output mode register (clmod) ? clock selector ? output latch ? port mode flag ? clo output pin (p2.2) pm2 p2.2 output latch clo clmod.3 clmod.2 clmod.1 clmod.0 clock selector clocks (fx/8, fx/16, fx/64, cpu clock) 4 figure 6?4. clo output pin circuit diagram clock output procedure the procedure for outputting clock pulses to the clo pin may be summarized as follows: 1. disable clock output by clearing clmod.3 to logic zero. 2. set the clock output frequency (clmod.1, clmod.0). 3. load a ?0? to the output latch of the clo pin (p2.2). 4. set the p2.2 mode flag (pm 2) to output mode. 5. enable clock output by setting clmod.3 to logic one. + + programming tip ? cpu clock output to the clo pin to output the cpu clock to the clo pin bits emb smb 15 ld ea,#04h ld pmg1,ea ; p 2.2 ? output mode bitr p2.2 ; clear p2.2 output latch ld a,#8h ld clmod,a
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 1 7 interrupts overview the s3c7524/c7528/c7534/c7538 interrupt control circuit has five functional components: ? interrupt enable flags (iex) ? interrupt request flags (irqx) ? interrupt mask enable register (im e) ? interrupt priority register (ipr) ? power-down release signal circuit three kinds of interrupts are supported: ? internal interrupts generated by on-chip processes ? external interrupts generated by external peripheral devices ? quasi-interrupts used for edge detection and as clock sources table 7?1. interrupt types and corresponding port pin(s) interrupt type interrupt name corresponding port pin external interrupts int0, int1 (note) , int4 (note) p1.0, p1.1 (note) , p1.3 (note) internal interrupts intb, intt0, intt1 not applicable quasi-interrupts int2 p1.2 (note) , ks0?ks7 intw not applicable note : s3c7534/c7538 does not use the interrupts of int1, int4, and int2 pin.
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 2 vectored interrupts interrupt requests may be processed as vectored interrupts in hardware, or they can be generated by program software. a vectored interrupt is generated when the following flags and register settings, corresponding to the specific interrupt (intn) are set to logic one: ? interrupt enable flag (iex) ? interrupt master enable flag (ime) ? interrupt request flag (irqx) ? interrupt status flags (is0, is1) ? interrupt priority register (ipr) if all conditions are satisfied for the execution of a requested service routine, the start address of the interrupt is loaded into the program counter and the program starts executing the service routine from this address. emb and erb flags for ram memory banks and registers are stored in the vector address area of the rom during interrupt service routines. the flags are stored at the beginning of the program with the vent instruction. the initial flag values determine the vectors for resets and interrupts. enable flag values are saved during the main routine, as well as during service routines. any changes that are made to enable flag values during a service routine are not stored in the vector address. when an interrupt occurs, the enable flag values before the interrupt is initiated are saved along with the program status word (psw), and the enable flag values for the interrupt is fetched from the respective vector address. then, if necessary, you can modify the enable flags during the interrupt service routine. when the interrupt service routine is returned to the main routine by the iret instruction, the original values saved in the stack are restored and the main program continues program execution with these values. software-generated interrupts to generate an interrupt request from software, the program manipulates the appropriate irqx flag. when the interrupt request flag value is set, it is retained until all other conditions for the vectored interrupt have been met, and the service routine can be initiated. multiple interrupts by manipulating the two interrupt status flags (is0 and is1), you can control service routine initialization and thereby process multiple interrupts simultaneously. if more than four interrupts are being processed at one time, you can avoid possible loss of working register data by using the push rr instruction to save register contents to the stack before the service routines are executed in the same register bank. when the routines have executed successfully, you can restore the register contents from the stack to working memory using the pop instruction. power-down mode release an interrupt can be used to release power-down mode (stop or idle). interrupts for power-down mode release are initiated by setting the corresponding interrupt enable flag. even if the ime flag is cleared to zero, power-down mode will be released by an interrupt request signal when the interrupt enable flag has been set. in such cases, the interrupt routine will not be executed since ime = "0".
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 3 request flag (irqx) <-- 1 iex = 1? interrupt is generated (int xx) retain value until iex = 1 generate corresponding vector interrupt and release power-down mode retain value until ime = 1 high-priority interrupt? ime = 1? is1,0 = 0,0? is1,0 = 0,1 ? are both interrupt sources of shared vector address used? store contents of pc and psw in the stack area; set pc contents to corresponding vector address is1,0 = 0,1 reset corresponding irqx flag irqx flag value remains 1 jump to interrupt start address verify interrupt source and clear irqx with a btstz instruction retain value until interrupt service routine is completed jump to interrupt start address is1,0 = 1,0 no no no no yes yes yes yes yes yes no no figure 7-1. interrupt execution flowchart
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 4 @ irqb irq4 irq0 irq1 irqt0 irqt1 irqw irq2 imod1 imod0 intb int4 int0 int1 intt0 intt1 intw power-down mode release signal ime ipr is1 is0 interrupt control unit vector interrupt generator @ = edge detection circuit selector imod2 int2 ks0?ks7 iew iet0 ie1 ie0 ie4 ieb ie2 @ iet1 figure 7-2. interrupt control circuit diagram (s3c7524/c7528)
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 5 irqb irq0 irqt0 irqt1 irqw irq2 intb intt0 intt1 intw power-down mode release ime ipr is1 is0 interrupt control vector interrupt imod0 int0 @ = edge detection circuit selector imod2 ks0?ks7 iew iet0 ie0 ieb ie2 iet1 @ figure 7-3. interrupt control circuit diagram (s3c7534/c7538)
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 6 multiple interrupts the interrupt controller can service multiple interrupts in two ways: as two-level interrupts, where either all interrupt requests or only those of highest priority are serviced, or as multi-level interrupts, when the interrupt service routine for a lower-priority request is accepted during the execution of a higher priority routine. two-level interrupt handling two-level interrupt handling is the standard method for processing multiple interrupts. when the is1 and is0 bits of the psw (fb0h.3 and fb0h.2, respectively) are both logic zero, program execution mode is normal and all interrupt requests are serviced (see figure 7?3). whenever an interrupt request is accepted, is1 and is0 are incremented by one ("0" ? "1" or "1" ? "0"), and the values are stored in the stack along with the other psw bits. after the interrupt routine has been serviced, the modified is1 and is0 values are automatically restored from the stack by an iret instruction. is0 and is1 can be manipulated directly by 1-bit write instructions, regardless of the current value of the enable memory bank flag (emb). before you can modify an interrupt status flag, however, you must first disable interrupt processing with a di instruction. when is1 = "0" and is0 = "1", all interrupt service routines are inhibited except for the highest priority interrupt currently defined by the interrupt priority register (ipr). int disable set ipr int enable low or high level interrupt generated normal program processing (status 0) high-level interrupt generated high or low level interrupt processing (status 1) high level interrupt processing (status 2) figure 7-4. two-level interrupt handling
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 7 multi-level interrupt handling with multi-level interrupt handling, a lower-priority interrupt request can be executed while a high-priority interrupt is being serviced. this is done by manipulating the interrupt status flags, is0 and is1 (see table 7?2). when an interrupt is requested during normal program execution, interrupt status flags is0 and is1 are set to "1" and "0", respectively. this setting allows only highest-priority interrupts to be serviced. when a high-priority request is accepted, both interrupt status flags are then cleared to "0" by software so that a request of any priority level can be serviced. in this way, the high- and low-priority requests can be serviced in parallel (see figure 7?4). table 7-2. is1 and is0 bit manipulation for multi-level interrupt handling process status before int effect of isx bit setting after int ack is1 is0 is1 is0 0 0 0 all interrupt requests are serviced. 0 1 1 0 1 only high-priority interrupts as determined by the current settings in the ipr register are serviced. 1 0 2 1 0 no additional interrupt requests will be serviced. ? ? ? 1 1 value undefined ? ? int disable set ipr int enable low or high level interrupt generated normal program processing (status 0) low or high level interrupt generated single interrupt 2-level interrupt status 1 status 1 status 0 status 0 int enable modify status int disable high-level interrupt generated status 2 3-level interrupt figure 7-5. multi-level interrupt handling
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 8 interrupt priority register (ipr) the 4-bit interrupt priority register (ipr) is used to control multi-level interrupt handling. its reset value is logic zero. before the ipr can be modified by 4-bit write instructions, all interrupts must first be disabled by a di instruction. fb2h ime ipr.2 ipr.1 ipr.0 by manipulating the ipr settings, you can choose to process all interrupt requests with the same priority level, or you can select one type of interrupt for high-priority processing. a low-priority interrupt can itself be interrupted by a high-priority interrupt, but not by another low-priority interrupt. a high-priority interrupt cannot be interrupted by any other interrupt source. table 7-3. standard interrupt priorities interrupt default priority intb, int4 (note) 1 int0 2 int1 (note) 3 intt0 4 intt1 5 the msb of the ipr, the interrupt master enable flag (ime), enables and disables all interrupt processing. even if an interrupt request flag and its corresponding enable flag are set, a service routine cannot be executed until the ime flag is set to logic one. the ime flag can be directly manipulated by ei and di instructions, regardless of the current enable memory bank (emb) value. table 7-4. interrupt priority register settings ipr.2 ipr.1 ipr.0 result of ipr bit setting 0 0 0 normal interrupt handling according to default priority settings 0 0 1 process intb and int4 (note) interrupts at highest priority 0 1 0 process int0 interrupts at highest priority 0 1 1 process int1 (note) interrupts at highest priority 1 0 1 process intt0 interrupts at highest priority 1 1 0 process intt1 interrupts at highest priority notes 1. during normal interrupt processing, interrupts are processed in the order in which they occur. if two or more interrupts occur simultaneously, the processing order is determined by the default interrupt priority settings shown in table 7-3. using the ipr settings, you can select specific interrupts for high-priority processing in the event of contention. when the high-p riority (ipr) interrupt has been processed, waiting interrupts are handled according to their default priorities. 2. s3c7534/c7538 does not use the int1 and int4 interrupts.
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 9 + + programming tip ? setting the int interrupt priority the following instruction sequence sets the int1 interrupt to high priority: bits emb smb 15 di ; ipr.3 (ime) ? 0 ld a,#3h ld ipr,a ei ; ipr.3 (ime) ? 1 external interrupt 0 and 1 mode registers (imod0, imod1) the following components are used to process external interrupts at the int0 and int1 (note) pin: ? edge detection circuit ? two mode registers, imod0 and imod1 (note) the mode registers are used to control the triggering edge of the input signal. imod0 and imod1 (note) settings let you choose either the rising or falling edge of the incoming signal as the interrupt request trigger. the int4 (note) interrupt is an exception since its input signal generates an interrupt request on both rising and falling edges. fb4h ?0? "0" imod0.1 imod0.0 fb5h "0" "0" "0" imod1.0 (note) imod0 and imod1 (note) bits are addressable by 4-bit write instructions. reset clears all imod values to logic zero, selecting rising edges as the trigger for incoming interrupt requests. table 7-5. imod0 and imod1 register organization imod0 0 0 imod0.1 imod0.0 effect of imod0 settings 0 0 rising edge detection 0 1 falling edge detection 1 0 both rising and falling edge detection 1 1 irq0 flag cannot be set to "1" imod1 (note) 0 0 0 imod1.0 effect of imod1 settings 0 rising edge detection 1 falling edge detection note : s3c7534/c7538 does not use the int1 and int4 interrupts.
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 10 external interrupt 0 and 1 mode registers (continued) when a sampling clock rate of fx/64 is used for int0, an interrupt request flag must be cleared before 16 machine cycles have elapsed. int0 int1 (note) edge detection irq0 p1.1 p1.0 edge detection irq1 (note) imod0 imod1 (note) (note) figure 7-6. circuit diagram for int0 and int1 pins when modifying the imod0 and imod1 registers, it is possible to accidentally set an interrupt request flag. to avoid unwanted interrupts, take these precautions when writing your programs: 1. disable all interrupts with a di instruction. 2. modify the imod0 or imod1 register. 3. clear all relevant interrupt request flags. 4. enable the interrupt by setting the appropriate iex flag. 5. e nable all interrupts with an ei instructions. note : s3c7534/c7538 does not use the int1 and p1.1.
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 11 external interrupt 2 mode register (imod2) the mode register for external interrupts at the ks0?kks7 pins, imod2, is addressable only by 4-bit write instructions. reset clears all imod2 bits to logic zero. fb6h "0" "0" imod2.1 imod2.0 when imod2 is cleared to logic zero, int2 uses the rising edge of an incoming signal as the interrupt request trigger. if a rising edge is detected at the int2 pin, or when a falling edge is detected at any one of the pins ks0? ks7, the irq2 flag is set to logic one and a release signal for power-down mode is generated. table 7-6. imod2 register bit settings imod2 0 0 imod2.1 imod2.0 effect of imod2 settings 0 0 select rising edge at int2 pin (note) 0 1 select falling edge at ks4?ks7 1 0 select falling edge at ks2?ks7 1 1 select falling edge at ks0?ks7 note : s3c7534/c7538 does not use the int2 pin.
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 12 int2 (note) p7.3/ ks7 p7.2 ks6 p7.1/ ks5 p7.0/ ks4 p6.3/ ks3 p6.2/ ks2 p6.1/ ks1 p6.0/ ks0 irq2 falling edge detection circuit clock selector rising edge detection imod2 notes 1. to generate a key interrupt on a falling edge at ks0-ks7, all ks0-ks7 pins must be configured to the input mode. particularly, the ks4-ks7 must always be configured to the input mode. 2. s3c7534/c7538 does not use the int2 pin. figure 7-7. circuit diagram for int2 and ks0?ks7 pins
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 13 + + programming tip ? using int2 as a key input interrupt when the int2 interrupt is used as a key interrupt, the selected key interrupt source pin must be set to input: 1. when ks0?ks7 are selected (eight pins): bits emb smb 15 ld a, #3h ld imod2, a ; (imod2) ? #3h, ks0?ks7 falling edge select ld ea, #00h ld pmg3, ea ; p6, 7 ? input mode ld a, #3h ld pumod2, a ; enable p6 and p7 pull-up resistors 2. when ks2?ks7 are selected (six pins): bits emb smb 15 ld a, #2h ld imod2, a ; (imod2) ? #2h, ks2?ks7 falling edge select ld ea, #03h ld pmg3, ea ; p7, p6.2?p6.3 ? input mode ld a, #3h ld pumod2, a ; enable p6 and p7 pull-up resistors 3. when ks4?ks7 are selected (four pins), p7 must be specified as a key strobe signal input: bits emb smb 15 ld a, #1h ld imod2, a ; (imod2) ? #1h, ks4?ks7 falling edge select ld ea, #0fh ld pmg3, ea ld a, #2 ld pumod2, a ; enable p7 pull-up resistor
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 14 interrupt flags there are three types of interrupt flags: interrupt request and interrupt enable flags that correspond to each interrupt, the interrupt master enable flag, which enables or disables all interrupt processing. interrupt master enable flag (ime) the interrupt master enable flag, ime, enables or disables all interrupt processing. therefore, even when an irqx flag is set and its corresponding iex flag is enabled, the interrupt service routine is not executed until the ime flag is set to logic one. the ime flag is located in the ipr register (ipr.3). it can be directly manipulated by ei and di instructions, regardless of the current value of the enable memory bank flag (emb). ime ipr.2 ipr.1 ipr.0 effect of bit settings 0 inhibit all interrupts 1 enable all interrupts interrupt enable flags (iex) iex flags, when set to logical one, enable specific interrupt requests to be serviced. when the interrupt request flag is set to logic one, an interrupt will not be serviced until its corresponding iex flag is also enabled. interrupt enable flags can be read, written, or tested directly by 1-bit instructions (bits and bitr) or 4-bit instructions. iex flags can be addressed directly at their specific ram addresses, despite the current value of the enable memory bank (emb) flag. table 7-7. interrupt enable and interrupt request flag addresses address bit 3 bit 2 bit 1 bit 0 fb8h ie4 (5) irq4 (5) ieb irqb fbah 0 0 iew irqw fbbh 0 0 iet1 irqt1 fbch 0 0 iet0 irqt0 fbeh ie1 (5) irq1 (5) ie0 irq0 fbfh 0 0 ie2 irq2 notes 1. iex refers generically to all interrupt enable flags. 2. irqx refers generically to all interrupt request flags. 3. iex = 0 is interrupt disable mode. 4. iex = 1 is interrupt enable mode. 5. s3c7534/c7538 does not use the ie1, ie4, irq1, and irq4 interrupts.
s3c7524/c7528/p7528/c7534/c7538/p7538 in terrups 7? 15 interrupt request flags (irqx) interrupt request flags, are read/write addressable by 1-bit or 4-bit instructions. irqx flags can be addressed directly at their specific ram addresses, regardless of the current value of the enable memory bank (emb) flag. when a specific irqx flag is set to logic one, the corresponding interrupt request is generated. the flag is then automatically cleared to logic zero when the interrupt has been serviced. exceptions are the watch timer interrupt request flags, irqw, and the external interrupt 2 flag irq2, which must be cleared by software after the interrupt service routine has executed. irqx flags are also used to execute interrupt requests from software. in summary, follow these guidelines for using irqx flags: 1. irqx is set to request an interrupt when an interrupt meets the set condition for interrupt generation. 2. irqx is set to "1" by hardware and then cleared by hardware when the interrupt has been serviced (with the exception of irqw and irq2). 3. if irqx is set to "1" by software, an int errupt is also generated. when two interrupts share the same service routine start address, interrupt processing may occur in one of two ways: ? when only one interrupt is enabled, the irqx flag is cleared automatically when the interrupt has been serviced. ? when two interrupts are enabled, the request flag is not automatically cleared so that the user has an opportunity to locate the source of the interrupt request. in this case, the irqx setting must be cleared manually using a btstz instruction. table 7-8. interrupt request flag conditions and priorities interrupt source internal / external pre-condition for irqx flag setting interrupt priority irq flag name intb i reference time interval signal from basic timer 1 irqb int4 (2) e both rising and falling edges detected at int4 1 irq4 int0 e rising or falling edge detected at int0 pin 2 irq0 int1 (2) e rising or falling edge detected at int1 pin 3 irq1 intt0 i signals for tcnt0 and tref0 registers match 5 irqt0 intt1 i signals for tcnt1 and tref1 registers match 6 irqt1 int2 (2) e rising edge detected at int2 pin or else a falling edge is detected at any of the ks0?ks7 pins ? irq2 intw i time interval of 0.5 secs or 3.19 msecs ? irqw notes 1. the quasi-interrupt int2 is only used for testing incoming signals. 2. s3c7534/c7538 does not use the int2 pin, int1, and int4 interrupts.
interrupts s3c7524/c 7528/p7528/c7534/c7538/p7538 7? 16 + + programming tip ? enabling the intb and int4 interrupts to simultaneously enable intb and int4 interrupts: intb di btstz irqb ; irqb = 1 ? jr int4 ; if no, int4 interrupt; if yes, intb interrupt is processed ? ? ? ei iret int4 bitr irq4 ; int4 is processed ? ? ? ei iret
s3c7524/c7528/p7528/c7534/c7538/p7538 po wer-down 8? 1 8 power-down overview the s3c7524/c7528/c7534/c7538 microcontroller has two power-down modes to reduce power consumption: idle and stop. idle mode is initiated by the idle instruction and stop mode by the instruction stop. (several nop instructions must always follow an idle or stop instruction in a program.) in idle mode, the cpu clock stops while peripherals and the oscillation source continue to operate normally. when reset occurs during normal operation or during a power-down mode, a reset operation is initiated and the cpu enters idle mode. when the standard oscillation stabilization time interval (31.3 ms at 4.19 mhz) has elapsed, normal cpu operation resumes. in stop mode, system clock oscillation is halted (assuming it is currently operating), and peripheral hardware components are powered-down. the effect of stop mode on specific peripheral hardware components ? cpu, basic timer, timer/counters, and watch-timer ? and on external interrupt requests, is detailed in table 8?1. note do not use stop mode if you are using an external clock source because x in input must be restricted internally to v ss to reduce current leakage. idle or stop modes are terminated either by a reset , or by an interrupt with the exception of int0, which are enabled by the corresponding interrupt enable flag, iex. when power-down mode is terminated by reset input, a normal reset operation is executed. assuming that both the interrupt enable flag and the interrupt request flag are set to "1", power-down mode is released immediately upon entering power-down mode. when an interrupt is used to release power-down mode, the operation differs depending on the value of the interrupt master enable flag (ime): ? if the ime flag = "0", program ex ecution is started immediately after the instruction which issues the request to enter power-down mode. the interrupt request flag remains set to logic one. ? if the ime flag = "1", two instructions are executed after the power-down mode release. then, the vectored interrupt is initiated. however, when the release signal is caused by int2 or intw, the operation is identical to the ime = 0 condition. that is, a vector interrupt is not generated.
power-down s3c7524/c 7528/p7528/c7534/c7538/p7538 8? 2 table 8?1. hardware operation during power-down modes operation stop mode (stop) idle mode (idle) clock oscillator system clock oscillation stops cpu clock oscillation stops (system clock oscillation continues) basic timer basic timer stops basic timer operates (with irqb set at each reference interval) timer/counter 0 operates only if tcl0 is selected as the counter clock timer/counter 0 operates timer/counter 1 operates only if tcl1 is selected as the counter clock timer/counter 1 operates watch timer watch timer operation is stopped watch timer operates external interrupts int0, int1, int2, and int4 are acknowledged int0, int1, int2, and int4 are acknowledged cpu all cpu operations are disabled all cpu operations are disabled power-down mode release signal interrupt request signals are enabled by an interrupt enable flag or by reset input interrupt request signals are enabled by an interrupt enable flag or by reset input note: s3c7534/c7538 does not use the int1, int2, and int4 interrupts. idle mode timing diagrams clock signal idle instruction oscillation stabilization (36.6 ms / 3.58 mhz) normal mode idle mode normal mode normal oscillation reset figure 8?1. timing when idle mode is released by reset reset
s3c7524/c7528/p7528/c7534/c7538/p7538 po wer-down 8? 3 normal mode idle mode normal mode normal oscillation mode release signal idle instruction clock signal interrupt acknowledge (ime = 1) figure 8?2. timing when idle mode is released by an interrupt stop mode timing diagrams clock signal stop instruction oscillation stabilization (36.6 ms / 3.58 mhz) normal mode idle mode normal mode oscillation resumes stop mode oscillation stops reset figure 8?3. timing when stop mode is released by reset reset mode release signal oscillation stabilization (bmod setting) normal mode idle mode normal mode oscillation resumes stop mode oscillation stops stop instruction clock signal int ack (ime = 1) figure 8?4. timing when stop mode is release by an interrupt
power-down s3c7524/c 7528/p7528/c7534/c7538/p7538 8? 4 port pin configuration for power-down the following method describes how to configure i/o port pins to reduce power consumption during power-down modes (stop, idle): condition 1: if the microcontroller is not configured to an external device: 1. connect unused port pins according to the information in table 8?2. 2. disable all pull-up resistors for output pins by making the appropriate modifications to the pull-up resistor mode register, pumod. reason: if output goes low when the pull-up resistor is enabled, there may be unexpected surges of current through the pull-up. 3. disable pull-up resistors for input pins configured to v dd or v ss levels in order to check the current input option. reason: if the input level of a port pin is set to v ss when a pull-up resistor is enabled, it will draw an unnecessarily large current. condition 2: if the microcontroller is configured to an external device and the external device's v dd source is turned off in power-down mode. 1. connect unused port pins according to the information in table 8?2. 2. disable the pull-up resistors of output pins by making the appropriate modifications to the pull-up resistor mode register, pumod. reason: if output goes low when the pull-up resistor is enabled, there may be unexpected surges of current through the pull-up. 3. disable pull-up resistors f or input pins configured to v dd or v ss levels in order to check the current input option. reason: if the input level of a port pin is set to v ss when a pull-up resistor is enabled, it will draw an unnecessarily large current. 4. disable the pull-up resistors of input pins connected to the external device by making the necessary modifications to the pumod register. 5. configure the output pins that are connected to the external device to low level. reason: when the external device's v dd source is turned off, and if the microcontroller's output pins are set to high level, v dd ? 0.7 v is supplied to the v dd of the external device through its input pin. this causes the device to operate at the level v dd ? 0.7 v. in this case, total current consumption would not be reduced. 6. determine the correct output pin state necessary to block current pass in according with the external transistors (pnp, npn).
s3c7524/c7528/p7528/c7534/c7538/p7538 po wer-down 8? 5 recommended connections for unused pins to reduce overall power consumption, please configure unused pins according to the guidelines described in table 8?2. table 8?2. unused pin connections for reduced power consumption pin/share pin names recommended connection p1.0 / int0 ?p 1.2 / int2 connect to v dd p1.3 / int4 p2.0 / tclo0 p2.1 / tclo1 p2.2 / clo p2.3 / buz p3.0 / tcl0 p3.1 / tcl1 p3.2 p3.3 p4.0 / btco p4.1?p4.3 p5.0?p5.3 p6.0 / ks0?p6.3 / ks3 p7.0 / ks4?p7.3 / ks7 p8.0?p8.3 p9.0?p9.2 input mode: connect to v dd output mode: no connection dtmf no connection nc connect to v ss note : p1.1, p1.2, p1.3, p3.2, p3.3, p8, p9, int1, int2, and int4 are not used in the s3c7534/c7538.
s3c7524/c7528/p7528/c7534/c7538/p7538 reset reset 9? 1 9 reset reset overview when a reset signal is input during normal operation or power-down mode, a hardware reset operation is initiated and the cpu enters idle mode. then, when the standard oscillation stabilization interval of 36.6 ms at 3.58 mhz has elapsed, normal system operation resumes. regardless of when the reset occurs ? during normal operating mode or during a power-down mode ? most hardware register values are set to the reset values described in table 9?1 below. the current status of several register values is, however, always retained when a reset occurs during idle or stop mode; if a reset occurs during normal operating mode, their values are undefined. current values that are retained in this case are as follows: ? carry flag ? general-purpose registers e, a, l, h, x, w, z, and y oscillation stabilization (36.6 ms / 3.58 mhz) idle mode operating mode reset input normal mode or power-down mode reset operation figure 9-1. timing for oscillation stabilization after reset reset hardware reset values after reset reset table 9?1 gives you detailed information about hardware register values after a reset occurs during power- down mode or during normal operation.
reset reset s3c7524/c7528/p7528 /c7534/c7538/p7538 9? 2 table 9-1. hardware register values after reset reset hardware component or subcomponent if reset reset occurs during power-down mode if reset reset occurs during normal operation program counter (pc) lower five bits of address 0000h are transferred to pc12?8, and the contents of 0001h to pc7?0. lower five bits of address 0000h are transferred to pc12?8, and the contents of 0001h to pc7?0. program status word (psw): carry flag (c) values retained undefined skip flag (sc0?sc2) 0 0 interrupt status flags (is0, is1) 0 0 bank enable flags (emb, erb) bit 6 of address 0000h in program memory is transferred to the erb flag, and bit 7 of the address to the emb flag. bit 6 of address 0000h in program memory is transferred to the erb flag, and bit 7 of the address to the emb flag. stack pointer (sp) undefined undefined data memory (ram): general registers e, a, l, h, x, w, z, y values retained undefined general-purpose registers values retained (1) undefined bank selection registers (smb, srb) 0, 0 0, 0 bsc register (bsc0?bsc) 0 0 clocks: power control register (pcon) 0 0 clock output mode register (clmod) 0 0 interrupts: interrupt request flags (irqx) 0 0 interrupt enable flags (iex) 0 0 interrupt priority flag (ipr) 0 0 interrupt master enable flag (ime) 0 0 int0 mode register (imod0) 0 0 int1 mode register (imod1) (2) 0 0 int2 mode register (imod2) 0 0 notes 1. the value of the 0f8h?0fdh are not retained when a reset signal is input. 2. s3c7534/c7538 does not use the imod1.
s3c7524/c7528/p7528/c7534/c7538/p7538 reset reset 9? 3 table 9-1. hardware register values after reset reset (continued) hardware component or subcomponent if reset reset occurs during power-down mode if reset reset occurs during normal operation i/o ports: output buffers off off output latches 0 0 port mode flags (pmg) 0 0 pull-up resistor mode reg (pumod1/2) 0 0 port open-drain enable register (pne1) 0 0 basic timer: count register (bcnt) undefined undefined mode register (bmod) 0 0 output enable flag (boe) 0 0 timer/counters 0 and 1: count registers (tcnt0/1) 0 0 reference registers (tref0/1) ffh/ffh ffh/ffh mode registers (tmod0/1) 0 0 t/c output enable flags (toe0/1) 0 0 t/c output latch (tol0/1) 0 0 watch timer: watch timer mode register (wmod) 0 0 watchdog timer wdt mode register (wdmod) a5h a5h wdt clear flag (wdtcf) 0 0 dtmf generator: dtmf mode register (dtmr) 0 0
s3c7524/c7528/p7528/c7534/c7538/p7538 i/ o ports 10? 1 10 i/o ports overview the s3c7524/c7528 has one input port and eight i/o ports. the s3c7534/c7538 has one input port and six i/o ports. pin addresses for all i/o ports are mapped in bank 15 of the ram. the contents of i/o port pin latches can be read, written, or tested at the corresponding address using bit manipulation instructions. the s3c7524/c7528 has four input pins and 31 configurable i/o pins for a maximum number of 35 i/o pins. the s3c7534/c7538 has one input pin and 22 configurable i/o pins for a maximum number of 23 i/o pins. port mode flags port mode flags (pm) are used to configure i/o ports 2 and 3 (port mode group 1), ports 4 and 5 (port mode group 2), ports 6 and 7 (port mode group 3), and port 8 and 9 (port mode group 4, s3c7524/c7528 only) to input or output mode by setting or clearing the corresponding i/o buffer. pmg flags are grouped in four 8-bit registers, and are addressable by 8-bit write instructions only. pumod control register the pull-up mode registers, pumod1 and 2 are 8-bit and 4-bit registers, respectively, used to assign internal pull-up resistors by software to specific i/o ports. when configurable i/o ports 2 through 9 serves as an output pin, its assigned pull-up resistor is automatically disabled, even though the pin?s pull-up resistor is enabled by a corresponding bit setting in the pull-up resistor mode register (pumod). pumod1 is addressable by 8-bit write instructions only, pumod2 is addressable by 4-bit write instructions only. reset clears pumod register values to logic zero, automatically disconnecting all software-assignable port pull- up resistors. table 10-1. i/o port overview port i/o pins pin names address function description 1 i 4 p1.0 p1.1?p1.3 (note) ff1h 4-bit input port. 1-bit and 4-bit read and test is possible. 1-bit pull-up resistors are software assignable 2, 3 i/o 8 p2.0?p2.3 p3.0?p3.1 p3.2?p3.3 (note) ff2h ff3h 4-bit i/o ports. 1-bit and 4-bit read/write/test is possible. ports 2 and 3 pins are individually software configurable as input or output. 4-bit pull-up resistors are software assignable; pull-up registers are automatically disabled for output pins. ports 2 and 3 can be paired for 8-bit data transfer. note: s3c7534/c7538 does not use the p1.1?p1.3, and p3.2?p3.3 pins.
i/o ports s3c7524/c7 528/p7528/c7534/c7538/p7538 10? 2 table 10-1. i/o port overview (continued) port i/o pins pin names address function description 4, 5 i/o 8 p4.0?p4.3 p5.0?p5.3 ff4h ff5h 4-bit i/o ports. 1-bit and 4-bit read/write/test is possible. port 4 and 5 pins are individually software configurable as input or output. 4-bit pull-up resistors are software assignable; pull- up registers are automatically disable for output pins. n-ch open drain or push-pull output may be selected by software. ports 4 and 5 can be paired for 8-bit data transfer. 6, 7 i/o 8 p6.0?p6.3 p7.0?p7.3 ff6h ff7h 4-bit i/o ports. 1-bit and 4 -bit read/write/test is possible. port 6 and 7 pins are individually software configurable as input or output. 4-bit pull -up resistors are software assignable; pull-up registers are automatically disabled for output pins. ports 6 and 7 can be paired for 8-bit data transfer. 8, 9 (note) i/o 8 p8.0?p8.3 p9.0?p9.2 ff8h ff9h 4-bit i/o port. 1-bit and 4-bit read/write and test is possible. ports 8 and 9 pins are individually software configurable as input or output. 4-bit pull-up resistors are software assignable; pull-up registers are automatically disable for output pins. ports 8 and 9 can be paired for 8-bit data transfer. note: s3c7534/c7538 does not use the 8, 9 ports. table 10-2. port pin status during instruction execution instruction type example input mode status output mode status 1-bit test 1-bit input 4-bit input 8-bit input btst ldb ld ld p2.3 c,p1.0 a,p7 ea,p4 input or test data at each pin input or test data at output latch 1-bit output bitr p2.3 output latch contents undefined output pin status is modified 4-bit output 8-bit output ld ld p2,a p6,ea transfer accumulator data to the output latch transfer accumulator data to the output pin
s3c7524/c7528/p7528/c7534/c7538/p7538 i/ o ports 10? 3 port mode flags (pm flags) port mode flags (pm) are used to configure i/o ports 2?9 to input or output mode by setting or clearing the corresponding i/o buffer. for convenient program reference, pm flags are organized into four groups ? pmg1, pmg2, pmg3, and pmg4 as shown in table 10-3. pm flags are addressable by 8-bit write instructions only. when a pm flag is ?0?, the port is set to input mode; when it is ?1?, the port is enabled for output. reset clears all port mode flags to logic zero, automatically configuring the corresponding i/o ports to input mode. table 10-3. port mode group flags pm group id address bit 3 bit 2 bit 1 bit 0 pmg1 fe8h pm2.3 pm2.2 pm2.1 pm2.0 fe9h pm3.3 (2) pm3.2 (2) pm3.1 pm3.0 pmg2 feah pm4.3 pm4.2 pm4.1 pm4.0 febh pm5.3 pm5.2 pm5.1 pm5.0 pmg3 fech pm6.3 pm6.2 pm6.1 pm6.0 fedh pm7.3 pm7.2 pm7.1 pm7.0 pmg4 (2) feeh pm8.3 pm8.2 pm8.1 pm8.0 fefh ?0? pm9.2 pm9.1 pm9.0 notes 1. if bit = ?0?, the corresponding i/o pin is set to input mode. if bit = ?1?, the pin is set to output mode: pm4 for port 4 and so on. all flags are cleared to ?0? following reset . 2. s3c7534/c7538 does not use the pm3.2, pm3.3, and pmg4. + + programming tip ? configuring i/o ports to input or output configure p2.3 and p3 as an output port and the other ports as input ports: bits emb smb 15 ld ea,#0f8h ld pmg1,ea ; p2.3, p3 ? output, p2.0?p2.2 ? input ld ea,#00h ld pmg2,ea ; p4, p5 ? input, ld pmg3,ea ; p6, p7 ? input ld pmg4,ea ; p8, p9 ? input note: s3c7534/c7538 does not use the p1.1?p1.3, p3.2?p3.3, and p8.9.
i/o ports s3c7524/c7 528/p7528/c7534/c7538/p7538 10? 4 pull-up resistor mode register (pumod) the pull-up resistor mode registers (pumod1 and 2) are 8-bit registers used to assign internal pull-up resistors by software to specific i/o ports. when configurable i/o ports 2 through 9 are used as an output pin, its assigned pull-up resistor is automatically disabled, even though the pin?s pull-up is enabled by a corresponding pumod bit setting. pumod1 is addressable by 8-bit write instructions only. pumod2 is addressable by 4bit write instructions only. reset clears pumod register values to logic zero, automatically disconnecting all software-assignable port pull- up resistors. table 10-4. pull-up resistor mode register (pumod) organization pumod id address bit 3 bit 2 bit 1 bit 0 pumod1 fdch pur1.3 pur1.2 pur1.1 pur1.0 fddh pur5 pur4 pur3 pur2 pumod2 fdeh pur9 (2) pur8 (2) pur7 pur6 notes 1. when bit = ?1?, pull-up resistors are assigned to the corresponding i/o port: pur3 for port 3, pur2 for port 2, and so on. 2. s3c7534/c7538 does not use the pur1.1?pur1.3, pur8, and pur9. + + programming tip ? enabling and disabling i/o port pull-up resistors p2?p5 enable pull-up resistors, p1 disable pull-up resistors. bits emb smb 15 ld ea,#0f0h ld pumod1,ea ; p2?p5 enable n-channel open-drain mode register (pne) the n-channel, open-drain mode register (pne) is used to configure ports 4 and 5 to n-channel open-drain or as push-pull outputs. when a bit in the pne register is set to "1", the corresponding output pin is configured to n-channel open-drain; when set to "0", the output pin is configured to push-pull. the pne register consists of an 8-bit register; pne 1 can be addressed by 8-bit write instructions only. fdah pne 4 .3 pne 4 .2 pne 4 .1 pne 4 .0 pne1 fd b h pne 5 .3 pne 5 .2 pne 5 .1 pne 5 .0
s3c7524/c7528/p7528/c7534/c7538/p7538 i/ o ports 10? 5 port 1 circuit diagram p1.0 / int0 p1.1 / int1 p1.2 / int2 p1.3 / int4 v dd v dd v dd v dd pur1.0 pur1.1 pur1.2 pur1.3 int 0 int 1 int 2 int 3 note: s3c7534/c7538 does not use the p1.1-p1.3. figure 10-1. port 1 circuit diagram
i/o ports s3c7524/c7 528/p7528/c7534/c7538/p7538 10? 6 port 2, 3, 6, 7, 8, and 9 circuit diagram v dd 1, 4, 8 1, 4, 8 x = port number (2, 3, 6, 8) notes 1. when a port pin acts as an output, its pull-up resistor is automatically disabled, even though the port's pull-up resistor is enabled by bit settings to the pull-up resistor mode register (pumod). 2. s3c7534/c7538 does not use the p3.2, p3.3, p8, and p9. pur pur pur pur m u x pmx.2 pmx.3 pmx.1 px.0 px.1 px.2 px.3 output latch pmx.0 figure 10-2. port 2, 3, 6, 7, 8, and 9 circuit diagram
s3c7524/c7528/p7528/c7534/c7538/p7538 i/ o ports 10? 7 port 4, 5 circuit diagram px.b v dd 1, 4, 8 8 p-ch n-c h v ss m u x p-ch pumod.b b=4, 5 output latch pne pmx.b x=4, 5 b=0, 1, 2, 3 8 8 figure 10-3. port 4 and 5 circuit diagram
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 1 11 timers and timer/counters overview the s3c7524/c7528/c7534/c7538 microcontroller has four timer and timer/counter modules: ? 8-bit basic timer (bt) ? 8-bit timer/counters (tc0, tc1) ? watch ti mer (wt) the 8-bit basic timer (bt) is the microcontroller's main interval timer. it generates an interrupt request at a fixed time interval when the appropriate modification is made to its mode register. when the contents of the basic timer counter register bcnt overflows, a pulse is output to the basic timer output pin, btco. the basic timer also functions as a 'watchdog' timer and is used to determine clock oscillation stabilization time when stop mode is released by an interrupt and after a reset . the 8-bit timer/counters (tc0, tc1) are programmable timer/counters that are used primarily for event counting and for clock frequency modification and output. the watch timer (wt) module consists of an 8-bit watch timer mode register, a clock selector, and a frequency divider circuit. watch timer functions include real-time and watch-time measurement, system clock interval timing, buzzer output generation.
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 2 basic timer (bt) overview the 8-bit basic timer (bt) has six functional components: ? clock selector logic ? 4-bit mode register (bmod) ? 8-bit counter register (bcnt) ? output enable flag (boe) ? 8-bit watchdog timer mode register (wdmod) ? watchdog timer counter clear flag (wdtcf) the basic timer generates interrupt requests at precise intervals, based on the frequency of the system clock. timer pulses are output from the basic timer's counter register bcnt to the output pin btco when an overflow occurs in the counter register bcnt. you can use the basic timer as a "watchdog" timer for monitoring system events or use bt output to stabilize clock oscillation when stop mode is released by an interrupt and following reset . bit settings in the basic timer mode register bmod turns the bt module on and off, selects the input clock frequency, and controls interrupt or stabilization intervals. interval timer function the basic timer's primary function is to measure elapsed time intervals. the standard time interval is equal to 256 basic timer clock pulses. to restart the basic timer, one bit setting is required: bit 3 of the mode register bmod should be set to logic one. the input clock frequency and the interrupt and stabilization interval are selected by loading the appropriate bit values to bmod.2?bmod.0. the 8-bit counter register, bcnt, is incremented each time a clock signal is detected that corresponds to the frequency selected by bmod. bcnt continues incrementing as it counts bt clocks until an overflow occurs ( 3 255). an overflow causes the bt interrupt request flag (irqb) to be set to logic one to signal that the designated time interval has elapsed. an interrupt request is than generated, bcnt is cleared to logic zero, and counting continues from 00h. watchdog timer function the basic timer can also be used as a "watchdog" timer to signal the occurrence of system or program operation error. for this purpose, instruction that clear the watchdog timer (bits wdtcf) should be executed at proper points in a program within given period. if an instruction that clears the watchdog timer is not executed within the given period and the watchdog timer overflows, reset signal is generated and the system restarts with reset status. an operation of watchdog timer is as follows: ? write some values (except #5ah) to watchdog timer mode register, wdmod ? if wdcnt overflows, system reset is generated.
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 3 oscillation stabilization interval control bits 2?0 of the bmod register are used to select the input clock frequency for the basic timer. this setting also determines the time interval (also referred to as ?wait time?) required to stabilize clock signal oscillation when stop mode is released by an interrupt. when a reset signal is inputted, the standard stabilization interval for system clock oscillation following the reset is 31.3 ms at 4.19 mhz. table 11-1. basic timer register overview register name type description size ram address addressing mode reset value bmod control controls the clock frequency (mode) of the basic timer; also, the oscillation stabilization interval after stop mode release or reset 4-bit f85h 4-bit write-only; bmod.3: 1-bit writeable ?0? bcnt counter counts clock pulses matching the bmod frequency setting 8-bit f86h?f87h 8-bit read-only u (note) boe flag controls output of basic timer output latch to the btco pin 1-bit f92h.1 1-, 4-bit read/write ?0? wdmod control controls watchdog timer operation. 8-bit f98h?f99h 8-bit write-only a5h wdtcf control clears the watchdog timer?s counter. 1-bit f9ah.3 1-, 4-bit write-only ?0? note: 'u' means the value is undetermined after a reset .
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 4 "clear" signal bits instruction clock selector bcnt irqb interrupt request overflow cpu clock start signal (power-down release) 1-bit r/w clock input clear irqb 4 clear bcnt bmod.3 bmod.2 bmod.1 bmod.0 1 pulse period = bt input clock 2 (1/2 duty) 8 wdtcnt reset generation 8 wdtcf delay wait (1) reset stop bits instruction reset 3-bit counter overflow clear clear boe p4.0 latch btco/p4.0 8 wdmod (2) notes: 1. wait means the stabilization time after or the stabilization time after stop mode release. 2. the reset signal can be generated, if the wdmod is toggled eignt times. ?toggle? means to change the value of wdmod from 5ah to another value, or vice versa. reset figure 11-1. basic timer circuit diagram
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 5 basic timer mode register (bmod) the basic timer mode register, bmod, is a 4-bit write-only register. bit 3, the basic timer start control bit, is also 1-bit addressable. all bmod values are set to logic zero following reset and interrupt request signal generation is set to the longest interval. (bt counter operation cannot be stopped.) bmod settings have the following effects: ? restart the basic timer; ? control the frequency of clock signal input to the basic timer; ? determine time interval required for clock oscillation to stabilize following the release of stop mode by an interrupt. by loading different values into the bmod register, you can dynamically modify the basic timer clock frequency during program execution. four bt frequencies, ranging from fx/2 12 to fx/2 5 , are selectable. since bmod's reset value is logic zero, the default clock frequency setting is fx/2 12 . the most significant bit of the bmod register, bmod.3, is used to restart the basic timer. when bmod.3 is set to logic one by a 1-bit write instruction, the contents of the bt counter register (bcnt) and the bt interrupt request flag (irqb) are both cleared to logic zero, and timer operation restarts. the combination of bit settings in the remaining three registers ? bmod.2, bmod.1, and bmod.0 ? determine the clock input frequency and oscillation stabilization interval. table 11-2. basic timer mode register (bmod) organization bmod.3 basic timer start control bit 1 start basic timer; clear irqb, bcnt, and bmod.3 to "0" bmod.2 bmod.1 bmod.0 basic timer input clock oscillation stabilization 0 0 0 fx/2 12 (1.02 khz) 2 20 /fx (250 ms) 0 1 1 fx/2 9 (8.18 khz) 2 17 /fx (31.3 ms) 1 0 1 fx/2 7 (32.7 khz) 2 15 /fx (7.82 ms) 1 1 1 fx/2 5 (131 khz) 2 13 /fx (1.95 ms) notes 1. clock frequencies and oscillation stabilization assume a system oscillator clock frequency (fx) of 4.19 mhz. 2. fx = system clock frequency. 3. oscillation stabilization time is the time required to stabilize clock signal oscillation after stop mode is released. the data in the table column 'oscillation stabilization' can also be interpreted as "interrupt interval time." 4. the standard stabilization time for system clock oscillation following a reset is 31.3 ms at 4.19 mhz.
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 6 basic timer counter (bcnt) bcnt is an 8-bit counter for the basic timer. it can be addressed by 8-bit read instructions. reset leaves the bcnt counter value undetermined. bcnt is automatically cleared to logic zero whenever the bmod register control bit (bmod.3) is set to "1" to restart the basic timer. it is incremented each time a clock pulse of the frequency determined by the current bmod bit settings is detected. when bcnt has incrementing to hexadecimal ?ffh? ( 3 255 clock pulses), it is cleared to ?00h? and an overflow is generated. the overflow causes the interrupt request flag, irqb, to be set to logic one. when the interrupt request is generated, bcnt immediately resumes counting incoming clock signals. note always execute a bcnt read operation twice to eliminate the possibility of reading unstable data while the counter is incrementing. if, after two consecutive reads, the bcnt values match, you can select the latter value as valid data. until the results of the consecutive reads match, however, the read operation must be repeated until the validation condition is met. basic timer output enable flag (boe) the basic timer output enable flag (boe) enables and disables basic timer output to the btco pin at i/o port 4 (p4.0). when boe is logic zero, basic timer output to the btco pin is disabled; when it is logic one, bt output to the btco pin is enabled. a reset clears the boe flag to "0", disabling basic timer output to the btco pin. when the boe flag is set to "1" and the bcnt register overflows, the overflow signal is sent to the btco pin. boe can be addressed by 1 -bit read and write instructions. bit 3 bit 2 bit 1 bit 0 f92h toe1 toe0 boe 0 basic timer operation sequence the basic timer's sequence of operations may be summarized as follows: 1. set bmod.3 to logic one to restart the basic timer 2. bcnt is then incremented by one after each clock pulse corresponding to b mod selection 3. bcnt overflows if bcnt = 255 (bcnt = ffh) 4. when an overflow occurs, the irqb flag is set by hardware to logic one 5. the interrupt request is generated 6. bcnt is then cleared by hardware to logic zero 7. basic timer resumes counting clock pulses
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 7 + + programming tip ? using the basic timer 1. to read the basic timer count register (bcnt): bits emb smb 15 bcntr ld ea,bcnt ld yz,ea ld ea,bcnt cpse ea,yz jr bcntr 2. when stop m ode is released by an interrupt, set the oscillation stabilization interval to 31.3 ms: bits emb smb 15 ld a,#0bh ld bmod,a ; wait time is 31.3 ms stop ; set stop power-down mode nop nop nop 3. to set the basic timer interrupt interval time to 1.95 ms (at 4.19 mhz): bits emb smb 15 ld a,#0fh ld bmod,a ei bits ieb ; basic timer interrupt enable flag is set to "1" 4. clear bcnt and the irqb flag and restart the basic timer: bits emb smb 15 bits bmod.3 cpu operation normal operating mode stop mode idle mode normal operating mode (31.3 ms) stop instruction stop mode is released by interrupt
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 8 watchdog timer mode register (wdmod) the watchdog timer mode register, wdmod, is a 8-bit write-only register. wdmod register controls to enable or disable the watchdog function. wdmod values are set to logic ?a5h? following reset and this value enables the watchdog timer. watchdog timer is set to the longest interval because bt overflow signal is generated with the longest interval. wdmod watchdog timer enable/disable control 5ah disable watchdog timer function any other value enable watchdog timer function watchdog timer counter (wdcnt) the watchdog timer counter, wdcnt, is a 3-bit counter. wdcnt is automatically cleared to logic zero, and restarts whenever the wdtcf register control bit is set to ?1?. reset, stop, and wait signal clears the wdcnt to logic zero also. wdcnt increments each time a clock pulse of the overflow frequency determined by the current bmod bit setting is generated. when wdcnt has incremented to hexadecimal ?07h?, it is cleared to ?00h? and an overflow is generated. the overflow causes the system reset . when the interrupt request is generated, bcnt immediately resumes counting incoming clock signals. watchdog timer counter clear flag (wdtcf) the watchdog timer counter clear flag, wdtcf, is a 1-bit write instruction. when wdtcf is set to one, it clears the wdcnt to zero and restarts the wdcnt. wdtcf register bits 2?0 are always logic zero. table 11-3. watchdog timer interval time bmod bt input clock wdcnt input clock wdt interval time main clock x000b 2 12 /fx 2 12 /fx 2 8 2 12 /fx 2 8 2 3 2 second x011b 2 9 /fx 2 9 /fx 2 8 2 9 /fx 2 8 2 3 250 ms x101b 2 7 /fx 2 7 /fx 2 8 2 7 /fx 2 8 2 3 62.5 ms x111b 2 5 /fx 2 5 /fx 2 8 2 5 /fx 2 8 2 3 15.6 ms notes 1. clock frequencies assume a system oscillator clock frequency (fx) of 4.19 mhz 2. fx = system clock frequency.
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 9 + + programming tip ? using the watchdog timer reset di ld ea,#00h ld sp,ea ? ? ? ld a,#0dh ; wdcnt input clock is 7.82 ms ld bmod,a ? ? ? main bits wdtcf ; main routine operation period must be sh orter than watchdog ? ; timer?s period ? ? jp main
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 10 8-bit timer/counters 0 and 1 (tc0, tc1) overview the s3c7524/c7528/c7534/c7538 tc0 and tc1 are identical except that they have different counter clock sources, which are controlled by the tmodn register. timer/counters 0 and 1 (tc0, tc1) are used to count system 'events' by identifying the transition (high-to-low or low-to-high) of incoming square wave signals. to indicate that an event has occurred, or that a specified time interval has elapsed, tc generates an interrupt request. by counting signal transitions and comparing the current counter value with the reference register value, tc can be used to measure specific time intervals. tc has a reloadable counter that consists of two parts: an 8-bit reference register, trefn (n = 0, 1) into which you write the counter reference value, and an 8-bit counter register ,tcntn (n = 0, 1) whose value is automatically incremented by counter logic. 8-bit mode register, tmodn (n = 0, 1), is used to activate the timer/counter and to select the basic clock frequency to be used for timer/counter operations. to dynamically modify the basic frequency, new values can be loaded into the tmodn register during program execution. tc function summary 8-bit programmable timer generates interrupts at specific time intervals based on the selected clock frequency. external event counter counts various system "events" based on edge detection of external clock signals at the tc input pin, tcln (n = 0, 1). arbitrary frequency output outputs clock frequencies to the tc output pin, tclon (n = 0, 1). external signal divider divides the frequency of an incoming external clock signal according to a modifiable reference value (trefn), and outputs the modified frequency to the tclon pin.
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 11 tc component summary mode register (tmodn) activates the timer/counter and selects the internal clock frequency or the external clock source at the tcln pin. reference register (trefn) stores the reference value for the desired number of clock pulses between interrupt requests. counter register (tcntn) counts internal or external clock pulses based on the bit settings in tmodn and trefn. clock selector circuit together with the mode register (tmodn), lets you select one of four internal clock frequencies or an external clock. 8-bit comparator determines when to generate an interrupt by comparing the current value of the counter register (tcntn) with the reference value previously programmed into the reference register (trefn). output latch (toln) when the contents of the tcntn and trefn registers coincide, the timer/counter interrupt request flag (irqtn) is set to "1", the status of toln is inverted, and an interrupt is generated. output enable flag (toen) must be set to logic one before the contents of the toln latch can be output to tclon. interrupt request flag (irqtn) cleared when tc operation starts and the tc interrupt service routine is executed and set to one whenever the counter value and reference value coincide. interrupt enable flag (ietn) must be set to logic one before the interrupt requests generated by timer/counters can be processed. table 11-4. tc register overview register name type description size ram address addressing mode reset value tmod0 tmod1 control controls tc0 and tc1 enable/disable (bit 2); clears and resumes counting operation (bit 3); sets input clock and clock frequency (bits 6?4) 8-bit f90h?f91h fa0h?fa1h 8-bit write only; (tmodn.3 is also 1 -bit writeable) "0" tcnt0 tcnt1 counter counts clock pulses matching the tmodn frequency setting 8-bit f94h?f95h fa4h?fa5h 8-bit read-only "0" tref0 tref1 reference stores reference value for the timer/counters interval setting 8-bit f96h?f97h fa8h?fa9h 8-bit write-only ffh toe0 toe1 flag controls timer/counters output to the tclon pin 1-bit f92h.2 f92h.3 1-, 4-bit read/write "0"
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 12 tcln tclon clock selector tcntn 8-bit comparator toln p2.n latch toen irqtn pm2.n tmodn.7 tmodn.6 tmodn.5 tmodn.4 tmodn.3 tmodn.2 tmodn.1 tmodn.0 trefn clear inverted set clear clocks 8 8 8 4 figure 11-2. tc circuit diagram tc enable/disable procedure enable timer/counter ? set tmodn.2 to logic one ? set the tc interrupt enable flag ietn to logic one ? set tmodn.3 to logic one tcntn and irqtn are cleared to logic zero, and timer/counter operation starts. disable timer/counter ? set tmodn.2 to logic zero clock signal input to the counter register tcntn is halted. the current tcntn value is retained and can be read if necessary.
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 13 tc programmable timer/counter function timer/counters can be programmed to generate interrupt requests at various intervals based on the selected system clock frequency. its 8-bit tc mode register tmodn is used to activate the timer/counter and to select the clock frequency. the reference register trefn stores the value for the number of clock pulses to be generated between interrupt requests. the counter register, tcntn, counts the incoming clock pulses, which are compared to the trefn value as tcntn is incremented. when there is a match (trefn = tcntn), an interrupt request is generated. to program timer/counter to generate interrupt requests at specific intervals, choose one of four internal clock frequencies (divisions of the system clock, fx) and load a counter reference value into the reference register. the count register is incremented each time an internal counter pulse is detected with the reference clock frequency specified by tmodn.4?tmodn.6 settings. to generate an interrupt request, the tc interrupt request flag (irqtn) should be set to logic one, the status of toln is inverted, and the interrupt is generated. the content of the counter register is then cleared to 00h and tc continues counting. the interrupt request mechanism for tc includes an interrupt enable flag (ietn) and an interrupt request flag (irqtn). tc operation sequence the general sequence of operations for using tc can be summarized as follows: 1. set tmodn.2 to "1" to enable tc0 and tc1 2. set tmodn.6 to "1" to enable the system clock (fx) input 3. set tmodn.5 and tmodn.4 bits to desired internal frequency (fx/2 n ) 4. load a value to trefn to specify the interval between interrupt requests 5. set the tc interrupt enable flag (ietn) to "1" 6. set tmodn.3 bit to "1" to clear tcntn and irqtn, and start counting 7. tcntn increments with each internal clock pulse 8. when the comparator shows tcntn = trefn, the irqtn flag is set to "1" 9. output latch (toln) logic toggles high or low 10. interrupt request is generated 11. tcntn is cleared to 00h and counting resumes 12. programmable timer/counter operation continues until tmodn.2 is cleared to "0".
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 14 tc event counter function timer/counters can monitor or detect system 'events' by using the external clock input at the tcln pin as the counter source. the tc mode register selects rising or falling edge detection for incoming clock signals. the counter register is incremented each time the selected state transition of the external clock signal occurs. with the exception of the different tmodn.4?tmodn.6 settings, the operation sequence for tc's event counter function is identical to its programmable timer/counter function. to activate the tc event counter function, ? set tmodn.2 to "1" to enable tc; ? clear tmodn.6 to "0" to select the external clock source at the tcln pin; ? select tcln edge detection for rising or falling signal edges by load ing the appropriate values to tmodn.5 and tmodn.4. ? p3.0 and p3.1 must be set to input mode. table 11-5. tmodn settings for tcln edge detection tmodn.5 tmodn.4 tcln edge detection 0 0 rising edges 0 1 falling edges
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 15 tc clock frequency output using timer/counters, a modifiable clock frequency can be output to the tc clock output pin, tclon. to select the clock frequency, load the appropriate values to the tc mode register, tmodn. the clock interval is selected by loading the desired reference value into the reference register trefn. in summary, the operational sequence required to output a tc-generated clock signal to the tclon pin is as follows: 1. load a reference value to trefn. 2. set the internal clock frequency in tmodn. 3. initiate tcn clock output to tclon (tmodn.2 = "1"). 4. set port 2 mode flag (pm2.0 and pm 2.1) to "1". 5. set p2.0 and p2.1 output latches to "0". 6. set toen flag to "1". each time the contents of tcntn and trefn coincide and an interrupt request is generated, the state of the output latch toln is inverted and the tc-generated clock signal is output to the tclon pin. + + programming tip ? tc0 signal output to the tclo0 pin output a 30 ms pulse width signal to the tclo0 pin: bits emb smb 15 ld ea,#68h ld tref0,ea ld ea,#4ch ld tmod0,ea ld ea,#01h ld pmg1,ea ; p2.0 ? output mode bitr p2.0 ; p2.0 clear bits toe0
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 16 tc external input signal divider by selecting an external clock source and loading a reference value into the tc reference register, trefn, you can divide the incoming clock signal by the trefn value and then output this modified clock frequency to the tclon pin. the sequence of operations used to divide external clock input can be summarized as follows: 1. load a signal divider value to the trefn register 2. clear tmodn.6 to "0" to enable external clock input at the tcln pin 3. set tmodn.5 and tmodn.4 to desired tcln signal edge detection 4. set port 2 mode flag (pm2.0, pm2.1) to output ("1") 5. set p2.0 and p2.1 output latches to "0" 6. set toen flag to "1" to enable output of the divided frequency to the tclon pin + + programming tip ? external tcl0 clock output to the tclo0 pin output external tcl0 clock pulse to the tclo0 pin (divide by four): bits emb smb 15 ld ea, #01h ld tref0,ea ld ea,#0ch ld tmod0,ea ld ea,#01h ld pmg1,ea ; p2.0 ? output mode bitr p2.0 ; p2.0 clear bits toe0 external (tcl0) clock pulse tclo0 output pulse
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 17 tc mode register (tmod n ) tmodn are the 8-bit mode control registers for timer/counter 0 and 1. they are addressable by 8-bit write instructions. one bit, tmodn.3, is also 1-bit writeable. reset clears all tmodn bits to logic zero and disables tc operations. f90h tmod0.3 tmod0.2 "0" "0" tmod0 f91h "0" tmod0.6 tmod0.5 tmod0.4 fa0h tmod1.3 tmod1.2 "0" "0" tmod1 fa1h "0" tmod1.6 tmod1.5 tmod1.4 tmodn.2 is the enable/disable bit for timer/counter 0 and 1. when tmodn.3 is set to "1", the contents of tcntn and irqtn are cleared, counting starts from 00h, and tmodn.3 is automatically reset to "0" for normal tc operation. when tc operation stops (tmodn.2 = "0"), the contents of the counter register tcntn are retained until tc is re-enabled. the tmodn.6, tmodn.5, and tmodn.4 bit settings are used together to select the tc clock source. this selection involves two variables: ? synchronization of timer/counter operations with either the rising edge or the falling edge of the clock signal input at the tcln pin, and ? selection of one of four frequencies, based on division of the incoming system clock frequency, for use in internal tc operation. table 11-6. tc mode register (tmodn) organization bit name setting resulting tc0 function address tmodn.7 0 always logic zero f91h (tmod0) tmodn.6 0,1 specify input clock edge and internal frequency fa1h (tmod1) tmodn.5 tmodn.4 tmodn.3 1 clear tcntn and irqtn. toln is remained and resume counting immediately (this bit is automatically cleared to logic zero immediately after counting resumes.) f90h (tmod0) fa0h (tmod1) tmodn.2 0 disable timer/counter; retain tcntn contents 1 enable timer/counter tmodn.1 0 always logic zero tmodn.0 0 always logic zero
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 18 table 11-7. tmodn.6, tmodn.5, and tmodn.4 bit settings tmodn.6 tmodn.5 tmodn.4 tc0 counter source tc1 counter source 0 0 0 external clock input (tcl0) on rising edges external clock input (tcl1) on rising edges 0 0 1 external clock input (tcl0) on falling edges external clock input (tcl1) on falling edges 1 0 0 fx/2 10 (4.09 khz) fx/2 12 (1.02 khz) 1 0 1 fx /2 6 (65.5 khz) fx /2 10 (4.09 khz) 1 1 0 fx/2 4 (262 khz) fx/2 8 (16.4 khz) 1 1 1 fx = 4.19 mhz fx/2 6 (65.5 khz) note : 'fx' = system clock of 4.19 m hz. + + programming tip ? restarting tc0 counting operation 1. set tc0 timer interval to 4.09 khz: bits emb smb 15 ld ea,#4ch ld tmod0,ea ei bits iet0 2. clear tcnt0 and irqt0, tol0 is remained and restart tc0 counting operation: bits emb smb 15 bits tmod0.3
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 19 tc counter register (tcnt n ) the 8-bit counter register for tc, tcntn, is read-only and can be addressed by 8-bit ram control instructions. reset sets all counter register values to logic zero (00h). whenever tmodn.3 is enabled, tcntn is cleared to logic zero and counting resumes. the tcntn register value is incremented each time an incoming clock signal is detected that matches the signal edge and frequency setting of the tmodn register (specifically, tmodn.6?tmodn.4). each time tcntn is incremented, the new value is compared to the reference value stored in the reference register, trefn. when tcntn = trefn, an overflow occurs in the counter register, the interrupt request flag, irqtn, is set to logic one, and an interrupt request is generated to indicate that the specified timer/counter interval has elapsed. count clock tcntn toln timer start instruction (tmodn.3 is set) trefn reference value = n 0 1 2 n-1 n 0 1 2 n-1 0 1 2 n n interval time irqtn set irqtn set n match match 3 figure 11-3. tc timing diagram
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 20 tc reference register (tref n ) the tc reference register, trefn, is an 8-bit write-only register. reset initializes the trefn value to 'ffh'. trefn is used to store a reference value to be compared to the incrementing tcntn register in order to identify an elapsed time interval. reference values will differ depending upon the specific function that tc is being used to perform ? as a programmable timer/counter, event counter, clock signal divider, or arbitrary frequency output source. during timer/counter operation, the value loaded into the reference register is compared to the counter value. when tcntn = trefn, the tc output latch (toln) is inverted and an interrupt request is generated to signal the interval or event. the trefn value, together with the tmodn clock frequency selection, determines the specific tc timer interval. use the following formula to calculate the correct value to load to the trefn reference register: tc timer interval = (trefn value + 1) 1 tmodn frequency setting ( assuming a trefn value 1 0 ) tc output enable flag (toe n ) the 1-bit timer/counter output enable flag toen controls output from timer/counter to the tclon pin. toen is addressable by 1-bit read and write instructions. bit 3 bit 2 bit 1 bit 0 f92h toe1 toe0 boe 0 when you set the toen flag to "1", the contents of toln can be output to the tclon pin. whenever a reset occurs, toen is automatically set to logic zero, disabling all tc output. tc output latch (tol n ) toln is the output latch for timer/counter 0 and 1. when the 8-bit comparator detects a correspondence between the value of the counter register tcntn and the reference value stored in the trefn register, the toln value is inverted ? the latch toggles high-to-low or low-to-high. whenever the state of toln is switched, the tc signal is output. tc output is directed to the tclon pin. assuming tc is enabled, when bit 3 of the tmodn register is set to "1", the toln latch is remained, the counter register, tcntn and the interrupt request flag, irqtn are cleared, and counting resumes immediately. when tcn is disabled (tmodn.2 = "0"), the contents of the toln latch are retained and can be read, if necessary.
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 21 + + programming tip ? setting a tc0 timer interval to set a 30 ms timer interval for tc0, given fx = 3.58 mhz, follow these steps. 1. select the timer/counter 0 mode register with a maximum setup time of 73.3 ms (assume the tc0 counter clock = fx/2 10 , and tref0 is set to ffh): 2. calculate the tref0 value: 30 ms = tref0 value + 1 3.49 khz tref0 + 1 = 30 ms 286 s = 104.8 = 69h tref0 value = 69h ? 1 = 68h 3. load the value 68h to the tref0 register: bits emb smb 15 ld ea,#68h ld tref0,ea ld ea,#4ch ld tmod0,ea
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 22 watch timer overview the watch timer is a multi-purpose timer consisting of three basic components: ? 8-bit watch timer mode register (wmod) ? clock selector ? frequency divider circuit watch timer functions include real-time and watch-time measurement and interval timing for the system clock. it is also used as a clock source for generating buzzer output. real-time and watch-time measurement to start watch timer operation, set bit 2 of the watch timer mode register, wmod.2, to logic one. the watch timer starts, the interrupt request flag irqw is automatically set to logic one, and interrupt requests commence in 0.5- second intervals. since the watch timer functions as a quasi-interrupt instead of a vectored interrupt, the irqw flag should be cleared to logic zero by program software as soon as a requested interrupt service routine has been executed. using a system clock source the watch timer can generate interrupts based on the system clock frequency. the system clock (fx) is used as the signal source, according to the following formula: watch timer clock (fw) = main system clock (fx) 128 = 32.768khz (assuming fx = 4.19 mhz) buzzer output frequency generator the watch timer can generate a steady 2 khz, 4 khz, 8 khz, or 16 khz signal at 4.19 mhz to the buz pin. to select the buz frequency you want, load the appropriate value to the wmod register. this output can then be used to actuate an external buzzer sound. to generate a buz signal, three conditions must be met: ? the wmod.7 register bit is set to "1" ? the output latch for i/o port 2.3 is cleared to "0" ? the port 2.3 output mode flag (pm2.3) set to 'output' mode
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 23 timing tests in high-speed mode by setting wmod.1 to "1", the watch timer will function in high-speed mode, generating an interrupt every 3.91 ms at 4.19 mhz. at its normal speed (wmod.1 = '0'), the watch timer generates an interrupt request every 0.5 seconds. high-speed mode is useful for timing events for program debugging sequences. fx = system clock (assumed to be 4.19 mhz) fw = watch timer frequency 8 irqw gnd fx/128 fw 32.768 khz buz fw/2 7 fw/2 14 enable / disable fw/16 fw/8 fw/4 fw/2 selector circuit clock selector mux frequency dividing circuit p2.3 latch pm2.3 wmod.7 wmod.5 wmod.4 wmod.2 wmod.1 0 0 0 figure 11-4. watch timer circuit diagram
timers and timer/counters s3c7 524/c7528/p7528/c7534/c7538/p7538 11? 24 watch timer mode register (wmod) the watch timer mode register wmod is used to select specific watch timer operations. it is 8-bit write-only addressable. f88h ?0? wmod.2 wmod.1 ?0? f89h wmod.7 "0" wmod.5 wmod.4 wmod settings control the following watch timer functions: ? watch timer speed control (wmod.1) ? enable/disable watch timer (wmod.2) ? buzzer frequency selection (wmod.4 and wmod.5) ? enable/disable buzzer output (wmod.7) table 11-8. watch timer mode register (wmod) organization bit name values function address wmod.7 0 disable buzzer (buz) signal output 1 enable buzzer (buz) signal output wmod.6 0 always logic zero f89h wmod.5 ? .4 0 0 fw/16 buzzer (buz) signal output (2 khz) 0 1 fw/8 buzzer (buz) signal output (4 khz) 1 0 fw/4 buzzer (buz) signal output (8 khz) 1 1 fw/2 buzzer (buz) signal output (16 khz) wmod.3 0 always logic zero wmod.2 0 disable watch timer; clear frequency dividing circuits 1 enable watch timer f88h wmod.1 0 normal mode; sets irqw to 0.5 seconds 1 high-speed mode; sets irqw to 3.91 ms wmod.0 0 always logic zero note : system clock frequency (fx) is assumed to be 4.19 mhz. 'fw' = watch timer clock frequency.
s3c7524/c7528/p7528/c7534/c7538/p7538 ti mers and timer/counters 11? 25 + + programming tip ? using the watch timer 1. select a 0.5 second interrupt, and 2 khz buzzer enable: bits emb smb 15 ld ea,#08h ld pmg1,ea ; p2.3 ? output mode bitr p2.3 ; clear p2.3 output latch ld ea,#84h ld wmod,ea bits iew 2. sample real-time clock processing method: clock btstz irqw ; 0.5 second check ret ; no, return ? ; yes, 0.5 second interrupt generation ? ? ; incr ement hour, minute, second
s3c7524/c7528/p7528/c7534/c7538/p7538 dt mf generator 12? 1 12 dtmf generator overview the dual-tone multi-frequency (dtmf) output circuit is used to generate 16 dual-tone multiple frequency signals for tone dialing. this function is controlled by the dtmf mode register. by writing the contents of the output latch for dtmf circuit with output instructions, 16 dual or single tones can be output to the dtmf output pin. the tone output frequency is selected by the dtmf mode register. figure 12?1 shows the dtmf block diagram. a frequency of 3.58 mhz is used for dtmf generator. clock output is inhibited when dtmr.0 (dtmf enable bit) goes low. the decoder receives data from the data latch and outputs the result to the row and column tone counter. the row and column tone counter are incremented until new data is latched. when dtmr.0 is logic one, data is latched, and the tone output is changed. table 12?2 shows the 16 available keyboard frequencies. f syclk dtmf mode register mode decorder clock sync circuit tone mode control column counter tone output row counter shift counter d/a converter shift counter internal bus 3.579545 mhz sine wave synthesizer figure 12-1. block diagram of dtmf generator
dtmf generator s3c75 24/c7528/p7528/c7534/c7538/p7538 12? 2 table 12-1. keyboard arrangement 1 2 3 a row1 4 5 6 b row2 7 8 9 c row3 * 0 # d row4 column 1 column 2 column 3 column 4 table 12-2. tone output frequencies input specified frequency (hz) actual frequency (hz) % error row1 697 699.1 + 0.31 row2 770 766.2 ? 0.49 row3 852 847.4 ? 0.54 row4 941 948.0 + 0.74 column 1 1209 1215.7 + 0.57 column 2 1336 1331.7 ? 0.32 column 3 1477 1471.7 ? 0.35 column 4 1633 1645.0 + 0.73 dtmf mode register dtmf output is controlled by the dtmf mode register. bit position dtmr.0 enables or disables dtmf operation. if dtmr.0 = 1, dtmf operation is enabled. programmers should write zeros or ones to bit positions dtmr.4?dtmr.7 according to the keyboard input specification. writing the data in a look-up table is useful for program efficiency. the dtmr register is a write- only register, and is manipulated using 8-bit ram control instructions. v ss v dd figure 12-2. dtmf output wave form
s3c7524/c7528/p7528/c7534/c7538/p7538 dt mf generator 12? 3 table 12-3. dtmf mode register (dtmr) organization bit name setting resulting dtmf function address dtmr.7?.4 0,1 specify according to keyboard fd3h dtmr.3 ? not applicable fd2h dtmr.2?.1 0 0 dual-tone enable 1 0 0 1 single-column tone enable 1 1 single-low tone enable dtmr.0 0 disable dtmf operation 1 enable dtmf operation table 12-4. dtmr.7?dtmr.4 key input control settings dtmr.7 dtmr.6 dtmr.5 dtmr.4 keyboard 0 0 0 0 d 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 0 1 0 1 1 * 1 1 0 0 # 1 1 0 1 a 1 1 1 0 b 1 1 1 1 c
s3c7524/c7528/p7528/c7534/c7538/p7538 el ectrical data 13? 1 13 electrical data in this section, information on s3c7524/c7528 electrical characteristics is presented as tables and graphics. the information is arranged in the following order: standard electrical characteristics ? absolute maximum ratings ? d.c. electrical characteristics ? system clock oscillator characteristics ? i/o capacitance ? a.c. electrical characteristics ? operating voltage range miscellaneous timing waveforms ? a.c timing measurement point ? clock timing measurement at x in and x out ? tcl timing ? input timing for reset ? input timing for external interrupts ? serial data transfer timing stop mode characteristics and timing waveforms ? ram data retention supply voltage in stop mode ? stop mode release timing when i nitiated by reset ? stop mode release timing when initiated by an interrupt request
electrical data s3c7 524/c7528/p7528/c7534/c7538/p7538 13? 2 table 13-1. absolute maximum ratings (t a = 25 c) parameter symbol conditions rating units supply voltage v dd ? ? 0.3 to + 6.5 v input voltage v i1 all i/o ports ? 0.3 to v dd + 0.3 v output voltage v o ? ? 0.3 to v dd + 0.3 v output current high i oh one i/o port active ? 15 ma all i/o ports active ? 35 output current low i ol one i/o port active + 30 (peak value) ma + 15 (note) all i/o ports active + 100 (peak value) + 60 (note) operating temperature t a ? ? 40 to + 85 c storage temperature t stg ? ? 65 to + 150 c note: the values for output current low ( i ol ) are calculated as peak value duty . table 13-2. d.c. electrical characteristics (t a = ? 40 c to + 85 c, v dd = 2.0 v to 5.5 v) parameter symbol conditions min typ max units input high voltage v ih1 all input pins except those specified below for v ih2 ? v ih3 0.7 v dd ? v dd v v ih2 ports 1, 3, 6, 7, and reset 0.8 v dd v dd v ih3 x in and x out v dd ? 0.1 v dd input low voltage v il1 all input pins except those specified below for v il2 ?v il3 ? ? 0.3 v dd v v il2 ports 1, 3, 6, 7, and reset 0.2 v dd v il3 x in and x out 0.1
s3c7524/c7528/p7528/c7534/c7538/p7538 el ectrical data 13? 3 table 13-2. d.c. electrical characteristics (continued) (t a = ? 40 c to + 85 c, v dd = 2.0 v to 5.5 v) parameter symbol conditions min typ max units output high voltage v oh i oh = ? 1 ma ports except 1 v dd ? 1.0 ? ? v output low voltage v ol1 v dd = 4.5 v to 5.5 v i ol = 15 ma, ports 4 and 5 only ? 0.4 2 v v dd = 2.0 to 5.5 v, i ol = 1.6ma ? ? 0.4 v ol2 v dd = 4.5 v to 5.5 v i ol = 4 ma, all out ports except 4,5 ? ? 2 v v dd = 2.0 to 5.5 v, i ol = 1.6ma ? ? 0.4 input high leakage current i lih1 v i = v dd all input pins except those specified below ? ? 3 a i lih2 v i = v dd x in and x out 20 input low leakage current i lil1 v i = 0 v all input pins except below and reset ? ? ? 3 a i lil2 v i = 0 v x i n and x out only ? 20 output high leakage current i loh v o = v dd all out pins ? ? 3 a output low leakage current i lol v o = 0 v x in and x out only ? ? ? 3 a pull-up resistor r l1 v dd = 5 v; v i = 0 v except reset 25 47 100 k w v dd = 3 v 50 95 200 r l2 v dd = 5 v; v i = 0 v; reset 100 220 400 v dd = 3 v 200 450 800
electrical data s3c7 524/c7528/p7528/c7534/c7538/p7538 13? 4 table 13-2. d.c. electrical characteristics (concluded) (t a = ? 40 c to + 85 c, v dd = 2.0 v to 5.5 v) parameter symbol conditions min typ max units supply current (1) i dd1 (dtmf on) run mode; v dd = 5 v 10% (2) 3.58 mhz crystal oscillator, c1 = c2 = 22 pf ? 2.9 5.0 ma v dd = 3 v 10% 1.6 3.0 i dd2 run mode; v dd = 5 v 10% 6.0 mhz ? 2.6 8.0 ma (dtmf off) crystal oscillator, c1 = c2 = 22 pf 3.58 mhz 1.8 4.0 v dd = 3 v 10% 6.0 mhz 1.8 4.0 3.58 mhz 1.2 2.3 i dd 3 idle mode; = v dd = 5 v 10% 6.0 mhz ? 0.7 2.5 ma crystal oscillator, c1 = c2 = 22 pf 3.58 mhz 0.6 1.8 v dd = 3 v 10% 6.0 mhz 0.3 1.5 3.58 mhz 0.2 1.0 i dd4 stop mode; v dd = 5 v 10% ? 0.01 3 a stop mode; v dd = 3 v 10% 0.01 2 row tone level v row v dd = 5 v 10% v dd = 3 v 10% v dd = 2 v rl = 5k w ? 16.0 ? 14.0 ? 11.0 dbv ratio of column to row tone db cr v dd = 5 v 10% v dd = 3 v 10% v dd = 2 v rl = 5k w 1 2 3 distortion (dual tone) thd v dd = 5 v 10% v dd = 3 v 10% v dd = 2 v rl = 5k w , 1mhz band ? ? 5 % notes 1. d.c. electrical values f or supply current (i dd1 to i dd3 ) do not include current drawn through internal pull-up registers. 2. for d.c. electrical values , the power control register (pcon) must be set to 0011b.
s3c7524/c7528/p7528/c7534/c7538/p7538 el ectrical data 13? 5 table 13-3. main system clock oscillator characteristics (t a = ? 40 c + 85 c, v dd = 2.0 v to 5.5 v) oscillator clock configuration parameter test condition min typ max units ceramic oscillator xin xout c1 c2 oscillation frequency (1) v dd = 2.7 v to 5.5 v 0.4 ? 6.0 mhz v dd = 2.0 v to 5.5 v 0.4 ? 4.2 stabilization time (2) v dd = 3 v ? ? 4 ms crystal oscillator xin xout c1 c2 oscillation frequency (1) v dd = 2.7 v to 5.5 v 0.4 ? 6.0 mhz v dd = 2.0 v to 5.5 v 0.4 ? 4.2 stabilization time (2) v dd = 3 v ? ? 10 ms external clock xin xout x in input frequency (1) v dd = 2.7 v to 5.5 v 0.4 ? 6.0 mhz v dd = 2.0 v to 5.5v 0.4 ? 4.2 x in input high and low level width (t xh , t xl ) ? 83.3 ? 1250 ns notes 1. oscillation frequency and x in input frequency data are for oscillator characteristics only. 2. stabilization time is the interval required for oscillating stabilization after a power-on occurs, or when stop mode is terminated.
electrical data s3c7 524/c7528/p7528/c7534/c7538/p7538 13? 6 table 13-4. input/output capacitance (t a = 25 c, v dd = 0 v ) parameter symbol condition min typ max units input capacitance c in f = 1 mhz; unmeasured pins are returned to v ss ? ? 15 pf output capacitance c out ? ? 15 pf i/o capacitance c io ? ? 15 pf table 13-5. a.c. electrical characteristics (t a = ? 40 c to + 85 c, v dd = 2.0 v to 5.5 v) parameter symbol conditions min typ max units instruction cycle time (1) t cy v dd = 2.7 v to 5.5 v 0.67 ? 64 s v dd = 2.0 v to 5.5 v 0.95 tcl0, tcl1 input frequency f ti0 , f ti1 v dd = 2.7 v to 5.5 v 0 ? 1.5 mhz v dd = 2.0 v to 5.5v 1 mhz tcl0, tcl1 input high, low width t tih0 , t til0 t tih1 , t til1 v dd = 2.7 v to 5.5 v 0.48 ? ? s v dd = 2.0 v to 5.5 v 1.8 interrupt input high, low width t inth , t intl int0, int1, int2, int4, ks0?ks7 10 ? ? s reset input low width t rsl input 10 ? ? s
s3c7524/c7528/p7528/c7534/c7538/p7538 el ectrical data 13? 7 cpu clock = oscillator frequency x 1/n (n = 4, 8, 64) supply voltage (v) 1.05 m hz 1.5 mhz 15.625 khz cpu clock 1 2 3 4 5 6 7 6 mhz 4.2 mhz 2.7 v main osc. freq. figure 13-1. standard operating voltage range table 13-6. ram data retention supply voltage in stop mode (t a = ? 40 c to + 85 c) parameter symbol conditions min typ max unit data retention supply voltage v dddr ? 1.5 ? 5.5 v data retention supply current i dddr v dddr = 1.5 v ? 0.1 10 a release signal set time t srel ? 0 ? ? s oscillator stabilization wait time (1) t wait released by reset released by interrupt ? 2 17 /fx (2) ? ms ms notes 1. during oscillator stabilization wait time, all cpu operations must be stopped to avoid instability during oscillator start-up. 2. use the basic timer mode register (bmod) interval timer to delay execution of cpu instructions during the wait time.
electrical data s3c7 524/c7528/p7528/c7534/c7538/p7538 13? 8 timing waveforms t srel t wait v dd reset execution of stop instruction v dddr data retention mode stop mode internal reset operation idle mode operating mode figure 13-2. stop mode release timing when initiated by reset reset v dd execution of stop instruction v dddr data retention mode stop mode t wait t srel idle mode normal operating mode power-down mode terminating signal (interrupt request) figure 13-3. stop mode release timing when initiated by interrupt request
s3c7524/c7528/p7528/c7534/c7538/p7538 el ectrical data 13? 9 timing waveforms (continued) 0.8 v dd 0.2 v dd 0.8 v dd 0.2 v dd measurement points figure 13-4. a.c. timing measurement points (except for x in ) x in t xl t xh 1 / f x v dd - 0.1 v 0.1 v figure 13-5. clock timing measurement at x in tcl t til t tih 1 / f ti 0.8 v dd 0.2 v dd figure 13-6. tcl timing
electrical data s3c7 524/c7528/p7528/c7534/c7538/p7538 13? 10 t rsl reset 0.2 v dd figure 13-7. input timing for reset reset signal int0, 1, 2, 4 k0 to k7 t intl t inth 0.8 v dd 0.2 v dd figure 13-8. input timing for external interrupts and quasi-interrupts
s3c7524/c7528/p7528/c7534/c7538/p7538 mechanical data 1 4 ? 1 1 4 mechanical data this section contains the following information about the device package: ? package dimensions in millimeters ? pad diagram ? pad/pin coordinate data table note : dimensions are in millimeters. 39.50 max 39.10 0 .20 0.50 0.10 1.78 (1.77) 0.51 min 3.30 0.30 3.50 0.20 5.08 max 42-sdip-600 0-15 1.00 0.10 0.25 + 0.10 - 0.05 15.24 14.00 0 .20 #42 #22 #21 #1 figure 14- 1. 42 -sdip- 6 00 package dimensions
mechanical data s3c7524/c7528/p7528/c7534/c7538/p7538 14 ? 2 44-qfp-1010b #44 note : dimensions are in millimeters. 10.00 0.20 13.20 0.30 10.00 0.20 13.20 0.30 #1 0.35 + 0.10 - 0.05 0.80 0.10 max 0.80 0.20 0.05 min 2.05 0.10 2.30 max 0.15 + 0.10 - 0.05 0-8 0.15 max (1.00) figure 14-2 . 44 - qfp - 1010b package dimensions
s3c7524/c7528/p7528/c7534/c7538/p7538 mechanical data 1 4 ? 3 note : dimensions are in millimeters. 27.88 max 27.48 0 .20 (1.30) 30-sdip-400 8.94 0 .20 #30 #1 0.56 0.10 1.12 0.10 3.81 0.20 5.21 max 1.778 0.51 min 3.30 0.30 #16 #15 0-15 0.25 + 0.10 - 0.05 10.16 figure 14-3 . 30 - sdip - 400 package dimensions
mechanical data s3c7524/c7528/p7528/c7534/c7538/p7538 14 ? 4 32-sop-450a 20.30 max 19.90 0 .20 #17 #16 0-8 0.25 + 0.10 - 0.05 11.43 8.34 0.20 0.90 0.20 0.05 min 2.00 0.10 2.20 max 0.10 max 1.27 note : dimensions are in millimeters. 12.00 0 .30 #32 #1 (0.43) 0.40 0.10 figure 14-4 . 32-sop-450a package dimensions
s3c7524/c7528/p7528/c7534/c7538/p7538 s3 p7528/p7538 otp 1 5? 1 1 5 s3p7528/p7538 otp overview the s3p7528/p7538 single-chip cmos microcontroller is the otp (one time programmable) version of the s3c7524/c7528/c7534/c7538 microcontroller. it has an on-chip eprom instead of masked rom. the eprom is accessed by a serial data format. the s3p7528/p7538 is fully compatible with the s3c7528/c7538, both in function and in pin configuration. because of its simple programming requirements, the s3p7528/p7538 is ideal for use as an evaluation chip for the s3c7528/c7538. p1.0 / int0 p1.1 / int1 p1.2 / int2 p1.3 / int4 p2.0 / tclo0 p2.1 / tclo1 p2.2 / clo p2.3 / buz sdat / p3.0 / tcl0 sclk / p3.1 / tcl1 v dd / v dd v ss / v ss x out x in v pp / test p4.0 / btco p4.1 reset reset / reset p3.2 p3.3 p4.2 p9.2 p9.1 p9.0 dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 p6.1 / ks1 p6.0 / ks0 p5.3 p5.2 p5.1 p5.0 p8.3 p8.2 p8.1 p8.0 p4.3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 note: the bold words indicate otp pin names. s3p7528 (42-sdip-600) figure 15-1. s3p7528 pin assignments (42-sdip)
s3p7528/p7538 otp s3c7524/c7528/p7528/c7534/c7538/p7538 15? 2 v ss / v ss x out x in v pp / test p4.0 / btco p4.1 reset reset / reset p4.2 nc p4.3 p5.0 p5.1 p5.2 p5.3 p6.0 / ks0 p6.1 / ks1 v dd / v dd p3.1 / tcl1 / sclk p3.0 / tcl0 / sdat p2.3 / buz p2.2 / clo p2.1 / tclo1 p2.0 / tclo0 p1.0 / int0 nc dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (32-sop-405a) 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 ks57p5308 figure 15-2. s3p7528 pin assignments (44-qfp)
s3c7524/c7528/p7528/c7534/c7538/p7538 s3 p7528/p7538 otp 1 5? 3 v ss / v ss x out x in v pp / test p4.0 / btco p4.1 reset reset / reset p4.2 p4.3 p5.0 p5.1 p5.2 p5.3 p6.0 / ks0 p6.1 / ks1 v dd / v dd p3.1 / tcl1 / sclk p3.0 / tcl0 / sdat p2.3 / buz p2.2 / clo p2.1 / tclo1 p2.0 / tclo0 p1.0 / int0 dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 (30-sdip-400) s3c7538 figure 15-3. S3P7538 pin assignments (30-sdip)
s3p7528/p7538 otp s3c7524/c7528/p7528/c7534/c7538/p7538 15? 4 v ss / v ss x out x in v pp / test p4.0 / btco p4.1 reset reset / reset p4.2 nc p4.3 p5.0 p5.1 p5.2 p5.3 p6.0 / ks0 p6.1 / ks1 v dd / v dd p3.1 / tcl1 / sclk p3.0 / tcl0 / sdat p2.3 / buz p2.2 / clo p2.1 / tclo1 p2.0 / tclo0 p1.0 / int0 nc dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (32-sop-405a) 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 S3P7538 figure 15-4. S3P7538 pin assignments (32-sop)
s3c7524/c7528/p7528/c7534/c7538/p7538 s3 p7528/p7538 otp 1 5? 5 table 15-1. s3p7528 pin descriptions used to read/write the eprom main chip during programming pin name pin name pin no. i/o function p3.0 sdat 9 (3) i/o serial data pin. output port when reading and input port when writing. can be assigned as a input / push-pull output port. p3.1 sclk 10 (4) i/o serial clock pin. input only pin. test v pp (test) 15 (9) i power supply pin for eprom cell writing (indicates that otp enters into the writing mode). when 12.5 v is applied, otp is in writing mode and when 5 v is applied, otp is in reading mode. (option) reset reset 18 (12) i chip initialization v dd / v ss v dd / v ss 11/12 (5/6) i logic power supply pin. v dd should be tied to +5 v during programming. note: parentheses indicate pin numbers of 44 qfp package. table 15-2. S3P7538 pin descriptions used to read/write the eprom main chip during programming pin name pin name pin no. i/o function p3.0 sdat 28 (30) i/o serial data pin. output port when reading and input port when writing. can be assigned as a input / push-pull output port. p3.1 sclk 29 (31) i/o serial clock pin. input only pin. test v pp (test) 4 (4) i power supply pin for eprom cell writing (indicates that otp enters into the writing mode). when 12.5 v is applied, otp is in writing mode and when 5 v is applied, otp is in reading mode. (option) reset reset 7 (7) i chip initialization v dd / v ss v dd / v ss 30/1 (32/1) i logic power supply pin. v dd should be tied to +5 v during programming. note: parentheses indicate pin numbers of 32 sdip package.
s3p7528/p7538 otp s3c7524/c7528/p7528/c7534/c7538/p7538 15? 6 table 15-3. comparison of s3p7528 and s3c7528 features characteristic s3p7528 s3c7528 program memory 8 k byte eprom 8 k byte mask rom operating voltage (v dd ) 2.0 v to 5.5 v 2.0 v to 5.5 v otp programming mode v dd = 5 v, v pp (test) = 12.5 v ? pin configuration 42 sdip / 44 qfp 42 sdip / 44 qfp eprom programmability user program 1 time programmed at the factory table 15-4. comparison of S3P7538 and s3c7538 features characteristic S3P7538 s3c7538 program memory 8 k byte eprom 8 k byte mask rom operating voltage (v dd ) 2.0 v to 5.5 v 2.0 v to 5.5 v otp programming mode v dd = 5 v, v pp (test) = 12.5 v ? pin configuration 30 sop / 32 sop 30 sop / 32 sop eprom programmability user program 1 time programmed at the factory operating mode characteristics when 12.5 v is supplied to the v pp (test) pin of the s3p7528, the eprom programming mode is entered. the operating mode (read, write, or read protection) is selected according to the input signals to the pins listed in table 15-3 below. table 15-5. operating mode selection criteria v dd vpp (test) reg/ mem mem address (a15-a0) r/ w w mode 5 v 5 v 0 0000h 1 eprom read 12.5v 0 0000h 0 eprom program 12.5v 0 0000h 1 eprom verify 12.5v 1 0e3fh 0 eprom read protection note: "0" means low level; "1" means high level.
s3c7524/c7528/p7528/c7534/c7538/p7538 s3 p7528/p7538 otp 1 5? 7 start address= first location v dd =5v, v pp =12.5v x = 0 program one 1ms pulse increment x x = 10 verify 1 byte last address v dd = v pp = 5 v compare all byte device passed increment address verify byte device failed pass fail no fail yes fail no figure 15-5. otp programming algorithm
s3c7524/c7528/p7528/c7534/c7538/p7538 development tools 16- 1 16 development tools overview samsung provides a powerful and easy-to-use development support system in turnkey form. the development support system is configured with a host system, debugging tools, and support software. for the host system, any standard computer that operates with ms-dos as its operating system can be used. one type of debugging tool including hardware and software is provided: the sophisticated and powerful in-circuit emulator, smds2+, for s3c7, s3c9, s3c8 families of microcontrollers. the smds2+ is a new and improved version of smds2. samsung also offers support software that includes debugger, as s embler, and a program for setting options. shine samsung host interface for in - c ircuit emulator, shine, is a multi-window based debugger for smds2+. shine provides pull-down and pop-up menus, mouse support, function/hot keys, and context-sensitive hyper-linked help. it has an advanced, multiple-windowed user interface that emphasizes ease of use. each window can be sized, moved, scrolled, highlighted, added, or removed completely. sama assembler the samsung arrangeable microcontroller (sam) assembler, sama, is a universal assembler, and generates object code in standard hexadecimal format. assembled program code includes the object code that is used for rom data and required smds program control data. to assemble programs, sama requires a source file and an auxiliary definition (def) file with device specific information. sasm 57 the sasm 57 is an relocatable assembler for samsung's s3c7 -series microcontrollers. the sasm 57 takes a source file containing assembly language statements and translates into a corresponding source code, object code and comments. the sasm 57 supports macros and conditional assembly. it runs on the ms-dos operating system. it produces the relocatable object code only, so the user should link object file. object files can be linked with other object files and loaded into memory. hex2rom hex2rom file generates rom code from hex file which has been produced by assembler. rom code must be needed to fabricate a microcontroller which has a mask rom. when generating the rom code (.obj file) by hex2rom, the value 'ff' is filled into the unused rom area upto the maximum rom size of the target device automatically. target boards target boards are available for all s3c7 -series microcontrollers. all required target system cables and adapters are included with the device-specific target board. otp s one time programmable microcontroller ( otp) for the s3c7524/c7528/c7534/c7538 microcontroller and otp programmer (gang) are now available.
development tools s3c7524/c7528/p752 8/c7534/c7538/p7538 16- 2 ram break/ display unit target application system probe adapter prom/mtp writer unit trace/timer unit sam4 base unit power supply unit pod rs-232c ibm-pc at or compatible bus smds2+ tb7524/8 tb7534/8/3 target board eva chip figure 16-1. smds product configuration (smds2+)
s3c7524/c7528/p7528/c7534/c7538/p7538 development tools 16- 3 tb7524/528/534/538/533 target board the tb7524/528/534/538/533 target board is used for the s3c7524/c7528/p7528/c7534/c7538/p7538 microcontroller. it is supported by the smds2+ development system. sm1249a tb7524/8 tb7534/8/3 external triggers ch1 ch2 off on to user_vcc rese + stop + idle 1 25 100-pin connector 74hc11 4 0-pin connector 1 40 20 21 j10 bias v lc0 v lc1 v lc2 100 qfp s3e750 eva chip 1 3 xtal mds xi figure 16-2. tb7524/528/534/538/533 target board configuration
development tools s3c7524/c7528/p752 8/c7534/c7538/p7538 16- 4 table 16-1. power selection settings for tb7524/528/534/538/533 'to user_vcc' settings operating mode comments to user_vcc on off v cc target system smds2/smds2+ v ss v cc tb7524/8 tb7534/8/3 the smds2 /smds2+ supplies v cc to the target board (evaluation chip) and the target system. to user_vcc on off v cc target system smds2/smds2+ v ss externa l v cc tb7524/8 tb7534/8/3 the smds2 /smds2+ supplies v cc only to the target board (evaluation chip). the target system must have its own power supply. table 16-2. main-clock selection settings for tb7524/528/534/538/533 sub clock setting operating mode comments xtal mds xi x i n smds2/ smds2+ eva chip s3e7520 x out no connection 100 pin connector set the xi switch to ?mds? when the target board is connected to the smds2/smds2+. xtal mds xi x in target board eva chip s3e7520 x out xtal set the xi switch to ?xtal? when the target board is used as a standalone unit, and is not connected to the smds2/smds2+.
s3c7524/c7528/p7528/c7534/c7538/p7538 development tools 16- 5 table 16-4. using single header pins as the input path for external trigger sources target board part comments external triggers ch1 ch2 connector from external trigger sources of the application system you can connect an external trigger source to one of the two external trigger channels (ch1 or ch2) for the smds2+ breakpoint and trace functions. idle led this led is on when the evaluation chip ( s3e7520 ) is in idle mode. stop led this led is on when the evaluation chip ( s3e7520 ) is in stop mode. j101 4 0-pin dip connector p1.0 / int0 p1.1 / int1 p1.2 / int2 p1.3 / int4 p2.0 / tclo0 p2.1 / tclo1 p2.2 / clo p2.3 / buz p3.0 / tcl0 p3.1 / tcl1 v dd v ss test p4.0 / btco p4.1 reset p3.2 p3.3 p4.2 p4.3 p9.2 p9.1 p9.0 dtmf p7.3 / ks7 p7.2 / ks6 p7.1 / ks5 p7.0 / ks4 p6.3 / ks3 p6.2 / ks2 p6.1 / ks1 p6.0 / ks0 p5.3 p5.2 p5.1 p5.0 p8.3 p8.2 p8.1 p8.0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 figure 16-3. 4 0-pin connector s for tb7524/528/534/538/533
development tools s3c7524/c7528/p752 8/c7534/c7538/p7538 16- 6 1 40 20 21 40 -pin dip connector target board target system j101 target cable for 40 pin connector part name: ap42sd-k order code: sm6527 1 42 21 22 figure 16-4. tb575204a/5208a adapter cable for 42-sdip package ( s3c7524/c7528/p7528 ) 1 40 20 21 40 -pin dip connector target board target system j101 target cable for 40 pin connector part name: ap30sd-b order code: sm6521 1 30 15 16 figure 16-5. tb575304a/5308a adapter cable for 30-sdip package ( s3c7534/c7538/p7538 )


▲Up To Search▲   

 
Price & Availability of S3P7538

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