18F2550 and Blink Led


Closed Thread
Results 1 to 40 of 50

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    The config you have seems fine but unless you want to use the watchdog turn WDT off and you can turb VREGEN off as you're not using USB. One question though, if you aren't using USB, why not use a device similar to 2550 but with additional features and more memory eg 18F25K22?
    George

  2. #2
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    I was not aware of the 18F25K22. I should have asked for advice before I made the change. Sometimes selecting a new device can be very confusing. I will look at the data sheet for the 18F25K22 , do you have any other suggestions for a 16f648a substitute with more memory. I don’t really need the extra I/O’s just more code space.
    Thank you very much!

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    If you are looking for a direct replacement I would suggest the 16F1847. Faster and twice the memory.
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    Thank you, I will make an order on Monday. I should have asked before I started this project.
    I have tried to use the pic comparison page with some luck http://www.microchip.com/maps/microcontroller.aspx
    Melabs once had a very simple chart that compared many of the most common controller however they deleted that page.

    I have one more question about the 18f2550 can anyone tell me how to turn on the weak pullups on the top 4 of PORTB “4-7”.
    Last edited by n0yox; - 24th February 2018 at 21:21.

  5. #5
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    Is this close?
    INTCON2 = %00000000 ' makes all of portb have WPU ? INTCON2<7> 'page 116
    TRISB = %00001111 'B. 0:3 are now outputs WPU is now off?
    Last edited by n0yox; - 24th February 2018 at 22:12.

  6. #6
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    To enable the pullups on PORTB just clear the RPBU bit in INTCON2 using INTCON2.7 = 0. It's an all or nothing thing on that chip... you can't set them individually.

    TRISB = %00001111 'B. 0:3 are now outputs WPU is now off?
    The comment doesn't match the setting, but to set PORTB 7:4 to inputs and the others (3:0) to outputs you'd use
    TRISB = %11110000

    The WPU is only enabled when the pin is set to input mode (TRIS bit = 1). It's disabled when the pin is an output (TRIS bit = 0)

  7. #7
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    What I was attempting to say with that comment was that by using TRISB = %00001111 after the line containing INTCON2.7 = 0 you would set the bottom 4 bits to outputs causing those 4 bits to no longer have WPU , Maybe I have this backward and it should be TRISB = %11110000 Is this also wrong? As it turns out I need all 8 ports to have WPU’s so I will not be using that line. However for future use I would like to know the correct usage?
    Thank you so much!

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