Skip to content

Commit ad1d763

Browse files
committed
Project updated
1 parent 9a90e6f commit ad1d763

File tree

11 files changed

+813
-804
lines changed

11 files changed

+813
-804
lines changed

.main-meta/main.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"name":"PIC24F_GL_GU_DFP",
2121
"semverRange":"^1.3.38"
2222
},
23+
"configurator": {
24+
"name": "MCC",
25+
"semverRange": ">=4.0.1"
26+
},
2327
"device":{
2428
"metaDataVersion":"1.0.0",
2529
"category":"com.microchip.portal.contentRef",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This is the demo software which runs on PIC24F LCD USB Curiosity Development Boa
2121

2222
- MPLAB® X IDE v5.40 or newer (https://www.microchip.com/mplabx)
2323
- MPLAB® XC16 v1.50 or newer (https://www.microchip.com/xc)
24+
- MPLAB® Code Configurator v4.0.1 (https://www.microchip.com/mplab/mcc)
2425

2526

2627
## Operation

pic24f-lcd-usb-curiosity-lcd-power.X/MyConfig.mc3

Lines changed: 767 additions & 767 deletions
Large diffs are not rendered by default.

pic24f-lcd-usb-curiosity-lcd-power.X/application/battery_operational_mode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ static void BatteryModeTasks(void)
4949
POWER_SetMode(POWER_MODE_LOW);
5050

5151
RTCC_TimeGet(&date_time);
52+
53+
ADC1_Initialize();
54+
ANCFGbits.VBGEN3 = 1;
55+
5256
LCD_DEMO_PrintTime(date_time.tm_hour, date_time.tm_min);
5357

5458
UpdateBatteryStatusIcon();

pic24f-lcd-usb-curiosity-lcd-power.X/application/usb_operational_mode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ limitations under the License.
1717
#include <stdio.h>
1818

1919
#include "timer_1ms.h"
20-
#include "mcc_generated_files/lcd.h"
2120
#include "operational_mode.h"
22-
#include "mcc_generated_files/rtcc.h"
2321
#include "lcd_demo.h"
22+
#include "mcc_generated_files/lcd.h"
23+
#include "mcc_generated_files/rtcc.h"
24+
#include "mcc_generated_files/system.h"
2425

2526
//------------------------------------------------------------------------------
2627
//Application related definitions
2728
//------------------------------------------------------------------------------
28-
#define BUTTON_DEBOUCE_TIME_MS 20
29-
3029
typedef enum
3130
{
3231
BUTTON_COLOR_RED = 0,
@@ -69,6 +68,7 @@ const struct OPERATIONAL_MODE usb_operational_mode = {
6968
//------------------------------------------------------------------------------
7069
static void USBPowerModeTask_Initialize(void)
7170
{
71+
SYSTEM_Initialize();
7272
//Turn on a timer, so to generate periodic interrupts.
7373
TIMER_SetConfiguration(TIMER_CONFIGURATION_1MS);
7474

pic24f-lcd-usb-curiosity-lcd-power.X/mcc_generated_files/mcc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
#include <stdint.h>
5252
#include <stdbool.h>
5353

54-
#include "rtcc.h"
54+
#include "lcd.h"
5555
#include "interrupt_manager.h"
5656
#include "traps.h"
57-
#include "tmr3.h"
5857
#include "adc1.h"
58+
#include "tmr3.h"
59+
#include "rtcc.h"
5960
#include "spi1.h"
60-
#include "lcd.h"
6161

6262
#warning "This file will be removed in future MCC releases. Use system.h instead."
6363

pic24f-lcd-usb-curiosity-lcd-power.X/mcc_generated_files/pin_manager.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ void PIN_MANAGER_Initialize (void)
150150
***************************************************************************/
151151
__builtin_write_OSCCONL(OSCCON & 0xbf); // unlock PPS
152152

153+
RPINR20bits.SDI1R = 0x0018; //RD1->SPI1:SDI1
154+
RPOR11bits.RP23R = 0x0007; //RD2->SPI1:SDO1
153155
RPOR10bits.RP21R = 0x0008; //RG6->SPI1:SCK1
154156
RPINR20bits.SCK1R = 0x0015; //RG6->SPI1:SCK1
155-
RPOR11bits.RP23R = 0x0007; //RD2->SPI1:SDO1
156-
RPINR20bits.SDI1R = 0x0018; //RD1->SPI1:SDI1
157157

158158
__builtin_write_OSCCONL(OSCCON | 0x40); // lock PPS
159159

pic24f-lcd-usb-curiosity-lcd-power.X/mcc_generated_files/rtcc.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
@Description:
1515
This header file provides APIs for driver for RTCC.
1616
Generation Information :
17-
Product Revision : PIC24 / dsPIC33 / PIC32MM MCUs - 1.95-b-SNAPSHOT
18-
Device : PIC24FJ1024GB610
17+
Product Revision : PIC24 / dsPIC33 / PIC32MM MCUs - 1.169.0
18+
Device : PIC24FJ512GU410
1919
The generated drivers are tested against the following:
20-
Compiler : XC16 v1.36
21-
MPLAB : MPLAB X v5.10
20+
Compiler : XC16 v1.50
21+
MPLAB : MPLAB X v5.40
2222
*/
2323

2424
/*
25-
(c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
25+
(c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
2626
software and any derivatives exclusively with Microchip products.
2727
2828
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
@@ -74,24 +74,24 @@ void RTCC_Initialize(void)
7474

7575
if(!RTCCTimeInitialized())
7676
{
77-
// set 2019-04-25 11-51-43
78-
DATEH = 0x1904; // Year/Month
79-
DATEL = 0x2504; // Date/Wday
80-
TIMEH = 0x1151; // hours/minutes
81-
TIMEL = 0x4300; // seconds
77+
// set 2020-09-02 11-44-51
78+
DATEH = 0x2009; // Year/Month
79+
DATEL = 0x203; // Date/Wday
80+
TIMEH = 0x1144; // hours/minutes
81+
TIMEL = 0x5100; // seconds
8282
}
83-
// set 2019-04-25 11-51-43
84-
ALMDATEH = 0x1904; // Year/Month
85-
ALMDATEL = 0x2504; // Date/Wday
86-
ALMTIMEH = 0x1151; // hours/minutes
87-
ALMTIMEL = 0x4300; // seconds
83+
// set 2020-09-02 11-44-51
84+
ALMDATEH = 0x2009; // Year/Month
85+
ALMDATEL = 0x203; // Date/Wday
86+
ALMTIMEH = 0x1144; // hours/minutes
87+
ALMTIMEL = 0x5100; // seconds
8888
// AMASK Every Minute; ALMRPT 255; CHIME enabled; ALRMEN enabled;
8989
RTCCON1H = 0xC3FF;
9090

91-
// PWCPS 1:1; PS 1:1; CLKSEL SOSC; FDIV 0;
92-
RTCCON2L = 0x00;
93-
// DIV 16383;
94-
RTCCON2H = 0x3FFF;
91+
// PWCPS 1:1; PS 1:1; CLKSEL LPRC; FDIV 0;
92+
RTCCON2L = 0x01;
93+
// DIV 15499;
94+
RTCCON2H = 0x3C8B;
9595
// PWCSTAB 0; PWCSAMP 0;
9696
RTCCON3L = 0x00;
9797

pic24f-lcd-usb-curiosity-lcd-power.X/mcc_generated_files/rtcc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
@Description
1414
This header file provides APIs for driver for RTCC.
1515
Generation Information :
16-
Product Revision : PIC24 / dsPIC33 / PIC32MM MCUs - 1.95-b-SNAPSHOT
17-
Device : PIC24FJ1024GB610
16+
Product Revision : PIC24 / dsPIC33 / PIC32MM MCUs - 1.169.0
17+
Device : PIC24FJ512GU410
1818
The generated drivers are tested against the following:
19-
Compiler : XC16 v1.36
20-
MPLAB : MPLAB X v5.10
19+
Compiler : XC16 v1.50
20+
MPLAB : MPLAB X v5.40
2121
*/
2222

2323
/*
24-
(c) 2016 Microchip Technology Inc. and its subsidiaries. You may use this
24+
(c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this
2525
software and any derivatives exclusively with Microchip products.
2626
2727
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER

pic24f-lcd-usb-curiosity-lcd-power.X/mcc_generated_files/system.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@
117117
#include "pin_manager.h"
118118
#include "clock.h"
119119
#include "system.h"
120-
#include "rtcc.h"
120+
#include "lcd.h"
121121
#include "interrupt_manager.h"
122122
#include "traps.h"
123-
#include "tmr3.h"
124123
#include "adc1.h"
124+
#include "tmr3.h"
125+
#include "rtcc.h"
125126
#include "spi1.h"
126-
#include "lcd.h"
127127

128128
void SYSTEM_Initialize(void)
129129
{

0 commit comments

Comments
 (0)