Giter Club home page Giter Club logo

pic16f18446-curiosity-board-tone-generator's Introduction

MCHP

Numerically Controlled Oscillator (NCO) — Tone Generator Using the PIC16F18446 Microcontroller

In this project, the NCO peripheral generates a square-wave with variable frequency in the audible spectrum. The POT1 potentiometer on the Curiosity Board adjusts the frequency. The potentiometer is read using the Analog-to-Digital Converter (ADC) peripheral.

Related Documentation

Software Used

Hardware Used


Operation

To program the microcontroller with this MPLAB X project, follow the steps provided in the How to Program the Microcontroller chapter.

Setup

The following configurations must be made for this project:

  • Clock Control:

    • Clock Source: HFINTOSC
    • HF Internal Clock: 32 MHz
    • Clock Divider: 4


  • Configuration bits:

    • WDT operating mode: WDT disabled


  • NCO1:

    • Enable NCO: Yes
    • NCO Mode: FDC mode
    • Output polarity: Active high
    • Clock Source: FOSC
    • Requested NCO Output Frequency: 1000 Hz


  • ADCC:

    • Enable ADC: Yes
    • Operating Mode: Basic mode
    • Result Alignment: Right
    • Positive Input Channel: ANC0
    • Positive Reference: VDD
    • Negative Reference: VSS
    • Auto-conversion Trigger: Disabled
    • Acquisition Count: 1
    • Clock Source: FOSC
    • Clock Divider: FOSC/32


Pin Configuration Description
RC0 Analog input Potentiometer
RC5 Digital output Buzzer



Demo

Board setup:


Summary

This code example shows how to make a tone generator using the NCO and ADC peripherals.

How to Program the Microcontroller

This chapter demonstrates how to use the MPLAB X IDE to program a PIC® device with an Example_Project.X. This applies to other projects.

  1. Connect the Curiosity Development board to the PC.

  2. Open the Example_Project.X project in MPLAB X IDE.

  3. Set the Example_Project.X project as main project.
    Right click the project in the Projects tab and then Set as Main Project.

  4. Clean and build the Example_Project.X project.
    Right click the Example_Project.X project and select Clean and Build.

  5. Select Starter Kits (PKOB) in the Connected Hardware Tool section of the project settings:
    Right click the project and Properties.
    Click the arrow under the Connected Hardware Tool, and from the dropdown, select Starter Kits (PKOB) by clicking the SN.
    Click Apply and then OK.

  6. Program the project to the microcontroller.
    Right click the project and then Make and Program Device.


pic16f18446-curiosity-board-tone-generator's People

Contributors

aku-work avatar gauranggunde avatar iustinian-mchp avatar leona-pop avatar mariusnicolae avatar mchpcristianpop avatar shaimahusain avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

picdew uttambasu

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.