Answer the question
In order to leave comments, you need to log in
What happens if you try to write a value to a read-only register?
There was an error in the code where I am trying to write a value to a read-only register. Here is the piece where:
if (ADCH < 10) ADCH = 0x00; // Тут ADCH - судя по даташиту, только для чтения
OCR0A=ADCH;
Answer the question
In order to leave comments, you need to log in
What's the point of this if block if the register is read-only? And it's read-only.
Copy the data from it into a separate variable and work with it already. This is the only true way.
Nothing will happen. The compiler is smarter than you, it will give you a corresponding message
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question