urakhai911
Newbie level 6
Hey World,
I am working on a project in which I am using USB and CAN together. I am sending data to the PIC32MX795F512L on the Ethernet Starter Kit from the PC and sending data out through the CAN Bus.
I can get both modules to work individually but when placing the two together in the same program I face certain problems. I narrowed down the problem to the oscillator configuration. When the two programs are combined and I work with the Primary Oscillator (8 Mhz) with PLL the USB works and the CAN doesn't. When I use the internal FRC oscillator the CAN module works and the usb doesn't.
What I have decided to do is work with the Primary Oscillator with PLL and modify my CAN configuration to work with that system clock speed.
I need help with calculating my system clock speed. Here are the relevant configuration bits.
I have attached an image of the oscillator configuration for the PIC32MX.
Thanks!
Please tell me if I didn't explain the question properly.
I am working on a project in which I am using USB and CAN together. I am sending data to the PIC32MX795F512L on the Ethernet Starter Kit from the PC and sending data out through the CAN Bus.
I can get both modules to work individually but when placing the two together in the same program I face certain problems. I narrowed down the problem to the oscillator configuration. When the two programs are combined and I work with the Primary Oscillator (8 Mhz) with PLL the USB works and the CAN doesn't. When I use the internal FRC oscillator the CAN module works and the usb doesn't.
What I have decided to do is work with the Primary Oscillator with PLL and modify my CAN configuration to work with that system clock speed.
I need help with calculating my system clock speed. Here are the relevant configuration bits.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #pragma config UPLLEN = ON // USB PLL Enabled #pragma config FPLLMUL = MUL_20 // PLL Multiplier #pragma config UPLLIDIV = DIV_2 // USB PLL Input Divider #pragma config FPLLIDIV = DIV_2 // PLL Input Divider #pragma config FPLLODIV = DIV_1 // PLL Output Divider #pragma config FPBDIV = DIV_1 // Peripheral Clock divisor #pragma config FWDTEN = OFF // Watchdog Timer #pragma config WDTPS = PS1 // Watchdog Timer Postscale #pragma config FCKSM = CSDCMD // Clock Switching & Fail Safe Clock Monitor #pragma config OSCIOFNC = OFF // CLKO Enable #pragma config POSCMOD = HS // Primary Oscillator #pragma config IESO = OFF // Internal/External Switch-over #pragma config FSOSCEN = OFF // Secondary Oscillator Enable #pragma config FNOSC = PRIPLL // Oscillator Selection
I have attached an image of the oscillator configuration for the PIC32MX.
Thanks!
Please tell me if I didn't explain the question properly.