device = 32MX795F512L
clock = 80 #pragma config FPLLODIV = DIV_1 // PLL Output Divider
#pragma config UPLLEN = ON // USB PLL Enabled
#pragma config UPLLIDIV = DIV_2 // USB PLL Input Divider
#pragma config FPLLMUL = MUL_20 // PLL Multiplier
#pragma config FPLLIDIV = DIV_2 // PLL Input Divider
#pragma config FWDTEN = OFF // Watchdog Timer
#pragma config FPBDIV = DIV_1 // Peripheral Clock divisor
#pragma config WDTPS = PS1 // Watchdog Timer Postscale
#pragma config FCKSM = CSECME // Clock Switching & Fail Safe Clock Monitor enabled
#pragma config OSCIOFNC = OFF // CLKO Enable
#pragma config POSCMOD = XT // Primary Oscillator
#pragma config IESO = ON // Internal/External Switch-over
#pragma config FSOSCEN = OFF // Secondary Oscillator Enable (KLO was off)
#pragma config FNOSC = PRIPLL // Oscillator Selection
#pragma config CP = OFF // Code Protect
#pragma config BWP = OFF // Boot Flash Write Protect
#pragma config PWP = OFF // Program Flash Write Protect
#pragma config ICESEL = ICS_PGx2 // ICE/ICD Comm Channel Select
#pragma config DEBUG = OFF // Background Debugger Enable
Device = 32MX795F512L
Clock = 80
sub main()
DEVCFG0 = &H7FFFFFFF ' these are equivalents of your cfg.bits
DEVCFG1 = &HFF600DDB
DEVCFG2 = &HFFF879D9
DEVCFG3 = &HFFFFFFFF
TRISB.14 = 0 ' make pin output
while true
PORTB.14 = 1 ' switch on LED
delayms(500) ' wait 0.5 seconds
PORTB.14 = 0 ' switch LED off
delayms(500) ' wait 0.5 seconds
end while
end sub public config FPLLODIV(FPLLODIV) = {DIV_4}
public config UPLLEN(UPLLEN) = {ON}
public config UPLLIDIV(UPLLIDIV) = {DIV_2}
public config FPLLMUL(FPLLMUL) = {MUL_20}
public config FPLLIDIV(FPLLIDIV) = {DIV_2}
public config FWDTEN(FWDTEN) = {ON, OFF}
public config FPBDIV(FPBDIV) = {DIV_1}
public config WDTPS(WDTPS) = {PS1}
public config FCKSM(FCKSM) = {CSECME}
public config OSCIOFNC(OSCIOFNC) = {OFF}
public config POSCMOD(POSCMOD) = {XT}
public config IESO(IESO) = {ON}
public config FSOSCEN(FSOSCEN) = {OFF}
' set config for program...
config FPLLODIV = DIV_4 // PLL Output Divider
config UPLLEN = ON // USB PLL Enabled
config UPLLIDIV = DIV_2 // USB PLL Input Divider
config FPLLMUL = MUL_20 // PLL Multiplier
config FPLLIDIV = DIV_2 // PLL Input Divider
config FWDTEN = OFF // Watchdog Timer
config FPBDIV = DIV_1 // Peripheral Clock divisor
config WDTPS = PS1 // Watchdog Timer Postscale
config FCKSM = CSECME // Clock Switching & Fail Safe Clock Monitor enabled
config OSCIOFNC = OFF // CLKO Enable
config POSCMOD = XT // Primary Oscillator
config IESO = ON // Internal/External Switch-over
config FSOSCEN = OFF // Secondary Oscillator Enable (KLO was off)Return to Development Environment
Users browsing this forum: No registered users and 4 guests