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 ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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 in attached manual.
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.


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

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

Open in new window

naseeamAuthor Commented:
This is embedded software application.

Don't I need volatile keyword ?
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).

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

From novice to tech pro — start learning today.