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
MPAE-18679 - grammatical and formatting updates to README.MD, replacing some images with higher quality and resizing to meet formatting guidelines, upgrading MPLABX project to latest versions
Copy file name to clipboardExpand all lines: README.md
+47-37Lines changed: 47 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,13 @@
8
8
</picture>
9
9
</a>
10
10
11
-
# How to Set Up a Curiosity Nano Explorer 25CSM04 EEPROM using a PIC18F56Q24 MCU
11
+
# Interfacing the 25CSM04 EEPROM on the Curiosity Nano Explorer development board using a PIC18F56Q24 Curiosity Nano
12
12
13
-
This example demonstrates the setup of 25CSM04 EEPROM on a PIC18F56Q24 microcontroller (MCU) . The 25CSM04 is an 4M bit Serial Peripheral Interface (SPI) serial EEPROM.
13
+
This example demonstrates the setup and configuration of the 25CSM04 EEPROM using the PIC18F56Q24 microcontroller. The 25CSM04 is a 4 Mbit Serial Peripheral Interface (SPI) serial EEPROM, designed to provide reliable, high-density non-volatile memory storage. By interfacing the 25CSM04 using the PIC18F56Q24 Curiosity Nano, this example highlights how to efficiently store and retrieve data using SPI communication, making it ideal for applications that require robust data retention and fast access times.
14
14
15
15
## Related Documentation
16
16
17
-
-[25CSM04 Data sheet](https://ww1.microchip.com/downloads/aemDocuments/documents/MPD/ProductDocuments/DataSheets/25CSM04-4-Mbit-SPI-Serial-EEPROM-with-128-Bit-Serial-Number-and-Enhanced-Write-Protection-20005817D.pdf)
17
+
-[25CSM04 Data sheet](https://ww1.microchip.com/downloads/aemDocuments/documents/MPD/ProductDocuments/DataSheets/25CSM04-4-Mbit-SPI-Serial-EEPROM-with-128-Bit-Serial-Number-and-Enhanced-Write-Protection-20005817D.pdf)
18
18
-[PIC18F56Q24 Curiosity Nano User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/PIC18F56Q24-CNANO-UserGuide-DS50003618.pdf)
19
19
-[Curiosity Nano Explorer User Guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf)
20
20
@@ -28,67 +28,77 @@ This example demonstrates the setup of 25CSM04 EEPROM on a PIC18F56Q24 microcont
The [user guide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf) for the Curiosity Explorer Nano board provides the pins mapping information neede for this example.
39
+
The [userguide](https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/UserGuides/CNANO-Explorer-UserGuide-DS50003716.pdf) for the Curiosity Explorer Nano board provides detailed information about the pin mapping between the Curiosity Explorer board and the PIC18F56Q24 Curiosity Nano board being used in this example.
45
40
46
41

47
42
48
-
From the diagram above, SPI CS, SPI MOSI, SPI MISO and SPI SCK will be used to communicate with the 25CSM04 I2C EEPROM.
49
-
43
+
Based on the diagram above from the Curiosity Explorer users guide, the SPI CS, SPI MOSI, SPI MISO, and SPI SCK lines will be used to communicate with the 25CSM04 SPI EEPROM.
44
+
45
+
## MCC Setup
46
+
The detailed step by step instructions required to recreate this example are listed below:
50
47
51
-
## MCC Setup
52
-
All instructions required to recreate this example are listed below.
48
+
Begin by setting up UART to enable data display on the terminal.
53
49
54
-
First is UART so that data can be seen on the terminal.
55
50
### UART Setup
56
-
- Once MCC is open, add the UART driver and select UART2 in dependency selector
57
-
- Make sure Redirect Printf to UART is enabled<br>
51
+
52
+
The UART configuration should appear as shown below.
53
+
- With MCC open, add the UART driver and select UART2 in the dependency selector.
54
+
- Ensure that "Redirect Printf to UART" is enabled.
55
+
- The UART configuration should appear as shown below.<br>
56
+
58
57

59
-
- The UART2PLIB will be left as is
58
+
59
+
- No changes are required for UART2PLIB
60
+
60
61
<br><br>
61
62
62
-
### SPI Setup
63
-
- Add SPI driver and select SPI1 as SPI Host PLIB Selector
64
-
- Set the Requested speed to 4000 KHz and make sure the SPI Interrupt is enabled
65
-
- The SPI configuration can also be found in the image below<br>
63
+
### SPI Setup
64
+
- Add the SPI driver and select SPI1 as the SPI Host PLIB Selector.
65
+
- Set the requested speed to 4000 kHz and ensure that the SPI interrupt is enabled.
66
+
- The SPI configuration is also shown in the image below.
67
+
66
68
<br>
69
+
67
70

68
-
<br><br>
71
+
72
+
<br>
69
73
70
74
### Pins Setup
71
-
- Select the UART and SPI pins from the diagram below
75
+
- Select the appropriate UART and SPI pins as indicated in the diagram below.
- The MCC configuration for the pins is shown below.
80
+
74
81
<br>
82
+
75
83
<br>
76
-
<br><br>
77
84
78
-
- Now you can click on <b>"Generate"</b> and thats all you need from MCC.
79
-
- Add the `25CSM04.c` and `25CSM04.h` driver code to your project.
80
-
- Modify the `main.c` according the screenshot below. <br>
85
+
<br>
86
+
87
+
- Click on "Generate" to complete the configuration in MCC.
88
+
- Add the `25CSM04.c` and `25CSM04.h` driver code to the project.
89
+
- Modify `main.c` as shown in the screenshot below.
90
+
81
91
<br>
82
-
- This code snippet calls writeReadByteTest(0x0000), which performs consecutive read and write checks from address 0x0000.
83
-
- It displays the write and read values and verifies whether these value match.
92
+
93
+
- This code snippet calls writeReadByteTest(0x0000), which performs consecutive read and write operations starting from address 0x0000.
94
+
- The code displays the written and read values and verifies whether these values match.
84
95
85
96
## Operation
86
97
87
-
After you program the device, you can see the output in the terminal, whether the tests have passed or failed.<br>
98
+
After programming the device, the terminal displays the output indicating whether the tests have passed or failed.
99
+
88
100

89
101
90
102
## Summary
91
103
92
-
This demo shows how to interface the 25CSM04 SPI EEPROM on the Curiosity Nano Explorer board using a PIC18F56Q24.
93
-
94
-
The demo has few tests where it writes to a specific location and it reads the same address to verify whether the read and write operations work.
104
+
This demonstration shows how to interface the 25CSM04 SPI EEPROM on the Curiosity Nano Explorer board using a PIC18F56Q24 microcontroller. In this example, several tests are performed to validate the functionality of the EEPROM interface. Data is written to a specific memory location, and then read back from the same address to ensure that both the write and read operations are working correctly. The results of these tests are displayed on the terminal, providing clear feedback on the success or failure of each operation.
0 commit comments