– 16 KByte of Flash Memory
– 128 Byte sectors for SoftPartition
– 100,000 endurance cycles (typical)
– 100 years data retention
– Fast Write:
- Chip-Erase: 70 ms (typical)
- Sector-Erase: 18 ms (typical)
- Byte-Program: 60 µs (typical)
– In-Application Programming (IAP)
Advance Information
• External Host Programming Mode for
Programmer Support
– JEDEC Standard Command Sets
• 352 Byte On-Chip SRAM
• In-System Programming (ISP) Support
through Firmware
• IR Input Pin for Learning Mode
• Carrier Modulator Transmitter
– Supports Baseband, Pulse Length Modulator
(PLM), and Frequency Shift Keying (FSK)
• Core Timer / Counter
– 14-stage multifunctional ripple counter
– Includes timer overflow, POR, RTI, and CWT
• External Reset Input and Low Power Pins
•Power Management
– Hardware enable bits programmable by software
for entering STOP and IDLE modes
• Package Available
– 28-lead SOIC
PRODUCT DESCRIPTION
The SST65P542R is a member of SST’s 8-bit application
specific microcontroller family targeted for IR remote controller applications.
The SST65P542R microcontroller provides high functionality to infrared remote controller products. The device offers
flexibility to store different remote control configurations for
controlling multiple appliances. The configurations are
either programmed at the factory during the manufacturing
process or downloaded through firmware.
Using SST’s SuperFlash nonvolatile memory technology,
the SST65P542R enhances the functionality and reduces
the cost of conventional universal remote controller devices
by integrating multiple functions of a remote controller system in a single chip solution. The built-in LED I/O ports can
directly drive LED indicators. The IR transmitter port drives
signals to the infrared transmitter, which, in turn, remotely
controls the appliances.
The SoftPartition architecture allows seamless flash memory partitioning of the program code, protocol tables, and
user data in the small granularity of 128 Byte sectors. The
small sector size and fast Write capability of the device
greatly decreases the time and power when altering the
contents of the flash memory.
The highly reliable, patented SuperFlash technology
provides significant advantage over conventional flash
memory technology. These advantages translate into
significant cost saving and reliability benefits for the
customers.
PB[7:0]I/OPor t B: The state of any pin in Port B is software programmable and every line is configured as an
PC[3:0]I/OPort C: Every pin in Port C is a high-current pin and its state is software programmable. All lines
IROOIRO: Suitable for driving IR LED biasing logic, the IRO pin is the high-current source and sink out-
LPRST#ILow-Power Reset: An active-low pin, LPRST# function sets MCU to low-power reset mode. Once the
RST#IReset: By setting the RST# pin low, the device is reset to a default state. An internal Schmitt trig-
OSC1IOscillator 1,2: These 2 pins interface with external oscillator circuits. A crystal
OSC2Oresonator, a ceramic resonator, or an external clock signal can be used.
IRQ#IInterrupt Request: The IRQ# is negative edge-sensitive triggered. An internal Schmitt trigger is
V
DD
V
SS
1. I = Input, O = Output
1
Port A: The state of any pin in Port A is software programmable and every line is configured as
an input during any reset.
input during any reset. Each I/O line contains a programmable interrupt/pull-up for keyscan.
are configured as inputs during any reset.
put of the carrier modulator transmitter subsystem. Default state is low after any reset.
device is in low-power reset mode, it is held in reset with all processor clocks and crystal oscillator halted.
An internal Schmitt trigger is included in the LPRST# pin to improve noise immunity.
ger is included in the RST# pin to improve noise immunity.
included in the IRQ# pin to improve noise immunity.
The SST65P542R has a total of 64 KByte of addressable memory space. A memory map is located in Figure 3-1.
The on-chip memory consists of 32 Bytes of I/O registers, 352 Bytes of SRAM, 16 KByte of user flash memory and
128 Bytes of user vectors.
The 32 Bytes of I/O registers occupy address locations from 0000H to 001FH that include general purpose I/O registers, the SuperFlash Function Register, and on-chip peripheral control registers.
PA[7:0]Port A data register bit 0 to 7. These bits are for both reading and writing. Write the data to this
register will output data to port A pins when it’s in output mode. If the pins are set to input mode,
only the output data register is updated, port A pins are tri-stated. Reading the data from this
register will read the state of port A pins when set in input mode. If the pins are set to output
mode, it reads the output data register. See Table 3-2 for details. For a detailed explanation of
each parallel I/O port, please refer to Section 4.0, “Parallel Input/Output Ports” on page 20.
PORT B Data Register (PORTB)
Location
0001H
76543210
PB7PB6PB5PB4PB3PB2PB1PB0
SymbolFunction
PB[7:0]Port B data register bit 0 to 7. These bits are for both reading and writing. Writing data to this
register will output data to port B pins when it’s in output mode. If the pins are set to input mode,
only the output data register is updated, port B pins are tri-stated. Reading the data from this
register will read the state of port B pins when set in input mode. If the pins are set to output
mode, it reads the output data register. See Table 3-2 for details.
Remote Controller MCU
SST65P542R
Advance Information
Reset Value
00H
Reset Value
00H
PORT C Data Register (PORTC)
Location
0003H
76543210
----DDRC3DDRC2DDRC1DDRC0
SymbolFunction
PC[3:0]Port C data register bit 0 to 3. These bits are for both reading and writing. Writing data to this
register will output data to port C pins when it’s in output mode. If the pins are set to input mode,
only output data register is updated, port C pins are tri-stated. Reading data from this register will
read the state of port C pins when set in input mode. If the pins are set to output mode, it reads
the output data register. See Table 3-2 for details.
TABLE3-2: I/O PIN FUNCTIONSAS GENERAL PURPOSE I/O
AccessDDRA, DDRB, DDRCModeI/O Pin Functions
Write0InputData is written into the output data register.
Write1OutputData is written into the output data register and
CTOFCore timer overflow bit. CTOF is a real-only status bit, this bit is set when the 8-bit ripple counter
rolls over from FFH to 00H. Writing to this bit has not effect. Reset clears CTOF. CTOF set to
zero by writing a one to TOFC.
RTIFReal-time Interrupt bit. RTIF is a read-only status bit. Writing has no effect on this bit. Reset
clears RTIF. The real time interrupt circuit consists of a divider and a one-of-four selector. The
input clock frequency that drives the RTI circuit is E/2
allows a maximum interrupt period of 16 ms at the internal peripheral clock rate of 2.048 MHz.
0: Writing a one to RTFC clears the RTIF.
1: When the output of the chosen (one-of-four selector) stage goes active.
TOFETimer overflow enable bit. TOFE is statuses bit for both read and write. Reset clears this bit.
0: If the CTOF is not set or no timer overflow occurs.
1: If the CTOF is set and a CPU interrupt request is generated
RTIEReal time interrupt enable bit. RTIE is a status bit for both read and write. Reset clears this bit.
0: If the RTIF is not set.
1: If the RTIF is set and a CPU interrupt request is generated.
TOFCTimer overflow flag clear bit. This bit is for writing only.
0: Writing a zero has no effect on the CTOF bit. This bit always reads as zero.
1: When a one is written to this bit, CTOF is cleared.
RTFCReal time interrupt flag clear bit. This bit is for writing only.
0: Writing a zero has no effect on the RTIF bit. This bit always reads as zero.
1: When a one is written to this bit, RTIF is cleared.
RT[1:0]Real time interrupt rate select bit. These two bits select one of four taps from the interrupt logic.
See Table 3-4. Reset sets these two bits, which selects the lowest periodic rate and gives the
maximum. Care should be taken when altering RT0 and RT1 if the timeout period is imminent or
uncertain. The CWT should be cleared before changing RTI taps. If the selected tap is modified
during a cycle in which the counter is switching, an RTIF could be missed or an additional one
could be generated.
Reset Value
03H
12
with three additional divider stages that
TABLE3-4: RTI AND CWT RATESAT 4.096 MHZ OSCILLATOR, PRESCALER=1
RTI RateRT1-RT0Minimum CWT RatesMaximum CWT Rates
2ms2
4ms213/E01(216-213)/E28ms(216)/E32ms
8ms214/E10(217-214)/E56ms(217)/E64ms
16ms2
1. E is the internal peripheral clock frequency and E = F
Therefore, when SFFR=22H, the MCU will perform the Sector-Erase, SFFR=44H, the MCU will perform the ChipErase, and SFFR=88H, the MCU will perform the Byte-Program. For a detailed explanation of MCU flash control,
please refer to Section 5.1, “In-Application Programming” on page 21.
76543210
CTD7CTD6CTD5CTD4CTD3CTD2CTD1CTD0
Reset Value
00H
SymbolFunction
CTD[7:0]The core timer counter register bit 0 to bit 7. This is a read only status register in which contains
the current value of the 8-bit ripple counter. This counter is clocked by the CPU clock (E/4) and
can be used for various functions, including a software input capture. Extended time can be
achieved by using the timer overflow function to increment a variable to simulate a 16-bit
counter.
CWT_CLRThis bit is for writing only. For detail explanation of COP Watchdog Timer Reset, please refer to
Section 6.4
0: Write zero to this bit will clear COP watchdog timer.
1: Write one to this bit has no effect. Read this bit will always returns one.
CWT_CLR
Reset Value
01H
Reset Value
01H
Carrier Generator High Data Register1 (CHR1)
Location
0010H
76543210
IROLNCMTPOLPH5PH4PH3PH2PH1PH0
SymbolFunction
IROLNIRO latch control bit. Reading IROLN bit reads the state of the IRO latch. Writing IROLN updates
the IRO latch with the data being written on the negative edge of the internal processor clock
/2). The IRO latch is clear out of reset. Writing to CHR1 to update IROLN will also update
(F
OSC
the primary carrier high data value. In addition, writing to CHR1 to update IROLN will update the
CMT polarity bit. Bit 6 should contain the data of CMTPOL polarity bit.
CMTPOLCMT output polarity bit. This bit controls the polarity of the CMT output (IRO).
0: the CMT output is active high.
1: the CMT output is active low.
PH[5:0]Primary carrier high time data values. When selected, these bits contain the number of input
clocks required to generate the carrier high time periods. When operating in timer mode, CHR1
and CLR1 are always selected. When operating in FSK mode, CHR1, CLR1 and CHR2, CLR2
are alternately selected under control of the modulator. The primary carrier high and low time
values are undefined on the reset. These bits must be written to non-zero values that before the
carrier generator is enabled to avoid spurious results.
Bit 0 to Bit 7 of CHR1 can be used for both reading and writing.
Note:“U” indicates that the bit is unaffected after reset.
IROLPIRO latch control bit. Reading IROLP bit reads the state of the IRO latch. Writing IROLP updates
the IRO latch with the data being written on the negative edge of the internal processor clock
/2). Writing to CLR1 to update IROLP will also update the primary carrier low data value.
(F
OSC
Care should be taken that bits 5-0 of the data to be written to CHR1 or CLR1.
PL[5:0]Primary carrier low time data values. The function of these bits is the same as PH[5:0].
Carrier Generator High Data Register2 (CHR2)
Location
0012H
76543210
--SH5SH4SH3SH2SH1SH0
SymbolFunction
SH[5:0]Secondary carrier high time data values. When selected, these bits contain the number of input
clocks required to generate the carrier high time periods. When operating in time mode, CHR2
and CLR2 is never selected. When operating in FSK mode, CHR2, CLR2 and CHR1, CLR1 are
alternately selected under control of the modulator. The secondary carrier high and low time
values are undefined on the reset. These bits must be written to nonzero values before the
carrier generator is enabled when operating in FSK mode.
Remote Controller MCU
SST65P542R
Advance Information
Reset Value
00UUUUUUb
Reset Value
00UUUUUUb
Carrier Generator Low Data Register2 (CLR2)
Location
0013H
76543210
--SL5SL4SL3SL2SL1SL0
SymbolFunction
SL[5:0]Secondary carrier low time data values. The function of these bits is the same as SH[5:0].
EOCEnd of modulation cycle status bit. This bit is read only. EOC is set when a match occurs
between the contents of the space period register SREG and the down counter. At the end of
cycle, the counter is initialized with the contents of the mark period buffer, MBUFF and SREG is
loaded with the space period buffer SBUFF. This flag is cleared by reading the MCSR followed
by an access of MDR2 or MDR3. EOC is cleared by reset.
0: current modulation cycle in progress.
1: end of modulator cycle has occurred.
DIV2Divide by two scaler bit. The divide-by-two prescaler causes the CMT to be clocked at the bus
rate, when the two times of bus rate is enabled and the F
double buffered, this bit should not be set during a transmission.
0: divide-by-two prescaler disabled.
1: divide-by-two prescaler enabled.
EIMSKExternal Interrupt Mask bit. This bit is used to mask IRQ and keyscan interrupts. This bit is
cleared by reset.
0: IRQ and keyscan interrupts enabled.
1: IRQ and keyscan interrupts disabled.
EXSPCExtended Space Enable bit. For detailed description of extended space operation, please refer
to 65P542R Programming User’s Manual.
0: Extended space disabled.
1: Extended space enabled
BASEBaseband Enable bit. This bit disables the carrier generator and forces the carrier output high for
generation of baseband protocols. When BASE is cleared, the carrier generator is enabled and
the carrier output toggles at the frequency determined by values stored in the carrier data
registers. This bit is cleared by reset. This bit is not double buffered and should not be written
during a transmission.
0: Baseband disabled.
1: Baseband enabled.
MODEMode select bit. This bit is cleared by reset. This bit is not double buffered and should not be
written during a transmission.
0: CMT operates in Time mode.
1: CMT operates in FSK mode.
EOCIEInterrupt enable bit. Interrupt request will be generated when EOC is set and EOCIE is set.
Otherwise, interrupt will not be generated
0: interrupt disabled.
1: interrupt enabled.
MCGENModulator and carrier generator enable bit. Set this bit will initialize the carrier and modulator and
will enable all clocks. Once enabled, the carrier generator and modulator will function
continuously.
0: if this bit is zero, the current modulator cycle will be allowed to expire before all carrier and
modulator clocks are disabled and the modulator output is forced low. To prevent spurious
operation, the user should initialize all data and control registers before enabling the system.
This bit is cleared by reset.
All bits except Bit 0 can be used for both reading and writing.
1: Modulator and carrier generator enabled.
There are 352 Bytes of SRAM available. The SRAM
addresses start from location 0020H to 017FH. The stack
pointer can address 64 Bytes of stack beginning at address
location 00FFH and ending at 00C0H.
3.3 SuperFlash Memory
The SST65P542R has 16 KByte of SuperFlash EEPROM
memory. The memory is organized as 128 sectors of 128
Bytes each. The minimum erasable memory unit is one
sector or 128 Bytes. The user programmable flash memory
occupies the address space from C000H to FF7FH. The
user vector area consists of 128 Bytes starting from
address location FF80H to FFFFH. Address FF80H is for
flash memory read protection. There are five predetermined user vectors from FFF6H through FFFFH dedicated
to the reset and interrupts. Every vector consists of two
bytes to be loaded into program counter for jumping to an
interrupt service routine (ISR). See Table 3-5 for detailed
descriptions of these vectors.
Port A consists of eight individual pins driven by one data
register and one direction register to control the usage of
these pins as either inputs or outputs. All Port A pins are set
to Input mode during any Reset. Software must set the
right direction register first before performing any Read or
Write operation. Any Read operation to the port that was
set as output will read back the data from an internal latch
register instead of the I/O pins. For details, please refer to
Section 3.1 Port A data register and Port A data direction
register.
V
DD
WEAK0
WEAK1
PU0
PU1
4.2 Port B
Port B pins are similar to Port A pins except that each of the
Port B pins has a programmable interrupt generation
option which can be enabled for any Port B pins. Port B
pins have optional programmable pull-ups. There is a
choice between pull-up strengths which could be selected
by PU0 or PU1. For details, please refer to Section 3.1, Port
B Interrupt Control Register and Port B Pull-up Control
Register.
INPRB7
DDRB7
PB7
FIGURE4-1: P
ORT B INTERRUPTAND PULL-UP OPTIONS
4.3 Port C
Port C is a 4-bit bi-directional port (PC3-PC0). Every Port C
pin has high current driving capability. Reset clears the Port
C Data Register and the data direction register, thereby
returning the ports to inputs. For details, please refer to
Section 3.1 Port C data register and Port C data direction
register.
SST65P542R allows “In-Application Programming” (IAP)
to update the user code in the internal 16 Kbyte SuperFlash memory. All Write/Erase operations require setting
the enable bit in the SuperFlash Function Register (SFFR)
located at 000BH. The following sections describe the
operations that the MCU performs to alter the contents of
SuperFlash Memory. For detailed explanation of the SuperFlash Function Register, please refer to Section 3.1.
5.1.1 Chip-Erase
The Chip-Erase operation requires MEREN and MERA
bits to be set to logical “1”. After setting these bits, writing
any data to any address location of the flash memory will
trigger the Chip-Erase operation. The MCU is idle while
SST65P542R is busy doing erases on all memory locations.
5.1.2 Sector-Erase
The Sector-Erase operation requires SEREN and SERA
bits to be set to logical “1”. After setting these bits, writing
any data to the address within the sector to be erased will
erase the data in the sector. The MCU is idle while
SST65P542R is busy doing erase on the sector.
5.1.3 Byte-Program
The Byte-Program operation requires PREN and PROG
bits to be set to logical “1”. After setting these bits, and then
writing the data to the target address to be programmed.
The MCU is idle while SST65P542R is busy doing programming on the byte. Refer to the following summary for
all different functions.
.
TABLE5-1: SFFR C
Command
Writes to
Function
Chip-Erase44HErase the whole flash memory
Sector-Erase22HErase the sector
Byte-Program88HProgram one data byte to
SFFRComment
OMMANDS
addressed by CXXXH
address CXXXH.
Write data to CXXXH
before Byte-Program can be
performed, a Chip-Erase or
Sector-Erase must be issued
to erase the target
programming locations.
T5-1.1 368
5.2 External Host Programming Mode
The external host programming mode is to provide programmer access to the 16KB embedded flash memory of
the SST65P542R. To enter the external host programming
mode, users must follow the setup sequences on the pins
(See Figure 11-1):
1. RY/BY# (pin 12) and POROUT# (pin 13) are output pins. Do not drive.
2. Drive RST# (pin 24) low.
3. Drive LPRST# (pin 21) low.
4. Drive LPRST# (pin 21) high after T
5. Drive PROG_RST (pin 9) low.
6. Drive 9 clocks on TCLKIN. On each clock's rising
edge provide one bit of data on TDIN (pin 19) as
shown in Figure 11-1. The data bits are
“11010011”.
7. Wait for RY/BY# (pin 12) and POROUT# to go
high.
8. Drive at least 24 clocks on TCLKIN.
9. If Read-protect byte is set, then RY/BY# will go
low. Otherwise, RY/BY# will stay high. If RY/BY# is
low, wait for RY/BY# (pin 12) to go high. Now the
SST65P542R is in external host programming
mode and is ready for embedded flash Read or
Write operations.
Now the SST65P542R is in the external host programming
mode and is ready for embedded flash by the external host
Read or Write.
As soon as the RST# is released to ‘1’, chip exits external
host programming mode and then enters user mode.
5.2.1 External Host Mode Read Operation
As shown in Figure 11-2, the Read operation needs two
address setup cycles and one data setup cycle. The low to
high transition on SCLK latches the high order address
A[13:8] from the pin AD[5:0] while MODE[1:0] inputs are
set to 0H; the low to high transition on SCLK latches the
low order address A[7:0] from the pin AD[7:0] while the
MODE[1:0] inputs are set to 3H and setting the signal OE#
to low; the low to high transition on SCLK latches the data
D[7:0] on the pin AD[7:0] while the MODE[1:0] is set to 1H
for reading. After reading the data, the external host should
set the signal OE# to high.
As shown in Figure 11-3, the Write operation needs two
address setup cycles and one data setup cycle. The low to
high transition on SCLK latches the high order address
A[13:8] from the pin AD[5:0] while the MODE[1:0] inputs
are set to 0H; the low to high transition on SCLK latches the
TABLE5-2: E
PinsSymbolType
8-1AD[7:0]I/O
10,20MODE[1:0]IAddress and data bus selection bits in the external host programming mode
11SLCKIClock for latch address and data after entering the external host programming mode
9PROG_RSTIReset signal for the external host programming mode
12RY/BY#OEmbedded flash Ready/Busy output. High is ready
17WE#IWrite Enable: embedded flash memory data write enable, low active
18OE#IOutput Enable: embedded flash memory data out enable, low active
21LPRST#ISignal for entering the external host programming mode
19TDINIData input for entering the external host programming mode
23TCLKINIThis clock will latch TDIN for entering the external host programming mode
22V
26V
1. I = Input; O = Output
XTERNAL HOST PROGRAMMING MODE PIN DESCRIPTIONS
1
Name and Functions
1
Embedded flash memory address and data bus multiplex on AD[7:0] by selecting MODE[1:0]
SS
DD
PWRGround: Circuit ground (0V reference)
PWRPower Supply: Supply voltage (3.2V)
low order address A[7:0] from the pin AD[7:0] while
MODE[1:0] inputs are set to 2H; the low to high transition
on SCLK latches the data D[0:7] from the pin AD[7:0] while
the MODE[1:0] is set to 1H for writing. However, the actual
Write operation to embedded flash memory occurs on the
rising edge of WE#.
T5-2.3 368
5.2.3 External Host Mode Byte-Program Operation
This device is programmed on a byte by byte basis. The
Byte-Program operation consists of three steps. The first
step is the three-byte load sequence for Software Data Protection. The second step is to load the byte address and
the byte data. The third step is the internal Program operation which is initiated after the rising edge of the fourth
WE#. The end of the Byte-Program operation can be
determined by using the RY/BY#. Any commands written
during the Byte-Program operation will be ignored. See
Table 5-4 for the software command sequence, Figure 11-5
for the flash Byte-Program timing diagram, and Figure 11-9
for the Byte-Program command sequence flowchart.
5.2.4 External Host Mode Chip-Erase Operation.
The device provides a Chip-Erase operation, which allows
the user to erase the entire memory array to the ’1’s state.
This is useful when the device must be quickly erased
entirely. The Chip-Erase operation is initiated by executing
a six-byte Software Data Protection command sequence,
the last byte Sequence is the address 1555H with the ChipErase command 10H. The Chip-Erase operation begins
with of the sixth write enable’s (WE#) rising edge. The end
of the Chip-Erase can be determined by using the signal
RY/BY#. Any commands written during the Chip-Erase
operation will be ignored. See Table 5-4 for the software
command sequence, Figure 11-4 for the flash Chip-Erase
timing diagram, and Figure 11-11 for the Chip-Erase command sequence flowchart.
5.2.5 External Host Mode Sector-Erase Operation
The Sector-Erase operation allows the system to erase the
device on a sector-by-sector basis. The sector architecture
is based on uniform sector size of 128 Bytes. The SectorErase operation is initiated by executing a six-byte command sequence for Software Data Protection, the last byte
sequence is the sector address SA with the Sector-Erase
command 30H. The address lines A[13:7] will be used to
determine the sector address. The internal Erase operation
begins after the sixth write enable’s (WE#) rising edge. The
End-of-Erase can be determined by using the signal RY/
BY#. Any commands written during the Sector-Erase operation will be ignored. See Table 5-4 for the software command sequence, Figure 11-5 for the flash Sector-Erase
timing diagram, and Figure 11-11 for the Sector-Erase
command sequence flowchart.
5.2.6 Operation Status Detection - Program Timer
Method
During the Program or Erase operation, the programmer
can use the timer to decide the completion of the operation.
When a Program or Erase operation is started, system setup a timer for T
Erase), and T
SE
(for Byte-Program), T
BP
(for Sector-Erase) time period. After this
(for Chip-
SCE
timer time-out, the operation is completed. See Figure 1110 for Program Timer flowchart.
5.2.7 Operation Status Detection - RY/BY# Method
During the internal Program or Erase operation, the signal
RY/BY# indicates the status of the operation. When the
internal Program or Erase operation is in progress, the signal RY/BY# will be driven low. When the internal Program
or Erase operation is completed, the signal RY/BY# will be
driven high. The device is then ready for the next operation.
See Figure 11-10 for the Program Timer flowchart.
5.2.8 Exiting The External Host Programming Mode
To exit the external host programming mode, the external
host must set the RST# pin to high, and the PROG_RST is
reset to high. The device will exit the host programming and
enter the user mode. The MCU starts execution codes out
of the User Memory Space from the reset vector.
5.2.9 Flash Read Protection
To protect the program code from piracy the flash memory
location 3F80H (user memory address FF80H, flash memory is mapped to C000H through FFFFH, see Figure 3-1)
is evaluated by the internal hardware to determine the read
protect mode state. During this evaluation period, only the
RY/BY# pin is valid and all other pins are blocked. If this
byte is A3H (read protect is active), a Chip-Erase will be
performed by internal hardware before the external host
programming mode is activated. While the Chip-Erase
could take T
(See Table 11-5) as maximum time, users
SCE
may use RY/BY# pin to determine the completion of the
Chip-Erase. If this byte is not A3H (not read protected), all
of the flash memory are visible by using the external host
programming. During the internal Program or Erase operation, the signal RY/ BY# indicates the status of the operation. When the internal Program or Erase operation is in
progress, the RY/BY# will be driven low. When the internal
Program or Erase operation is completed, the RY/BY# will
be driven high. The device is then ready for the next operation. See Figure 11-10 for the Program Timer flowchart.
Note: After writing A3H to the flash read protection
register, the device needs to continue power-on
prior to finishing the programming function.
The programming function may include the
Program-Verify function.
The 65P542R can be reset from five sources: two external inputs and three internal restart conditions.
FIGURE6-1: R
OSC
Data
Address
Address
RST#
LPRST#
ESET BLOCK DIAGRAM
COP
Watchdog
Reset
Illegal
Address
Reset
6.1 External Reset
A low-level input on the RST# pin causes the program
counter to be set to the contents of location FFFEH and
FFFFH (Reset Vector). The MCU is initialized to a known
state. Stack pointer will be reset to FFH. Hardware Reset
is the highest priority input to the chip. An internal Schmitt
trigger is implemented on the RST# input to enhance the
noise immunity.
6.2 External Low Power Reset
The LPRST# is one of the two external sources of a reset.
The signal LPRST# allows the MCU to go into low power
reset mode. All clocks and oscillator to the processor are
halted when the LPRST# is held low. After the LPRST# is
de-asserted (driven high), a delay of 4064 bus clock cycles
is automatically enabled to wait for stable crystal oscillation.
This pin also implements an internal Schmitt trigger to
enhance the noise immunity.
6.3 Internal Power-on and Brown-out
Reset
The internal reset signal will reset the CPU and all
peripheral components. Please refer to Figure 6-1. When
the device is powered up, the internal power-up voltage is
2.0-2.2V. In addition, the internal brown-out voltage is set
Reset
Control
4064 Bus
Clock Cycle
Delay
Internal
Reset
368 ILL F16.2
to 1.9-2.1V. If the voltage is below the threshold values,
the device will reset in order to protect against the inadvertent Write to the flash memory.
6.4 COP Watchdog Timer Reset
SST65P542R has a COP (Computer Operating Properly)
watchdog timer for monitoring the proper operations of
MCU. In normal operation, clearing the COP watchdog
timer is executed by software within a preset period of time
to avoid reaching time-out condition. To clear the COP
watchdog timer, software write “0” to location 3FF0H. The
COP Watchdog Reset is asserted and resets the MCU
when the time-out condition occurs. The COP watchdog
timer is disabled during any external reset. To enable CWT,
write logical “0” to CWT control register (000DH). Refer to
the SST65P542R Programming User’s Manual for more
information.
6.5 Illegal Address Reset
An illegal address reset is generated when the MCU
attempts to fetch an instruction from I/O address space
(0000H to 001FH). Those addresses are reserved for I/O
registers only.
SST65P542R accepts five sources of interrupts with highest to lowest priority: Software Interrupt, External Interrupts
(IRQ# pin / Port B), CMT Interrupt, and Core Timer Interrupt. Whenever multiple interrupt requests are active at the
same time, the higher priority one will be serviced first. All
interrupts are maskable except Software Interrupt which is
generated by executing SWI instruction. To mask interrupts, set the interrupt mask bit of Process Status Word
(PSW). Before serving the interrupt, the MCU registers are
pushed onto the stack in the sequence of PCL, PCH, IDX,
ACC, PSW. The interrupt service routine should clear the
source of interrupt before exiting. By executing RTI instruction, the stored MCU registers are popped from the stack
and the program resumes from the interrupted location.
7.1 Software Interrupt
The SWI instruction causes MCU to load the contents
of memory locations FFFCH and FFFDH into Program
Counter regardless of the interrupt mask bit in PSW
register.
7.2 External Interrupts
Upon completion of the current instruction, the MCU
responds to the interrupt request that is latched internally.
IRQ# must be asserted (low) for at least one T
Following the completion of the current instruction, the
interrupt latch is tested. If both interrupt mask bit (I bit) in the
PSW is clear and the interrupt request is pending, the interrupt service routine is entered. An external resistor to V
is required by the IRQ# input for wired-AND operation.
(125 ns).
ILIH
DD
The external interrupts, IRQ# pin and Port B interrupts are
edge-sensitive and asserted on the falling edge of the pins.
The Port B Interrupt Control Register enables or disables
interrupts on each individual pin of port B. The External
Interrupt Mask Bit (EIMSK) of Modulator Control and Status Register can be used to mask all external interrupts so
that lower priority interrupts such as timer interrupts can be
served. The state of any external interrupt received during
the masked period is preserved. When the EIMSK bit is
clear, the pending interrupts activate the MCU interrupt processing again. The external interrupt causes MCU to load
the contents of memory locations FFFAH and FFFBH into
Program Counter.
7.3 CMT Interrupt
A CMT interrupt is generated when the end of cycle flag
(EOC) and the end of cycle interrupt enable (EOCIE) bits
are set in the modulator control and status register
(MCSR). This interrupt will vector to the interrupt service
routine located at the address specified by the contents of
memory locations FFF8H and FFF9H.
7.4 Core Timer Interrupt
The core timer is a 14-stage multifunctional ripple timer.
User can select overflow or real-time interrupt by the setting
of the Core Timer Control Status Register. Please see the
timer section for more details. The timer interrupt causes
MCU to load the contents of memory locations FFF6H and
FFF7H into Program Counter.
The device can operate in two different modes. The Operation mode includes the User mode and the Learning mode.
The pin definitions vary between different operation modes
as described in Table 8-1.
8.1 User Mode
In the user mode, the embedded MCU fetches program
codes from the user memory space. Please refer to the
SST65P542R Programming User’s Manual for instruction
sets and the internal MCU programming information.
TABLE8-1: P
Pin #Normal Interface Modes
1PB[0]PB[0]AD[0]
2PB[1]PB[1]AD[1]
3PB[2]PB[2]AD[2]
4PB[3]PB[3]AD[3]
5PB[4]PB[4]AD[4]
6PB[5]PB[5]AD[5]
7PB[6]PB[6]AD[6]
8PB[7]PB[7]AD[7]
9PA[0]PA[0]PROG_RST
10PA[1]PA[1]MODE[1]
11PA[2]PA[2]SCLK
12PA[3]PA[3]RY/BY#
13PA[4]PA[4]POROUT#
14PA[5]PA[5]V
15PA[6]PA[6]V
16PA[7]PA[7]V
17PC[0]PC[0]WE#
18PC[1]PC[1]OE#
19PC[2]PC[2]TDIN
20PC[3]PC[3]MODE[0]
21LPRST#LPRST#LPRST#
22V
23IROIROTCLKIN
24RST#RST#V
25IRQ#IRINV
26V
27OSC2OSC2Do not use
28OSC1OSC1V
1. See Table 5-2 for pin description.
2. OSC2 is an output, not used during external host program mode.
IN ASSIGNMENT FOR DIFFERENT OPERATION MODES
External Host
Programming Mode
User ModeLearning Mode
SS
DD
V
SS
V
DD
8.2 Learning Mode
To enter the learning mode, input the IR signal to the IRQ#
pin, then use the BIL and BIH instruction set to record the
input signal width. For detail information on learning mode,
please refer to the application note “Remote Controller
Learning Algorithm using SST65P542R.”
Please refer to SST65P542R Programming User’sManual for programming information.
9.2 Carrier Modulator Transmitter (CMT)
SST65P542R integrates a carrier modulator transmitter for
supporting various encoding methods. The purpose of this
module is to reduce the loading of the MCU. Three major
functions are performed by this block: carrier generation,
modulation, and transmission.
Please refer to SST65P542R Programming User’s Manual
for programming information.
9.3 Clock Input Options
Control connections for the 2-lead on-chip oscillator are the
OSC1 and OSC2 pins. OSC1 is input and OSC2 is output.
A crystal resonator, ceramic resonator, or external clock
signal can drive the oscillator.
30 pF
30 pF
FIGURE9-1: U
DON'T
CONNECT
5
4.0
MΩ
MHz
SINGTHE CRYSTAL
EXTERNAL
CLOCK
SIGNAL
OSC1
OSC2
V
SS
OSC1
OSC2
V
SS
368 ILL F05a.6
9.4 Crystal/Ceramic Resonator
368 ILL F05b.3
A crystal/ceramic oscillator circuit is shown in Figure 9-1. A
ceramic resonator instead of a crystal may be used to
reduce costs. It is recommended that the resonator and
capacitors be mounted as close to the pins as possible to
minimize output distortion.
Crystal manufacturer, supply voltage, and other factors
may cause circuit performance to differ from one application to another. C1 and C2 should be adjusted
appropriately for each design.
If external clock source is provided, OSC1 is the clock input
and OSC2 is don’t connect. Leave OSC2 open.
27
Page 28
10.0 POWER SAVING MODES
Remote Controller MCU
SST65P542R
Advance Information
SST65P542R provides two power saving modes: Stop
mode and Idle mode. These two modes can be entered
through the setting of the Power Saving Control Register.
Refer to Section 3.1 for power saving control register.
10.1 STOP Mode
Writing a logic ’0’ to the STOP bit of the Power Saving Control Register enters the STOP mode. To achieve the lowest
possible power consumption, the implementation uses
STOP bit to gate off the internal clock. See Figure 10-1 for
illustration of clock arrangement in the STOP mode. Since
there is no clock input, the internal states are maintained
and not changed including I/O registers and RAM memory
except that the core timer counter bits are cleared. The
external IRQ interrupt can brought the device out of the
STOP mode, but all other interrupts are not served until the
CLK
device is recovered from STOP mode. There are three
conditions that will recover the device from the STOP
mode: external IRQ#/Port B interrupt (EIMSK=0), RST# or
external reset LPRST#. The STOP bit will be set to 1 when
the device has been brought out of STOP mode. The interrupt mask bit (I bit) will not be affected.
10.2 IDLE Mode
Writing a logic ’0’ to the IDLE bit of the Power Saving Control Register enters the IDLE mode. In the IDLE mode, the
timer is still running. Any internal or external interrupt will
recover the device from IDLE mode. If both STOP and
IDLE bits are ’0’, then STOP mode takes effect. The IDLE
bit will be set to 1 when the device has been brought out of
the IDLE mode. The interrupt mask bit (I bit) will not be
affected.
Absolute Maximum Stress Ratings (Applied conditions greater than those listed under “Absolute Maximum
Stress Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation
of the device at these conditions or conditions greater than those defined in the operational sections of this data
sheet is not implied. Exposure to absolute maximum stress rating conditions may affect device reliability.)
1. Outputs shorted for no more than one second. No more than one output shorted at a time.
(Based on package heat transfer limitations, not devices power consumption.)