Transcription

2 What is a Microcontroller? A Microcontroller (MCU) is an integrated circuit including all parts of complete computer. In includes: CPU Built-in oscillator for clock source Flash memory (in the order of KBytes/MBytes), to hold the program RAM, in the order of KBytes/MBytes Several I/O peripherals for both generic and specific purposes In its PINs, a microcontroller does not provides the BUS (as in normal CPUs) but the I/O peripherals.

6 How are microcontrollers programmed? Generally, they run the software in bare metal, i.e. without an operating system. In some cases, they host a very small operating system (e.g. FreeRTOS) able to offer minimum functionalities: a simple driver layer, no MMU, cooperative or preemptive scheduling When the system is programmed in bare metal, the developer has to take care also of programming I/O peripherals

7 How are microcontrollers programmed? A specific term exists for MCU software: firmware Usually they are programmed in C or assembly through a development tool running in a host computer which includes: A compiler A hardware tool to transfer the code into the flash memory An in-circuit debugger (optional) When the firmware is written in C, the MCU, at power-up, runs the program directly from themain() function.

8 Microcontrollers: manufacturers and families There are many manufacturers of microcontrollers: Microchip Atmel Freescale STMicroelectronics Intel... A specific microcontroller (the specific chip) is identified by: The core, that is the CPU: 8-bit, 16-bit, 32-bit, etc. The core usually denotes also the family The amount of flash memory and RAM The peripherals which are included in the chip

9 The MCU we will use! We will use the MCUPIC18F25K22 by Microchip. 8-bit ARM-Cortex CPU CPU clock from 8 to 64 MHz 32K of flash memory 1532 bytes of RAM Several peripherals (digital, ADC, timers, SPI, I 2 C)

10 The MCU we will use! We will use a MCU of thestm32fx family by STMicroelectronics. 32-bit ARM-Cortex CPU CPU clock from 80 to 240 MHz Flash memory from 512K to 2M RAM from 512K to 2M Several peripherals (digital, ADC, timers, SPI, I 2 C, CAN, USB, Ethernet)

11 ThePIC18F25K22 The figure shows the pinout of the PIC18F25K22 microcontroller: VDD, VSS. These are the pins to power-up the MCU (the voltage used is 5V or 3.3V) MCLR. The Master Clear (RESET) pin; connecting this pin to ground (VSS, 0V) causes a CPU reset. All other pins are relative to I/O peripherals.

12 How can I use/program a MCU? Using MCU implies to use its peripherals Thus, we must learn how to program in C the MCU peripherals A certain region of the system memory is reserved for peripherals In this region, each memory location has a specific meaning These memory locations are called Special Function Registers (SFRs) Writing a data into a SFR implies to program the behaviour of a specific peripheral

13 Some SFR of thepic18f25k22 The meaning of each SFR is reported in the programmer s manual of the specific MCU

14 How can I access SFR? Using C pointers!! But... The Microchip C compiler exports a global variable for each SFR, whose name matches the name of the SFR. Therefore, a SFR can be accessed, in C program, by using the relevant variable directly.

18 LAP1 Program Elements of circuit analysis; basics of digital circuits The digital I/O port of an MCU Programming models in MCU environments Managing time in MCUs: how to program and use timers Interrupt Management and programming Communication Interfaces in MCU: UART, I 2 C, SPI The Analog-to-Digital Converter (ADC) Case-Studies Special signal generation: PWM How to drive a servo-motor How to drive a DC motor How to interface digital and analog sensors How to interface I 2 C/SPI sensors

C8051F020 Utilization in an Embedded Digital Design Project Course Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia Abstract In this paper, the utilization of the C8051F020 in an

MICROCONTROLLER BASED TEMPERATURE INDICATOR SUBMITTED BY: 1 INTRODUCTION The aim of this project is to design an ambient temperature measurement circuit. The motivation for doing this project is the fact

PIC MICROCONTROLLERS FOR DIGITAL FILTER IMPLEMENTATION There are many devices using which we can implement the digital filter hardware. Gone are the days where we still use discrete components to implement

2.0 Command and Data Handling Subsystem The Command and Data Handling Subsystem is the brain of the whole autonomous CubeSat. The C&DH system consists of an Onboard Computer, OBC, which controls the operation

R Arduino Due Arduino Due Front Arduino Due Back Overview The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU (datasheet). It is the first Arduino board based on a 32-bit

Chapter 2 Features of Embedded System Abstract This chapter will introduce the basic elements of embedded systems (or dedicated systems). The integrated control systems represent one of the areas of modern

Lecture N -1- PHYS 3330 Microcontrollers If you need more than a handful of logic gates to accomplish the task at hand, you likely should use a microcontroller instead of discrete logic gates 1. Microcontrollers

EMBEDDED SYSTEM BASICS AND APPLICATION TOPICS TO BE DISCUSSED System Embedded System Components Classifications Processors Other Hardware Software Applications 2 INTRODUCTION What is a system? A system

An Introduction to MPLAB Integrated Development Environment 2004 Microchip Technology Incorporated An introduction to MPLAB Integrated Development Environment Slide 1 This seminar is an introduction to

SD Card Projects Using the PIC Microcontroller Dogan Ibrahim AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO Newnes is an imprint of Elsevier Newnes

MICROCONTROLLERS Overview A microcontroller (uc) is a small, lightweight CPU which is usually combined with on-board memory and peripherals Compact and low power (relatively) Often used as a simple hardware

A+ Guide to Managing and Maintaining Your PC, 7e Chapter 1 Introducing Hardware Objectives Learn that a computer requires both hardware and software to work Learn about the many different hardware components

Driving LEDs with a PIC Microcontroller Application Note Introduction Nowadays, applications increasingly make use of LEDs as a replacement for traditional light bulbs. For example, LEDs are frequently

Abstract THE TRANSITION FROM THE 8085 TO THE MODERN WORLD James S. Finne, PE Assistant Professor, Engineering Technology Middlesex County College John Carpinelli, PhD Associate Professor, Electrical and

Simplifying Crossbar and Peripheral Pin-Out Configuration for 32-Bit ARM-Based Microcontrollers The process of evaluating 32-bit microcontroller options for a new embedded design can be tedious and time-consuming.

Application note Peripheral interconnections on STM32F401 and STM32F411 lines Introduction On top of the highest performance and the lowest power consumption of the STM32F4 family, STM32F401/411 peripherals

SKP16C62P Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR INTRODUCTION This Project "Automatic Night Lamp with Morning Alarm" was developed using Microprocessor. It is the Heart of the system. The sensors

Driving LEDs with a PIC Microcontroller Application Note Introduction Nowadays, applications increasingly make use of LEDs as a replacement for traditional light bulbs. For example, LEDs are frequently

Nurve Networks Chameleon AVR Credit Card Sized Computers GENERAL OVERVIEW The Chameleon AVR 8-Bit is the evolution of the high performance, small footprint, application development board. Similar to the

Hello, and welcome to this presentation of the STM32L4 reset and clock controller. 1 The STM32L4 reset and clock controller manages system and peripheral clocks. STM32L4 devices embed three internal oscillators,

GAS LEAKAGE DETECTION & AUTO ON-OFF GAS SYSTEM This system helps you to upgrade your safety standards, comply statutory requirements on environmental commitments and most important and basic function being

APPLICATION NOTE M16C/26 1.0 Abstract The following article describes using a synchronous serial port and the FoUSB (Flash-over-USB ) Programmer application to program the user flash memory of the M16C/26

Making Programmer and Basic target. AVR Tutorial Series. www.extremeelectronics.co.in PART 3 Now u know what tools are required for MCU based development. And you are familiar with their uses. Now time

USER GUIDE EDBG Description The Atmel Embedded Debugger (EDBG) is an onboard debugger for integration into development kits with Atmel MCUs. In addition to programming and debugging support through Atmel

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK Because Arduino that is the development project on AVR MCU as Open Source has been published, it is popular and widespread shortly.

User manual Developing and debugging your STM8S-DISCOVERY application code Introduction This document complements the information in the STM8S datasheets by describing the software environment and development