Giter Site home page Giter Site logo

microchip-pic-avr-examples / pic18f47q10-cnano-gpio-wake-up-mcc Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 21.47 MB

This repository provides an example of MCC-generated code for a Wake-Up from Sleep procedure. This example shows how to obtain less power consumption by putting the device in the Sleep mode and waking it up using the IOC, with a button controlling the input pin value.

Makefile 9.14% C 90.86%
pic18f47q10gpio pic18f-q10 pic18f47q10

pic18f47q10-cnano-gpio-wake-up-mcc's Introduction

MCHP

PIC18F47Q10 GPIO Wake Up

Objective

The PIC18F47Q10 provides multiple PORT modules.

This example presents how to put the microcontroller in Sleep mode and wake it up using the IOC. When a falling edge is detected on the input pin, the device will wake up. The exit from Sleep mode is signaled using an LED. If the microcontroller wakes up, it will turn the LED on, keep the LED on for 100 ms, and then turn it off. The Sleep mode is used to provide power efficiency.

For this example, the RA0 pin is configured as input with IOC enabled on falling edge and connected to a button, and the RE0 pin is configured as output and connected to an LED.

Related Documentation

Software Used

Hardware Used

Setup

The PIC18F47Q10 Curiosity Nano Development Board is used as the test platform.


The following configurations must be made for this project:

  • Clock:
    • Oscillator Select: HFINTOSC
    • HF Internal Clock: Select 1_MHz
    • Clock Divider: 1
  • Watchdog Timer: disabled
  • Low-voltage Programming: enabled

The following configurations must be made for this project:

Pin Configuration
RA0 Digital Input
RE0 (LED0) Output

The RA0 will be connected to the user button using a wire.

Operation

  1. Connect the board to the PC.

  2. Open the pic18f47q10-cnano-gpio-wake-up-mcc.X project in MPLAB® X IDE.

  3. Set pic18f47q10-cnano-gpio-wake-up-mcc.X project as main project. Right click on the project in the Projects tab and click Set as Main Project:


  1. Select the PIC18F47Q10 Curiosity Nano in the Hardware Tool section of the project settings:
  • Right click on the project and click Properties;
  • Select the PIC18F47Q10 Curiosity Nano (click on the SN) in the Hardware Tool tab and then click OK:


  1. Program the project to the board: right click on the project and click Make and Program Device:


Result:

Demo

Summary

This project showcases how the General Purpose Input/Output pins on the PIC18F47Q10 can be used as inputs and outputs. The device is put in Sleep mode and an interrupt is used to wake it up.

pic18f47q10-cnano-gpio-wake-up-mcc's People

Contributors

aku-work avatar cristiansabiuta avatar cristinaionescu avatar mariusnicolae avatar mchpcristianpop avatar

Watchers

 avatar  avatar  avatar

Forkers

picdew

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.