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
"shortDescription": "This example highlights usage of PIC MCU as I/O expander using UART interface. The PIC16F15276 MCU acts as host and is used to control seven segment display. Compatible PIC16F152xx family of MCUs are: PIC16F15244, PIC16F15254, PIC16F15276.",
Copy file name to clipboardExpand all lines: README.md
+30-31Lines changed: 30 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ This code example demonstrates usage of PIC16F15276 microcontroller as a I/O exp
8
8
9
9
## Introduction
10
10
11
-
The PIC16F152xx family of microcontrollers are available in packages for various embedded applications. The PIC16F15276 simplified feature set includes Peripheral Pin Select (PPS), digital communication peripherals, timers, Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART). In real time applications, EUSART, can be configured as a full-duplex asynchronous system or half-duplex synchronous system. Full-Duplex mode is useful for communications with peripheral systems, such as CRT terminals and personal computers. Half-Duplex Synchronous mode is intended for communications with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs or other microcontrollers. Several embedded applications use I/O expander to add the additional I/O pins required for the main microcontroller while interfacing standalone IC modules, display modules, for various features implementation. This code example demonstrates implementation of I/O Expander using EUSART peripheral and I/O pins of the PIC16F15276 microcontroller.
11
+
The PIC16F152xx family of microcontrollers are available in packages for various embedded applications. The PIC16F15276 simplified feature set includes Peripheral Pin Select (PPS), digital communication peripherals, timers, Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART). In real time applications, EUSART can be configured as a full-duplex asynchronous system or half-duplex synchronous system. Full-Duplex mode is useful for communications with peripheral systems, such as CRT terminals and personal computers. Half-Duplex Synchronous mode is intended for communications with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs or other microcontrollers. Several embedded applications use I/O expander to add the additional I/O pins required for the main microcontroller while interfacing standalone IC modules, display modules, for various features implementation. This code example demonstrates implementation of I/O Expander using EUSART peripheral and I/O pins of the PIC16F15276 microcontroller.
12
12
13
13
Refer code example [UART I/O Expander Implementation using PIC16F15276](https://github.com/microchip-pic-avr-examples/pic16f15276-cnano-uart-io-expander-client-mplab-mcc.git) for more details about the client device implementation.
14
14
@@ -23,7 +23,7 @@ Refer code example [UART I/O Expander Implementation using PIC16F15276](https://
23
23
24
24
## Description
25
25
26
-
In this code example, host microcontroller expects to display the numbers on Seven Segment Display (SSD). To interface SSD with the host device, it requires minimum 7 general purpose I/O pins. To minimize the usage of I/O pins on host, a secondary microcontroller is used as client for driving the SSD and, UART serial communication interface is used for communication between both the host and client devices. To establish communication between host device and client device UART serial communication interface is used.
26
+
In this code example, host microcontroller expects to display the numbers on Seven Segment Display (SSD). To interface SSD with the host device, it requires minimum 7 general purpose I/O pins. To minimize the usage of I/O pins on host, a secondary microcontroller is used as client for driving the SSD and, UART serial communication interface to communicate between the host and client device. To establish communication between the host and client device, UART serial communication interface is used.
27
27
28
28
For the ease of demonstration, this code example uses PIC16F15276 microcontroller as host microcontroller and another PIC16F15276 microcontroller as client microcontroller. Also, the code example uses PIC16F15276 Curiosity nano development boards for the demonstration.
29
29
@@ -86,18 +86,18 @@ Resistor ( R ) = (V<sub>in</sub> – V<sub>f</sub> ) / ( I<sub>f</sub> ) = 140 o
86
86
87
87
Microchip’s free IDE, compiler and graphical code generators are used throughout the application firmware development. Following are the tools used for this demo application:
88
88
89
-
* MPLAB® X IDE[v6.00.0 or newer](https://www.microchip.com/mplab/mplab-x-ide)
90
-
*XC8 Compiler [v2.36.0 or newer](https://www.microchip.com/mplab/compilers)
*[Curiosity Nano Base for Click Boards<sup>TM</sup>](https://www.microchip.com/en-us/development-tool/AC164162)
101
101
*[PROTO Xplained Pro Extension Kit](https://www.microchip.com/en-us/development-tool/ATPROTO1-XPRO"PROTO Xplained Pro Extension Kit")
102
102
* Seven Segment Display
103
103
@@ -118,7 +118,7 @@ The following figure consists of populated PROTO Xplained Pro extension kit, Cur
118
118
<br>Figure 4: Hardware Setup <br>
119
119
</p>
120
120
121
-
***Note: In order to use on-board mechanical switch, timer is used to avoid the debouncing. Thereby, timer input pin RC3 and pin RB5 (on-board switch), need to be shorted using a jumper. The usage of jumper is required as RB5 pin cannot be selected as timer input through PPS feature of the PIC16F15276 microcontroller.***
121
+
***Note: In order to use on-board mechanical switch on host device, timer is used to avoid the debouncing. Thereby, timer input pin RC3 and pin RB5 (on-board switch), need to be shorted using a jumper. The usage of jumper is required as RB5 pin cannot be selected as timer input through PPS feature of the PIC16F15276 microcontroller.***
122
122
123
123
## Operation
124
124
@@ -135,28 +135,27 @@ In many real-world embedded applications, the microcontroller requires to interf
135
135
136
136
## Appendix
137
137
138
-
MCC – MPLAB<sup>®</sup> Code Configurator is a graphical programming environment that generates seamless, easy to understand C code to give a head start to the project, saving the designer’s time to initialize and configure all the modules, and to go through the datasheets. Using an instructive interface, it enables and configures all peripherals and functions specific to the application requirements.
138
+
MPLAB<sup>®</sup> Code Configurator is a graphical programming environment that generates seamless, easy to understand C code to give a head start to the project, saving the designer’s time to initialize and configure all the modules, and to go through the datasheets. Using an instructive interface, it enables and configures all peripherals and functions specific to the application requirements.
139
139
140
140
**Start by creating a new Project and open MCC**
141
-
- Go to File > New Project
142
-
- Select Microchip Embedded > Standalone Project
143
-
- Enter the device name. In this case, select PIC16F15276 device
141
+
- Go to **File** and click **New Project**
142
+
- Select **Microchip Embedded** and click **Standalone Project**
143
+
- Enter the device name, in this case, PIC16F15276
144
144
- Name the project
145
145
- Launch MCC tool by navigating to ***“Tools -> Embedded -> MPLAB Code Configurator v4: Open/Close”*** . Alternatively, click the MCC icon to launch the MCC tool.
146
146
147
147
## System Configuration
148
148
149
149
- Configure Clock
150
150
151
-
Open "Clock Control" setup present under "System" dropdown menu in "Project Resources" tab. Host and the client device will be configured with same configuration as given below.
151
+
Open **Clock Control** setup present under "System" dropdown menu in **Project Resources** tab. Host and the client device will be configured with same configuration as given below.
152
152
153
-
Set "Clock Source" as "HFINTOSC"
154
-
-- Set "HF Internal Clock" as "8_MHz"
155
-
-- Enable low power programming checkbox
153
+
- Set Clock Source as HFINTOSC
154
+
- Set HF Internal Clock as 8_MHz
156
155
157
-
The system configuration window of MCC is used for MCU oscillator, Watchdog timer and low voltage programming configuration. The Watchdog timer is disabled in the application.
156
+
The **configurations Bits**(**Project Resources** -> **System**) window in MCC is used for MCU oscillator, Watchdog timer and low voltage programming configuration. The Watchdog timer is disabled in the application.
158
157
159
-
The following figure shows the system configuration setting in MCC tool.
158
+
The following figure shows the clock configuration setting in MCC tool.
0 commit comments