View previous topic :: View next topic |
Author |
Message |
bittwidler
Joined: 28 Sep 2008 Posts: 2
|
PIC10F pullups |
Posted: Sun Sep 28, 2008 8:49 am |
|
|
I'm probably missing something basic here, but I can't seem to get the weak pullups enabled on the PIC10F206. I've tried the "port_x_pullups()" function, using everything I can think of for x( starting with b), but the compiler doesn't like it. I was going to do a #byte definition, but the OPTION register doesn't have an address.
Any ideas? Thanks for the help!
BitTwidler |
|
|
Ttelmah Guest
|
|
Posted: Sun Sep 28, 2008 9:17 am |
|
|
The 'option' register, is the register used to configure the watchdog prescaler, and pin change operation. Hence it is accessed through the 'setup_wdt', of 'setup_counters' operation. The pullups _default_ to 'on', if the bit is cleared, so there is only an option to disable them (look in the include file for the processor, and the data sheet). So:
setup_wdt(WDT_18MS);
Will also automatically enable the pull-ups. While:
setup_wdt(WDT_18MS|DISABLE_PULLUPS);
Will turn the pullups off.
Obviously choose your required timing for the watchdog.
Best Wishes |
|
|
bittwidler
Joined: 28 Sep 2008 Posts: 2
|
PIC10F Pullups |
Posted: Sun Sep 28, 2008 10:41 pm |
|
|
Thanks for the help Ttelmah! |
|
|
|