From 6029ebb02d9351cb533fdd291944929d88cdce18 Mon Sep 17 00:00:00 2001 From: Boris Honman Date: Sun, 12 Jul 2020 13:29:00 -0400 Subject: [PATCH] replaced 12mhz oscillator with 4mhz and disabled USB voltage regulator because experimental board has an external 3.3v regulator --- common_src/system.c | 18 +++++++++--------- .../nbproject/configurations.xml | 17 +++++++++++++++-- firmware/bia_microddr.X/nbproject/project.xml | 4 +++- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/common_src/system.c b/common_src/system.c index 8b65fdc..c94cbdd 100644 --- a/common_src/system.c +++ b/common_src/system.c @@ -25,17 +25,18 @@ //#include "usb.h" -// PIC18F4550 Configuration Bit Settings + +// PIC18F2550 Configuration Bit Settings // 'C' source line config statements // CONFIG1L -#pragma config PLLDIV = 3 // PLL Prescaler Selection bits (Divide by 3 (12 MHz oscillator input)) -#pragma config CPUDIV = OSC2_PLL3// System Clock Postscaler Selection bits ([Primary Oscillator Src: /4][96 MHz PLL Src: /6]) +#pragma config PLLDIV = 1 // PLL Prescaler Selection bits (No prescale (4 MHz oscillator input drives PLL directly)) +#pragma config CPUDIV = OSC3_PLL4// System Clock Postscaler Selection bits ([Primary Oscillator Src: /3][96 MHz PLL Src: /4]) #pragma config USBDIV = 2 // USB Clock Selection bit (used in Full-Speed USB mode only; UCFG:FSEN = 1) (USB clock source comes from the 96 MHz PLL divided by 2) // CONFIG1H -#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator (HS)) +#pragma config FOSC = HSPLL_HS // Oscillator Selection bits (HS oscillator, PLL enabled (HSPLL)) #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled) #pragma config IESO = OFF // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled) @@ -43,7 +44,7 @@ #pragma config PWRT = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config BOR = ON // Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled)) #pragma config BORV = 3 // Brown-out Reset Voltage bits (Minimum setting 2.05V) -#pragma config VREGEN = ON // USB Voltage Regulator Enable bit (USB voltage regulator enabled) +#pragma config VREGEN = OFF // USB Voltage Regulator Enable bit (USB voltage regulator disabled) // CONFIG2H #pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) @@ -58,9 +59,6 @@ // CONFIG4L #pragma config STVREN = ON // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset) #pragma config LVP = OFF // Single-Supply ICSP Enable bit (Single-Supply ICSP disabled) -#ifdef PIC18F4550 -#pragma config ICPRT = OFF // Dedicated In-Circuit Debug/Programming Port (ICPORT) Enable bit (ICPORT disabled) -#endif #pragma config XINST = OFF // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode)) // CONFIG5L @@ -96,4 +94,6 @@ // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. -#include \ No newline at end of file +#include + + diff --git a/firmware/bia_microddr.X/nbproject/configurations.xml b/firmware/bia_microddr.X/nbproject/configurations.xml index a550ba9..530bfb9 100644 --- a/firmware/bia_microddr.X/nbproject/configurations.xml +++ b/firmware/bia_microddr.X/nbproject/configurations.xml @@ -78,7 +78,21 @@ - ../../bootloader/bia_microddr_bootloader.X/dist/default/production/bia_microddr_bootloader.X.production.hex + + false false @@ -225,7 +239,6 @@ value="Press to browse for a specific firmware version"/> - diff --git a/firmware/bia_microddr.X/nbproject/project.xml b/firmware/bia_microddr.X/nbproject/project.xml index a508aaa..eea1b19 100644 --- a/firmware/bia_microddr.X/nbproject/project.xml +++ b/firmware/bia_microddr.X/nbproject/project.xml @@ -11,7 +11,9 @@ h ISO-8859-1 - + + ../../bootloader/bia_microddr_bootloader.X + ../src ../framework