PDA

View Full Version : Pullup confusion 12c508a



Michael
- 9th September 2016, 20:38
saw this but WPUB must be wrong -- creates an error

option_reg.7=0 ' Enable WPUs by individual pin
WPUB = %11110000 'enable weak pullups on RB7, RB6, RB5 & RB4

anyway -- trying to make this easy -- never used the pullups before.

INTCON2.7 ?

I'm seeing all sorts of conflicting internet crap about it and pullups are not not even mentioned in my PBP manual.

Just trying to enable a pullup on GPIO 1 on a 12c508 and all other ports are output. HELP ! -- THANKS

mark_s
- 9th September 2016, 22:43
That chip is so old I am afraid to answer.

Looking at page 17 of the data sheet.

It looks like you would set the option register bit 6 to 0

OPTION.6 = 0 'sets weak pullups on gp0,gp1 and gp3


Add: Read this also
http://melabs.com/support/12-bit.htm

Aussie Barry
- 10th September 2016, 01:27
Hi Michael,

The PIC12C508A doesn't have a PORTB so your WPUB statement will obviously create an error.
As mark_s has already stated, setting option register bit 6 to 0 will enable weak pull ups on GP0, GP1 and GP3
These pins must be set as inputs.

Note, hard pull-ups can always be implemented instead of weak pull-ups.

I trust this helps.

Cheers
Barry
VK2XBP

Michael
- 10th September 2016, 18:09
Well actually I'm going to use a 12F675 as I now find out I can get it programmed. So, on a 12F675 -- how would I enable a pullup on pin 6 GPIO.1 ?

THANKS much.

By the way, "weak" pullup must mean what? Current capabiltiy of the resistor or something?

mark_s
- 10th September 2016, 18:52
Try this for setting the pull-up on GPIO.1



OPTION_REG.7 = 0 ' Set global GPPU
WPU.1 = 1 'pull-up on gpio1 enabled