unable to set RBPU bit in option reg

Status
Not open for further replies.

grekson

New Member
I want to set rbpu bit to be 0 so I will enable portb internal pull ups in PIC mcu.
I am using mikropascal compiler and when I write "OPTION_REG:=value;" the command is excepted, but if I want to set particular bit as "OPTION_REG.RBPU:=0" the command isn't accepted.

For comparison the compiler excepts this line OSCCON.IRCF2:=1; where you set oscilator freq bits.
 
It sems that OPTION_REG.7:=0; works.
Don't know why for OSCCON register you can select bit by its name or number but for OPTION register you can use just number.
 
It sems that OPTION_REG.7:=0; works.
Don't know why for OSCCON register you can select bit by its name or number but for OPTION register you can use just number.

It's a 'limitation' of the compiler, ask the writers - you may of course just be using the wrong word?.

For assembler all definitions are stored in the .INC text files, does this compiler use something similar?.
 
In assembler the weak pull up bit in the OPTION register is named NOT_RBPU, since it is actived by clearing the bit. Probably the same for the compiler too.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…