Question: Modify the program to only display 4 LSB values of the 1 6 - bit counter on 4 LSB of PORTC ( i . e

Modify the program to only display 4 LSB values of the 16-bit counter on 4 LSB of
PORTC (i.e. RC3-RC0). Note that the other bits of PORTC should not change at all.
Use PORTC =0x3FF (i.e. all 1) in the SETUP as the initial value
Hint: You can do this by reading PORTC, changing the required bits, and writing it
back as explained in the following steps:
Reed PORTC and clear 4 LSB values using & (AND). This masking.
Mask all unwanted bits of the counter to keep only 4 LSB values (using &)
Add two values together and send it to PORTC. You can also use |(OR)
instead of adding.
Verify that the program works as expected.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!