18F2550 and Blink Led


Closed Thread
Results 1 to 40 of 50

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    The oscillator block on the USB equipped devices are a bit complicated.
    It looks to me as if you're trying to run off of the internal oscillator at 8MHz (judging by OSCCON setting INTOSC to 8MHz) yet the two least significant bits of OSCCON selects the primary oscillator - where you may or may not have a x-tal connected (you don't tell us anything about your hardware setup)?

    And you have not told the compiler what frequency you're aiming to run at.

    So, we need a bit more detail regarding what you're trying to do exactly.

    /Henrik.

  2. #2
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: 18F2550 and Blink Led

    Thank you for your reply. You are right I am trying to use the internal oscillator and have no idea how to setup the oscillator section. I do not plan to use any of the special features “usb ” of this processor. I did notice my mistake late last night and fixed these lines,
    CONFIG FOSC = INTOSC_XT ; Internal oscillator, XT used by USB (INTXT)
    CONFIG MCLRE = OFF ; RE3 input pin enabled; MCLR pin disabled

    I am blinking now but have no idea how to set up the rest of the configuration. I am using the 18f2550 in place of a 16f648a to acquire more code space. I need all of my IOs to be digital with int.pullups on the top 4 of PORTB “4-7”. The datasheet is a 426 page fun read to say the least. Any help you offer will be appreciated.
    Thank You,

  3. #3


    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

  4. #4
    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!

  5. #5
    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

  6. #6
    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.

  7. #7
    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.

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