PIC16F17146 Curiosity Nano Development Board Programming

Table of Contents

PIC16F17146 Curiosity Nano Board Programming

Introduction to PIC16F17146

PIC16F17146 is a microcontroller chip that belongs to the PIC16F family, which is renowned for its high performance and low power consumption. It is commonly used in a variety of electronic devices, such as consumer electronics, automotive applications, and industrial control systems. The PIC16F17146 offers a wide range of features, including multiple communication interfaces, analog-to-digital converters, and plenty of memory for storing program instructions and data. This versatile chip enables developers to create sophisticated applications with ease, thanks to its flexible architecture and extensive set of peripherals. For instance, it can be used in automotive systems to control engine functions, or in smart home devices to manage various home automation tasks.

PIC16F17146 Microcontroller (MCU)

PIC16F17146 Features

  • C Compiler Optimized RISC Architecture
  • Enhanced midrange core with 49 instructions, 16 stack levels
  • Flash program memory with self-read/write capability
  • Low-Current Power-on Reset (POR)
  • Programmable Brown-Out Reset (BOR) with Fast Recovery
  • Low-Power Brown-out Reset (LPBOR)
  • Idle and Hibernate Low Power Modes
  • Windowed Watchdog Timer (WWDT)
  • Peripheral Module Disable (PMD)
  • Peripheral Pin Select (PPS)
  • Enhanced power on/off reset
  • Configurable Power-up Timer (PWRT)

PIC16F17146 Specification

AttributeValue
ModelPIC16F17146
ArchitectureRISC
Temperature Range-40°C to 85°C
Frequencyup to 32MHz
Voltage1.8V to 5.5V
Size6.5 x 9.4 x 1.5mm
Memoryup to 28 KB
EEPROMup to 256 Bytes
SRAMup to 2 KB
Timer3 x 16-bit, 3 x 8-bit
PWM4 x 16-bit
CLC4
DAC2 x 8-bit
ADC1 x 12-bit
USART1
I2C1 x 7/10-bit
SPI1
Operational Amplifier1
I/O Portup to 35 pins
Package14-Pin PDIP, SOIC, TSSOP; 16-Pin VQFN; 20-Pin PDIP, SOIC, SSOP, VQFN

How to Program the PIC16F17146 Curiosity Nano Development Board?

2022 09 26 9 40 59
Image Credit: Microchip Technology | Mouser

Requried tools:

  • MPLAB® X Integrated Development Environment (IDE)
  • PIC16F17146 Curiosity Nano Board *1
  • USB Cable * 1

PIC16F17146 Curiosity Nano - LED Blinking Test

At first, download and install the MPLAB X IDE v6.10 from Microchip site:
https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide#

Downloading the MPLAB X IDE v6.10
Downloading the MPLAB X IDE v6.10
Installing MPLAB X IDE v6.10
Installing MPLAB X IDE v6.10

After setup the MPLAB® X IDE, we can see a user-friendly interface. If you are a beginner, there’re some getting started tutorials for you.

Overview of MPLAB X IDE v6.10 User Interface
Overview of MPLAB X IDE v6.10 User Interface

Continue to our project, Click the “File > New Project” to create a new project.

Create a New Project in MPLAB X IDE
Create a New Project in MPLAB X IDE

In this step, we choose “Microchip Embedded > Standalone Project”, it uses an IDE-generated makefile to build your project.

Choose a Standalone Project in MPLAB X IDE
Choose a Standalone Project in MPLAB X IDE

Next, select the device “PIC16F17146” and its’ tool.

Select Device - PIC16F17146 Curiosity Nano
Select Device - PIC16F17146 Curiosity Nano

Select the compiler toolchains for your development board.

Select Compiler Toolchains
Select Compiler Toolchains

After finish the above steps, click the “MCC” buttom to configure the program code.

Open MCC Content Manager
Open MCC Content Manager

Select a content type in “MCC Content Manager Wizard” for your project, if you are not sure which to choose, please see the offical details.

Select MCC Melody
Select MCC Melody

In order to ensure the quick start of MCC function, you can set it to offline mode.

Run MCC in Offline Mode
Run MCC in Offline Mode

Before configuring the I/O, carefully read the PIC16F17146 Curiosity Nano Development Board schematic. From the schematic diagram, we can know that:

I/O lights up when RC1 outputs a low level; IO has no external pull-up resistor, so the on-chip pull-up can be configured, and the port triggers a low-level signal after being pressed.

PIC16F17146 Curiosity Nano MCU Schematic
PIC16F17146 Curiosity Nano MCU Schematic

The final configuration is as follows. This configuration will cause the LED to be turned on by default. If you want to turn off the LED by default, you can check the corresponding Start High, that is, the IO output is high when powered on.

PIC16F17146 Curiosity Nano Input Output (IO) Configuration
PIC16F17146 Curiosity Nano Input Output (IO) Configuration

If we don’t use the I/O interrupt function, the configuration ends here, click “Generate” to generate the code.

Generate the Code of LED Blinking for PIC16F17146 Curiosity Nano
Generate the Code of LED Blinking for PIC16F17146 Curiosity Nano

When writing code, we can use the code auto-completion function, the details are as follows:

Apply Code Completion for PIC16F17146 Curiosity Nano
Apply Code Completion for PIC16F17146 Curiosity Nano

Auto Popup Triggers for C/C++ Identifiers:

				
					.;->;.*;->*;::;new ;A;a;B;b;C;c;D;d;E;e;F;f;G;g;H;h;I;i;J;j;K;k;L;l;M;m;N;n;O;o;P;p;Q;q;R;r;S;s;T;t;U;u;V;v;W;w;X;x;Y;y;Z;z;_;
				
			

Write the code in the body of the loop as follows:

				
					    while(1)
    {
        if(BUTTON_GetValue()==0)
        {
            while(BUTTON_GetValue()==0);
            LED_Toggle();
        }
    }   
				
			

Click the Run button to compile and burn the LED program to the PIC16F17146 Curiosity Nano development board.

Program the Project PIC16F17146 Curiosity Nano
Program the Project PIC16F17146 Curiosity Nano

Next, go back to the MCC tab, add the delay function to the project, just click “Device Resources” > Timer > “DELAY”. And then, click the “Generate” buttom.

Add the Delay Module Code to Project
Add the Delay Module Code to Project

Now, we enter the letter “DE” in main.c and the delay function will appear.

Display Delay Function in main. c
Display Delay Function in main. c

Our delay codes are as follows, one in microseconds and one in milliseconds:

				
					    while(1)
    {
        LED_Toggle();
        DELAY_milliseconds(500);        
    } 
				
			

Save and run this program, you can see that the LED on our development board starts blinking in 1 second cycle.

Reducing Power Consumption with PIC16F17146 Series

Many of today’s embedded designs involve analog systems, whether they include sensors, amplifiers, data converters, or any other analog modules. These designs are often battery-powered for the convenience of consumers in everyday electronics. However, battery life presents a challenge for designers, as analog signals need to be digitized and processed, which is not ideal for battery-powered applications. Below are several ways to reduce the power consumption:

Core Independent Peripherals (CIP)

With the PIC16F17146 series MCU, many analog designs can overcome power consumption challenges. PIC® and AVR® devices offer various Core Independent Peripherals (CIP). CIPs are dedicated hardware that can operate independently of the Central Processing Unit (CPU). Since there are numerous CIPs available on PIC and AVR devices, these can be used to offload other tasks from the CPU while handling sensor interfaces, waveform control, timing/measurement, and more. As a result, the system can run in low-power modes, leading to an overall reduction in design power consumption.

Analog-to-Digital Converter with Computation (ADCC)

One of the analog peripherals that offer energy-saving opportunities is our Analog-to-Digital Converter with Computation (ADCC). The CPU has several power-saving modes available to reduce overall power consumption. One of the energy-saving features provided by the PIC16F17146 series MCU is the SLEEP mode, where most of the MCU is turned off, consuming less power, and reducing measurement noise during ADC conversion. ADCC has a special oscillator that allows hardware to operate in sleep mode. When a wakeup trigger is activated, the CPU resumes operation shortly thereafter.

Idle mode and Doze mode

Other power-saving modes offered by the PIC16F17146 series MCU include Idle mode and Doze mode. In Idle mode, the CPU stops all other operations while the peripherals are active, and in Doze mode, the CPU runs with a reduced instruction clock.

Peripheral Module Disable (PMD)

Peripheral Module Disable (PMD) is another feature on the MCU. Even when not enabled, unused peripheral devices consume a small amount of parasitic power. By enabling PMD, users can enable or disable any unused peripheral devices. By disabling these peripherals, the MCU operates at its lowest possible power state, reducing its total power consumption.

In embedded development, the PIC16F17146 series MCU, along with other Microchip 8-bit MCUs, provides users with numerous options to optimize embedded system power consumption. For more information and to explore how to achieve low-power implementation in your next design, be sure to check out MPLAB® Discover, which houses a wealth of projects, including many low-power applications.

Subscribe

Join our subscribers list to get monthly blog updates, technology news, case studies. We will never send spam, and you can unsubscribe at any time.

About Author

Picture of Aidan Taylor
Aidan Taylor

I am Aidan Taylor and I have over 10 years of experience in the field of PCB Reverse Engineering, PCB design and IC Unlock.

Need Help?

Don't hesitate - Get in touch today to find out how we can help take your project to the next level.

Table of Contents

Scroll to Top
welldone pcb manufacturer

Start to Achieve Your PCB Project