跳至主要內容
Knowledgebase
Home
Renesas Electronics Taiwan - Knowledgebase

How to beware point if set various bits at one port on SH1 and SH2 core MCU?1009968

Latest Updated:03/21/2012

Question:

Please instruct the bewared point when setting different bits at one port by different interrupts on SH1 and SH2 core MCU.

Answer:

Do not disable/enable interrupts or set the same interrupt priority level at one port around the port bit operation.
Generating other interrupts to operate the same port is not allowed as the SH1 and SH2 cores do not have bit control commands.
Follow the procedure below for a bit operaion.
(1) Read the data register at the port.
(2) Rewrite the target bit.
(3) Write the updated data to the port.
When a port processing A (an interrupt) occurs before the processing of (3), the register altered by the port A processing will overwrite the data in the processing (3).
Suitable Products
SH7124, SH7125
SH7147
SH7146, SH7149
SH7144, SH7145
SH7131, SH7132, SH7136, SH7137
SH7083, SH7084, SH7085, SH7086
SH7065
SH7047, SH7049, SH7105, SH7107, SH7109
SH7046, SH7148, SH7101, SH7048, SH7104, SH7106, SH7108
SH7040, SH7041, SH7042, SH7043, SH7044, SH7045
SH7032, SH7034, SH7034B
SH7020, SH7021
SH7018
SH7014, SH7016, SH7017
SH7011