4550 osc


Closed Thread
Results 1 to 15 of 15

Thread: 4550 osc

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    11

    Default 4550 osc

    I'm a bit new with this chip and I'm having problems with the oscillator settings. Basically, I already have a program and circuit working with the chip and a 4MHz XT.

    The problem is that when I replace the crystal with a 20MHZ HS nothing communicates anymore. Debug and SPI, to be exact.

    I've changed my DEFINE OSC to 20 and made sure the right MHz and Type are selected in melabs programmer. Is there something else I am missing to get the serial ports back to normal speed?

    I'm using MicroCode Studio - PicBasic Pro with the MeLabs USB Programmer.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    First we need some info....What chip body? What compiler version? Is it a 20Mhz crystal or resonator?

    Nick

  3. #3
    Join Date
    Oct 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    18f4550 is the chip, 40 pin dip. I'm using PicBasic Pro 2.46. And it's a quartz crystal.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    have you put capacitors between the oscilator pins and ground?

  5. #5
    Join Date
    Oct 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Yes, did that. 22pF

    Reset is high, too.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    ok, cool, thaught i'd ask a stupid question...

    i used the 18F4550 myself and i also use the same OSC so, i'll run through my settings, however, i'm using winpic800 with a JDM programmer...

    OSC: HS oscillator, PLL enabled, HS used by USB
    CPU system clock: 96MHz PLL dev 5
    Oscilator selection: Devide by 5 (20MHz input)
    Vbor: 2.7V
    Brown-out restet: Enabled in hardware only
    Watchdog: 1:32768
    FCMEM enabled
    IESO enabled
    WDTEN enabled
    PWRTEN disabled
    CCP2MX enabled
    PBADEN enabled
    LPT1OSC enabled
    MCLRE disabled
    DEBUG disabled
    STVREN enabled
    LVP enabled
    ICPORT enabled
    XINST enabled
    USBPLL enabled
    VREGEN enabled

    All CP's are disabled
    All EBT's disabled
    All WRT's disabled

    Acording to oshonsoft's pic18 simulator IDE the BASIC code for those options are asfollows...

    Code:
    Define CONFIG1L = 0x3C
    Define CONFIG1H = 0xCE
    Define CONFIG2L = 0x17
    Define CONFIG2H = 0x1F
    Define CONFIG3L = 0x00
    Define CONFIG3H = 0x07
    Define CONFIG4L = 0xE1
    Define CONFIG4H = 0x00
    Define CONFIG5L = 0x0F
    Define CONFIG5H = 0xC0
    Define CONFIG6L = 0x0F
    Define CONFIG6H = 0xE0
    Define CONFIG7L = 0x0F
    Define CONFIG7H = 0x40
    Hopefully, some of that will help...
    if not, can you post a screen shot of your programmers config options screen?

    Thanks

  7. #7
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA.
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    The '4550 supports USB, and the oscillator section has a lot of options. Try the following;
    asm
    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L

    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H

    __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_2_2L & _VREGEN_ON_2L
    __CONFIG _CONFIG2H, _WDT_OFF_2H
    __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
    endasm
    define OSC 48 'core running at 48Mhz
    DEFINE DEBUG_REG PORTA 'pin Porta.5 serial out to debug
    DEFINE DEBUG_BIT 5
    DEFINE DEBEG_BAUD 2400
    DEFINE DEBUG_MODE 0 '0 = TRUE, 1 = INVERTED

    This setup works with a 20 Mhz crystal. You will also find more information if you do a search here for 18f4550

    Good Luck,
    Jerry
    If your oscilloscope costs more than your car...

Similar Threads

  1. Internal vs. external osc for comms
    By mtripoli in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2010, 14:58
  2. Define osc 1
    By ronsimpson in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st October 2009, 06:35
  3. 18f2550 USB OSC Problem
    By serkanc in forum USB
    Replies: 10
    Last Post: - 29th October 2008, 20:52
  4. 18F458 and 20MHz osc problem...
    By batee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th October 2004, 20:16
  5. 12f675 internal osc question.....
    By Gabe@SPdFtsh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th January 2004, 06:33

Members who have read this thread : 0

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