News:

Let's find out together what makes a PIC Tick!

Main Menu

Pic 18F2550 with bootloader setup issue

Started by Yves, Jun 14, 2025, 06:34 PM

Previous topic - Next topic

Yves

Hello,

I have a 18F2550 and a 8Mhz crystal on board. I think my config is not correct as I can't even flash a LED on portB.1. I use USB_BootLoader_Win64_V1.07A.exe to send the code without problem and I see it is connected on Dview program but no com port is shown. where I am wrong?

 Device = 18F2550
 Declare Xtal = 48
'-------------------------------------------------------------------------------------------------
Symbol LED = PORTB.1
Output LED
While
  Toggle LED
  DelayMS 1000
Wend
'-------------------------------------------------------------------------------------------------
Config_Start
    PLLDIV = 2                          ' Divide by 2 (8MHz oscillator input)
    CPUDIV = OSC1_PLL2                  ' [OSC1/OSC2 Src: /1][96 MHz PLL Src: /2]
    USBDIV = 1                          ' USB clock source comes from the 96 MHz PLL divided by 2
    FOSC = HSPLL_HS                     ' HS oscillator, PLL enabled, HS used by USB
    FCMEN = Off                         ' Fail-Safe Clock Monitor disabled
    IESO = Off                          ' Oscillator Switchover mode disabled
    PWRT = On                           ' PWRT enabled
    BOR = ON_ACTIVE                     ' Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled)
    BORV = 2
    VREGEN = Off                        ' USB voltage regulator disabled
    WDT = Off                           ' Watchdog Timer disabled
    WDTPS = 128                         ' 1:128
    MCLRE = On                          ' MCLR pin enabled
    LPT1OSC = Off                       ' Timer1 configured for higher power operation
    PBADEN = Off                        ' PORTB<4:0> pins are configured as digital I/O on Reset
    CCP2MX = On                         ' CCP2 input/output is multiplexed with RC1
    STVREN = On                         ' Stack full/underflow will cause Reset
    LVP = Off                           ' Single-Supply ICSP disabled
    XINST = Off                         ' Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
    Debug = Off                         ' Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
Config_End
Yves

trastikata

USBDIV = 2
VREGEN = On (*1)

*1 --> Minimum 1uF from VUSB to GND, unless you have the 18LF2550 and you power the PIC from 3.3v, actually it is best if you can show the USB part of your circuit and you mention the power voltages.