Question

PCON is not a bit addressable register. Write a C code segment that makes sure that...

PCON is not a bit addressable register. Write a C code segment that makes sure that SMOD0 (bit 6) is cleared to ‘0’ and SMOD1 (bit 7) is set or cleared based on a defined value (i.e #define SMOD1 (1) would cause bit 7 to be set.). Hint: This can be done with as few as two instructions (one to clear and one to set).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C code to make 6th bit of SMODO clear
if(SMODO & (1<<6))SMODO ^= (1<<6);


C code to make 7th bit of SMOD1 set
SMOD1 &= (1<<7);

Add a comment
Know the answer?
Add Answer to:
PCON is not a bit addressable register. Write a C code segment that makes sure that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT