Select your language
U.S. English
Chinese (Simplified)
Japanese
Save
Renesas Engineering Community
Search
User
Join or sign in
Site
Search
User
Renesas Engineering Community
FAQ
Help
More
Cancel
Forums & Groups
Japanese Community
中文社区(Chinese Community)
More
Cancel
Vault Archive
Doctor Micro
RL78 Blog
Cancel
RL78 Blog
RL78 Blog - Forum
RL78 problem with hardware multiplier/divider accumulator in G13 CPUs with GCC compiler V15.01
Blog
Forum
Files
Members
Mentions
Sub-Groups
Tags
More
Cancel
New
State
Verified Answer
Replies
3 replies
Subscribers
78 subscribers
Views
5578 views
Users
0 members are here
RL78 G13 hardware multiply
Options
Share
More
Cancel
Related
RL78 problem with hardware multiplier/divider accumulator in G13 CPUs with GCC compiler V15.01
Ray A
over 9 years ago
I have some code in an INTERRUPT service routine that multiplies two 16 bit values into a 32 bit result
I also have some code in the main loop that multiplies two 16 bit values into a 32 bit result
Looking at the Interrupt function I see that it uses the Hardware multiplier/divider accumulator to do the grunt work
Looking at the main loop Code I see that it uses the Hardware multiplier/divider accumulator to do the grunt work
==>> The problem I have noticed is that the main loop sometimes gets wrong results
I am using the GCC Compiler V15.01
Solution 1 ) how to tell the GCC C Compiler to NOT use the Hardware multiplier/divider accumulator in INTERRUPT functions !!!!
Solution 2) Turn off and back on INTs in the main loop around the Hardware multiplier/divider accumulator code to prevent ISR getting in the middle
Solution 3) Use a software shift and Add method to do the multiply
My preference is to use Solution 1)