u. Is it difficult to get USB working on PIC32MX250F128B?

GET FREE Microsoft Visual Basic.NET support for PIC32MX250F128B.... Make your own JTAG programmer...

There are also basic circuit examples with external oscillator and external resonator and Velleman K8055 and K8055N boards upgrade examples.

PIC32MX2xxFxxxx microcontrollers are slightly different from their bigger cousins with more than 28 pins. There are many reports by hobbyists on difficulties encountered while trying to use the integrated USB module. There are also some reports on errors in Microchip USB program libraries and some workarounds.

The errors will certainly get corrected in newer versions of USB program libraries. However, you should keep in mind that PIC32MX2xxFxxxx microcontrollers CPUs are only tested to run up to 40 (or 50 - PIC32MX250F128B-50) MHz. You should set the configuration parameters accordingly. The CPU clock should not exceed 40 (or 50) MHz.

Here is a sample configuration for running PIC32MX250128B on 40 MHz with a 16 MHz crystal (more examples are available in PIC32MX250F128B configuration samples - 40 MHz CPU version.zip from Downloads section):

// DEVCFG3

#pragma config PMDL1WAY = OFF // Peripheral Module Disable Configuration (Allow only one reconfiguration)

#pragma config IOL1WAY = OFF // Peripheral Pin Select Configuration (Allow only one reconfiguration)

#pragma config FUSBIDIO = ON // USB USID Selection (Controlled by the USB Module)

#pragma config FVBUSONIO = ON // USB VBUS ON Selection (Controlled by USB Module)

// DEVCFG2

#pragma config FPLLIDIV = DIV_4 // PLL Input Divider (4x Divider)

#pragma config FPLLMUL = MUL_20 // PLL Multiplier (20x Multiplier)

#pragma config UPLLIDIV = DIV_4 // USB PLL Input Divider (4x Divider)

#pragma config UPLLEN = ON // USB PLL Enable (Disabled and Bypassed)

#pragma config FPLLODIV = DIV_2 // System PLL Output Clock Divider (PLL Divide by 2)

// DEVCFG1

#pragma config FNOSC = PRIPLL // Oscillator Selection Bits (Fast RC Osc w/Div-by-N (FRCDIV))

#pragma config FSOSCEN = OFF // Secondary Oscillator Enable (Disabled)

#pragma config IESO = OFF // Internal/External Switch Over (Disabled)

#pragma config POSCMOD = HS // Primary Oscillator Configuration (Primary osc in high power mode)

#pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled)

#pragma config FPBDIV = DIV_8 // Peripheral Clock Divisor (Pb_Clk is Sys_Clk/8)

#pragma config FCKSM = CSDCMD // Clock Switching and Monitor Selection (Clock Switch Disable, FSCM Disabled)

#pragma config WDTPS = PS1 // Watchdog Timer Postscaler (1:1048576)

#pragma config WINDIS = OFF // Watchdog Timer Window Enable (Watchdog Timer is in Non-Window Mode)

#pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Enabled)

#pragma config FWDTWINSZ = WISZ_25 // Watchdog Timer Window Size (Window Size is 25%)

// DEVCFG0

#pragma config JTAGEN = OFF // JTAG Enable (JTAG Port Disabled)

#pragma config ICESEL = ICS_PGx1 // ICE/ICD Comm Channel Select (Communicate on PGEC1/PGED1)

#pragma config PWP = OFF // Program Flash Write Protect (Disable)

#pragma config BWP = OFF // Boot Flash Write Protect bit (Protection Disabled)

#pragma config CP = OFF // Code Protect (Protection Disabled)