Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can't get weak pullup operating on 12F683

Status
Not open for further replies.

Oznog

Active Member
OK, got a 12F683 here with a button on GPIO0. 12F683 has internal weak pull-up options for all its pins. But I can't get the weak pull-up to turn on, the pin remains low. I'm using the HTPIC compiler.
Code:
    TRISIO=0b00010001;
    WPU   =0b00000001;
    GPPU  =0b0;
    ANSEL=0b00101000;
   CMCON0=0b111;
That pin is also used for PGD, so I can rule out some kind of SMD soldering problem. It wouldn't have programmed if not connected or if shorted to gnd. Turned off the TRIS and strobed the GPIO0 bit, the trace carries the voltage. Which also verified that the code is running in the first place.

Worried that the programmer may be loading it down (it shouldn't), I powered it externally without the programmer attached. No change.

Disconnected power and measured leakage from that pin to ground and surrounding pins. It's not much. Well, I did get 700K to a nearby pin, the board could use de-fluxing, but that's not low enough to significantly ground out the weak pull-up which is listed as a nominal 50uA.

I tried doing GPPU=1; because GPPU is actually GPPU_n, and thus there's a slight possibility of miscommunication on the spec of what setting it to "1" does. But, no, that doesn't make a pull-up.

I keep checking- yes, this is GPIO0. GPIO0 has WPU functionality. TRISIOx=1 and WPUx=1 and GPPU=0 and deselecting the Analog functionality and disabling the comparator on that pin are all that's needed to enable WPU. No module connected to GPIO0 is enabled. The board or programmer is not pulling down WPU. The processor is running code just fine. Which was a great line of problem-solving questions, but nothing solved the problem.

Any ideas?
 
Last edited:
Yeah, I think I got it. It was a combination of things. I didn't have CMCON0 set at first.

The ICD3 presents SIGNIFICANT loading on the PGD pin when left in "run" mode. It's down to +1V... but on an external power supply, it does reliably float to 4.87v now.
 
I got bit by a different pin loading bug recently too. The GP1/PGC pin had a good sized cap on it, from 18f14k50 USB experiments. Spinning in circles there for far too long.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top