2
\$\begingroup\$

I am using PIC18F45K22 and MPLAB XC8. Recently I stumbled upon something while reading ADCON0 register. A particular bit in the register, GO/DONE has many representations while I try bit addressing it in xc8 (something like ADCON0bits.GO_NotDone). These are Go, Done, Go/Done, Go_notDone, Go_nDone.

My question is why are so many representations required for the same bit? It could have simply been something like GO_NotDone. Am I missing something in my understanding? Any insights are welcome, thanks.

Mike
2,6192 gold badges17 silver badges31 bronze badges
asked Oct 25, 2018 at 8:31
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I would like to respond to your question as why Microchip has multiple names for bits in some of the Special Function Register.

I have been using Microchip controller since the PIC16C54 was introduced, or about 25 years. At first the documentation was written by engineers and they were not too concerned about consistency with naming registers or bits.

The result is that there is a legacy code base that uses variant names. To allow that code to build when Microchip updated the assemblers or compilers aliases were injected for variant names of registers and bits. I doubt that the names were added just to make C code more readable.

I admit that this is opinion based on years of observation and not on any statements from Microchip.

Should anyone have direct knowledge I, for one, would appreciate being told I am wrong.

answered Oct 25, 2018 at 20:38
\$\endgroup\$
1
  • \$\begingroup\$ You are totally right! It's jus to be compatible with the old stuff. \$\endgroup\$ Commented Oct 26, 2018 at 7:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.