|
|
View previous topic :: View next topic |
Author |
Message |
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
26K22 pullup on E3 -> Compiler error 5.016 |
Posted: Thu Dec 12, 2013 7:00 am |
|
|
Hi
Compiler 5.016
Is this looking right?
I dont understand the asm. code, register F86.6? is not existing in the chip 26K22? And the RBPU = 0 is High therefore no pullup at all.
Is there error in the compile??
//Only for test, therefore no sw or other thing!
Code: | #include <18F26K22.h>
void main(void) {
port_b_pullups(0x00);//no pull up on port b
port_e_pullups(0x08);//pullup on port e pin_e3!!! It can only be input! If no pullup it will float:-((((
} |
List code:
Code: | 0001E: CLRF WPUB
00020: BSF INTCON2.RBPU
.................... port_e_pullups(0x08);//pullup on port e pin_e3!!! It can only be input! If no pullup it will float:-((((
00022: BCF F86.6
|
This is from the Datasheet:
Code: | 10.6.3 RE3 WEAK PULL-UP
The port RE3 pin has an individually controlled weak
internal pull-up. When set, the WPUE3 (TRISE<7>) bit
enables the RE3 pin pull-up. The RBPU bit of the
INTCON2 register controls pull-ups on both PORTB
and PORTE. When RBPU = 0, the weak pull-ups
become active on all pins which have the WPUE3 or
WPUBx bits set. When set, the RBPU bit disables all
weak pull-ups. The pull-ups are disabled on a Poweron
Reset. When the RE3 port pin is configured as
MCLR, (CONFIG3H<7>, MCLRE=1 and
CONFIG4L<2>, LVP=0), or configured for Low Voltage
Programming, (MCLRE=x and LVP=1), the pull-up is
always enabled and the WPUE3 bit has no effect
|
Last edited by hmmpic on Thu Dec 12, 2013 9:45 am; edited 1 time in total |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Thu Dec 12, 2013 9:14 am |
|
|
Yes. Report it to CCS, and just bodge round temporarily with:
Code: |
#include <18F26K22.h>
#BIT RBPU=getenv("BIT:RBPU")
void main(void) {
port_b_pullups(0x00);//no pull up on port b
port_e_pullups(0x08);//pullup on port e pin_e3!!! It can only be input! If no pullup it will float:-((((
RBPU=0;
}
|
On most chips, RBPU, only controls the port B pullups (hence the 'B' in it's name). So the compiler when it sees all the pull up bits on port B set to '0', turns this bit off. On this chip it also controls the port E pullups, so needs to be on if any bit is set here, but the compiler hasn't got this sorted.
Hurrah!. A really nice sized test program.
Best Wishes |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
Posted: Thu Dec 12, 2013 9:47 am |
|
|
Hi
Just sent a support mail to CCS.
Thanks for testing, too:-) |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|