How to configure Digital Ouput in Renesas RH850/FIL Micrcontroller ?

I need to configure pin AP0_14 for digital output.  To achieve this I need to write 0 to bit 14 of 16-bit Port Mode Register.


The physical address of this register is:   0xFFC103C8


What should be the exact statement to write to this register using the physical address ?
Renesas-RH850FIL.pdf
LVL 1
naseeamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

naseeamAuthor Commented:
Please see section 2.9.2.4 in attached manual.
0
sarabandeCommented:
perhaps like

// assume bit 2, bit 4, 5, 6, bit 10 is set
unsigned short bits0_14 = 0x4702; 

unsigned short * pus = (unsigned short *)0xFFC103C8;
*pus |= (bits0_14 & 0x7FFF);

Open in new window


0x7FFF is all bits set beside bit 15.

Sara
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sarabandeCommented:
correction:

*pus = (*pus & 0x8000) | (bits0_14 & 0x7FFF);

Open in new window


Sara
0
naseeamAuthor Commented:
This is embedded software application.

Don't I need volatile keyword ?
0
sarabandeCommented:
volatile makes that in a multi-threaded application each thread doesn't make optimization on  a variable, since it could be changed by another thread. for example in a loop the variable was checked in the loop condition even if there was no change in the loop body. 'embedded' software is realtime and single-threaded as far as i know. so the volatile shouldn't make a difference. but it also may not harm (and perhaps my knowledge of 'embedded' systems is not up-to-date).

Sara
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.