You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge in MCU16CE/dspic33ck-curiosity-data-eeprom-emulation-demo from develop to master
* commit '038249012d82fc7e8fa06a7e2195db6c57e3281d':
removed redundant information
fixed typo
Addressed review comments
Added information regarding the DEE size constraint if hot swap is required
Addressed review comments , added details to readme
Addressed review comments
Fixed typos
Updated libraries to latest verions
updated metadata
Updated project
Dual panel project added
updated jenkinsfile
@@ -10,23 +10,23 @@ Microchip Technology Inc., has expanded its product portfolio to include a wide
10
10
Many applications store nonvolatile information in the Flash program memory using table read and write operations. Applications that need to frequently update these data may have greater endurance requirements
11
11
than the specified Flash endurance for the MCU/Digital Signal Controller (DSC) devices.
12
12
13
-
The alternate solution of using an external, serial EEPROM device may not be appropriate for cost-sensitive or pin-constrained applications.
13
+
The alternate solution of using an external, serial EEPROM device may not be appropriate for cost-sensitive or pin-constrained applications.
14
14
15
15
This 16-Bit Data EEPROM Emulation library presents a third alternative that addresses these issues. This library features an interface similar to an internal data EEPROM, which
16
16
uses available program memory and can improve endurance by a factor as high as 500.
17
17
18
-
This code example demonstrate the usage of 16-Bit Data EEPROM Emulation Library.
18
+
This code example demonstrates the usage of 16-Bit Data EEPROM Emulation Library.
- Emulating Data EEPROM for PIC18 and PIC24 MCUs and dsPIC33 DSCs (https://www.microchip.com/en-us/application-notes/an1095)
24
24
25
25
26
-
## Software Used
26
+
## Software Used
27
27
28
-
- MPLAB® X IDE v6.00 or newer (https://www.microchip.com/mplabx)
29
-
- MPLAB® XC16 v2.00 or newer (https://www.microchip.com/xc)
28
+
- MPLAB® X IDE v6.15 or newer (https://www.microchip.com/mplabx)
29
+
- MPLAB® XC16 v2.00 or newer (https://www.microchip.com/xc)
30
30
- Any of the serial terminal application. Example: Tera Term (https://ttssh2.osdn.jp/index.html.en)
31
31
- 16-bit Data EEPROM Emulation Library (DEE) for PIC24 MCUs and dsPIC33 DSCs (https://www.microchip.com/en-us/software-library/16-bit_data_eeprom_emulation)
32
32
@@ -36,23 +36,50 @@ This code example demonstrate the usage of 16-Bit Data EEPROM Emulation Library.
36
36
- dsPIC33CK Curiosity Development Board (https://www.microchip.com/DM330030)
37
37
- Micro USB Cable
38
38
39
-
39
+
**Note:** The word panel and partition means the same thing and used interchangeably in this document.
40
40
41
41
## Operation
42
+
There are 2 examples in this repository. Example1 uses single panel and Example2 demonstrates dual panel capability of DEE.
43
+
Using dual panel is useful to not cause CPU execution stall during the normal runtime mode when the applications uses the DEE, which would be stored in the inactive partition.
42
44
43
-
This demo runs the Data EEPROM Emulation , if emulation is succesful then prints a message saying "Data EEPROM Emulation successful. Value at address 0 is 1024 and address1 is 1025"
44
-
If emulation fails it prints a message saying "Data EEPROM Emulation failed".
45
+
## Example1:
46
+
This demo runs the Data EEPROM Emulation , if emulation is successful then prints a message to the serial terminal saying "Data EEPROM Emulation successful. Value at address 0 is 1024 and address1 is 1025"
47
+
If emulation fails it prints a message to the serial terminal saying "Data EEPROM Emulation failed".
45
48
46
-
## Accessing 16-Bit Data EEPROM Emulation Library
49
+
## Example2:
50
+
There are 2 MPLABX projects under folder "dspic33ck-curiosity-dual-panel-dee-demo". One project for programming the first partition another for programming the second partition.
47
51
48
-
*Note:* More MCC Melody devices support will be added in future releases.
52
+
In a typical field scenario, boot-loader will help to do a live update i.e. boot-loader will help to download the new application to the secondary
53
+
partition and this new application will be configured such that on reboot, application in secondary partition will execute(secondary partition
54
+
becomes primary or active partition).
49
55
50
-
| Device Family | Procedure |
51
-
| ----------- | ----------- |
52
-
| "CK" Family of devices| 1. Create project <br> 2. Launch MCC <br> 3. Select "MCC Melody" <br> <imgsrc="images/melodySelection.jpg"width="600"> <br> 4. "16-Bit Data EEPROM Emulation Library "will be available under "Libraries" <br> <imgsrc="images/DEEMelody.jpg"width="600"> |
53
-
| All other devices except "CK" device family | 1. Make sure https://ww1.microchip.com/downloads/en/DeviceDoc/script-1.29.3.mc3lib is installed <br> 2. Create project <br> 3. Launch MCC <br> 4. Select "Classic MCC" <br> <imgsrc="images/classicSelection.jpg"width="600"><br> 5. Switch core version to "5.2.1" <br> <imgsrc="images/coreSwitch.jpg"width="600"> <br> 6. "16-Bit Data EEPROM Emulation Library" will be available under "Libraries" <br> <imgsrc="images/DEEClassic.jpg"width="600"> |
56
+
If we want to program both the partitions of the microcontroller, MPLABX provides an option to create an unified hex file for programming both program memory partitions with different applications. In order to do that users have to configure one MPLABX project with XC16(Global Options) ->Partition as "Partition One/Active" and another MPLABX project with XC16(Global Options) ->Partition as "Partition Two/Inactive". Then second MPLABX project needs to be linked to first MPLABX project as loadable as shown below.
57
+
58
+

59
+
60
+
The projects in this example are already linked so that when dee-dual-panel-demo-partition1.X is built and programmed, it programs both the partitions.
61
+
62
+
After programming, the application in the first partition(active partition) will execute and DEE library will use the inactive partition(second partition) to store the DEE data. User will see the following data on the serial terminal on successful emulation,
54
63
64
+

55
65
66
+
After some time, once the emulation is completed and output is displayed, user has to reset the board. The application in the first partition, configures the configuration bits BSEQ and IBSEQ in the second partition, such that on reset second partition becomes the active partition. On resetting the board
67
+
application in the second partition will execute. DEE Library will check if there is any data available in the active partition from the previous iteration, if so it copies the data to the inactive partition(first partition), delete the previous iteration data from the active partition and continue with the emulation.
56
68
69
+
The following data will be displayed on successful emulation.
57
70
71
+

72
+
73
+
## Important Note
74
+
If there is no requirement for partition switching, the entire second partition(inactive partition) can be used for storing the DEE data. If partition switching is required make sure that free space in executable partition(active partition) is larger than the required DEE data structure size.
75
+
76
+
## Accessing 16-Bit Data EEPROM Emulation Library
77
+
78
+
*Note:* More MCC Melody devices support will be added in future releases.
79
+
80
+
| Device Family | Procedure |
81
+
| ----------- | ----------- |
82
+
| Devices supported on Melody| 1. Create project <br> 2. Launch MCC <br> 3. Select "MCC Melody" <br> <imgsrc="images/melodySelection.jpg"width="600"> <br> 4. "16-Bit Data EEPROM Emulation Library "will be available under "Libraries" <br> <imgsrc="images/DEEMelody.jpg"width="600"> |
83
+
| Devices not supported on Melody | 1. Make sure https://ww1.microchip.com/downloads/en/DeviceDoc/script-1.29.3.mc3lib is installed <br> 2. Create project <br> 3. Launch MCC <br> 4. Select "Classic MCC" <br> <imgsrc="images/classicSelection.jpg"width="600"><br> 5. Switch core version to "5.2.1" <br> <imgsrc="images/coreSwitch.jpg"width="600"> <br> 6. "16-Bit Data EEPROM Emulation Library" will be available under "Libraries" <br> <imgsrc="images/DEEClassic.jpg"width="600"> |
58
84
85
+
For more information refer: https://www.microchip.com/en-us/software-library/dspic33-pic24-data-eeprom-emulation
0 commit comments