Hello Matrix Team,
may you can help me with the above issue.
The PIC16F627A has the feature to activate the internal pulup resistors. I would like to use this feature for the complet RB-Port or may better for individual pins at the RB-Port.
May somebody can help me with the necessary C-command.
The rigister bit is number 7
BR
Dirk
Modify Option register at PIC16F627A with C-Box?
-
- Posts: 96
- http://meble-kuchenne.info.pl
- Joined: Fri Dec 04, 2020 11:03 am
- Has thanked: 6 times
- Been thanked: 12 times
Re: Modify Option register at PIC16F627A with C-Box?
Hi Martin,
many thanks for the replay. Not sure if I do it right. Placing the following statment inside C-Box...
OPTION_REGbits.nWPUEN = 1;
...will create the following compiler error message....
Microchip MPLAB XC8 C Compiler (PRO Mode) V1.45
Build date: Nov 15 2017
Part Support Version: 1.45
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration
Old_GSU_for_new_ECU_V1_7_1.c: main()
3008: OPTION_REGbits.nWPUEN = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S31
(908) exit status = 1
(908) exit status = 1
Error returned from [xc8.exe]
Autoclose turned off
FINISHED
BR
Dirk
many thanks for the replay. Not sure if I do it right. Placing the following statment inside C-Box...
OPTION_REGbits.nWPUEN = 1;
...will create the following compiler error message....
Microchip MPLAB XC8 C Compiler (PRO Mode) V1.45
Build date: Nov 15 2017
Part Support Version: 1.45
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration
Old_GSU_for_new_ECU_V1_7_1.c: main()
3008: OPTION_REGbits.nWPUEN = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S31
(908) exit status = 1
(908) exit status = 1
Error returned from [xc8.exe]
Autoclose turned off
FINISHED
BR
Dirk
Happy FC9, FC-8 and FC-6 professional user 

-
- Matrix Staff
- Posts: 1920
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 622 times
- Been thanked: 645 times
Re: Modify Option register at PIC16F627A with C-Box?
Hi.
what I posted was a link to a guide to point you in the right direction of how to use C code.
It will vary depending on the target.
In your case of the 16F627A the datasheet shows: So instead of you will need to use
what I posted was a link to a guide to point you in the right direction of how to use C code.
It will vary depending on the target.
In your case of the 16F627A the datasheet shows: So instead of
Code: Select all
OPTION_REGbits.nWPUEN = 1;
Code: Select all
OPTION_REGbits.nRBPU = 1;
Martin