Config word / pullup resistors


Closed Thread
Results 1 to 6 of 6
  1. #1
    Tomexx's Avatar
    Tomexx Guest

    Default Config word / pullup resistors

    Hi,
    Couple of questions:
    1.
    I've been playing with 16F628A till now and was putting the following line at the top of my programs to set the config word:
    Code:
    @ DEVICE PIC16F628A, INTRC_OSC_NOCLKOUT, WDT_OFF, LVP_OFF, PWRT_OFF, PROTECT_OFF, BOD_OFF
    I'm getting a 16F877A (it's on order). What would be the correct config word for use with the F877A (I'll be using an external crystal)?

    2.
    If I can enable "weak pullup resistors" on Ports A & E of the F877A, does this mean that I don't have to use real resistors for the inputs on those ports?

    Thanks,
    Tom

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I'm getting a 16F877A (it's on order). What would be the correct config word for use with the F877A (I'll be using an external crystal)?
    well depending of what you want to set... if external crystal is 20 MHZ

    @ DEVICE PIC16F877A, HS_OSC


    here's the list for config

    ;================================================= =========================
    ;
    ; Configuration Bits
    ;
    ;================================================= =========================

    _CP_ALL EQU H'1FFF'
    _CP_OFF EQU H'3FFF'
    _DEBUG_OFF EQU H'3FFF'
    _DEBUG_ON EQU H'37FF'
    _WRT_OFF EQU H'3FFF' ; No prog memmory write protection
    _WRT_256 EQU H'3DFF' ; First 256 prog memmory write protected
    _WRT_1FOURTH EQU H'3BFF' ; First quarter prog memmory write protected
    _WRT_HALF EQU H'39FF' ; First half memmory write protected
    _CPD_OFF EQU H'3FFF'
    _CPD_ON EQU H'3EFF'
    _LVP_ON EQU H'3FFF'
    _LVP_OFF EQU H'3F7F'
    _BODEN_ON EQU H'3FFF'
    _BODEN_OFF EQU H'3FBF'
    _PWRTE_OFF EQU H'3FFF'
    _PWRTE_ON EQU H'3FF7'
    _WDT_ON EQU H'3FFF'
    _WDT_OFF EQU H'3FFB'
    _RC_OSC EQU H'3FFF'
    _HS_OSC EQU H'3FFE'
    _XT_OSC EQU H'3FFD'
    _LP_OSC EQU H'3FFC'

    2.
    If I can enable "weak pullup resistors" on Ports A & E of the F877A, does this mean that I don't have to use real resistors for the inputs on those ports?
    that's suppose to do it. but usually i always use external pullups as safe. maybe i'm wrong here


    regards`
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You don't get internal weak Pull-Up's on Ports A & E, just on Port B.

  4. #4
    Tomexx's Avatar
    Tomexx Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie, I thought I read somewhere about the pullups on ports A & E. Must have been something else.

    Anyway, do you use real resistors even when pullups are enabled on port B?

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    If the internal weak pull-up's were of no use, then MicroChip wouldn't have included them.

    It depends on your application. As pull-ups for Buttons, absolutely perfect. As pull-ups for a cheap way of interfacing slow-speed devices (< 10K), even opto-couplers, perfect. As pull-ups for high speed devices (such as on an I2C bus), they're too weak. Also depends on the environment... in an industrial noisy environment, they're too weak, you need something heavier. In a domestic or non-critical commercial environment, again perfect.

    Don't be afraid to use the internal weak pull-up's. I use them a lot (even in industrial applications).

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie,
    I was a bit confused about these internal pullups. Now it's a little more clear about their use.

    But as a safe i always use external one. Also as a safe i always tie to ground/VCC unused pin to avoid interference or PIC malfunction or PIC blow due to environement as i got in the past.

    thanks for making things clear here!

    regards
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  4. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 15:26
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts