0% found this document useful (0 votes)
36 views19 pages

Icrocontrollers AND Rogramming: By: Akanksha Patel

This document provides an overview of microcontrollers and programming. It discusses that microcontrollers include a processor, memory and peripherals and act as the brain of a robot. It also describes development boards like Arduino that provide necessary circuitry for control tasks. Specifically, it outlines the AVR microcontroller, ports, registers like DDRx, PORTx and PINx used for input/output operations. Examples provided include using a bump sensor and analog to digital converter to read a potentiometer.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views19 pages

Icrocontrollers AND Rogramming: By: Akanksha Patel

This document provides an overview of microcontrollers and programming. It discusses that microcontrollers include a processor, memory and peripherals and act as the brain of a robot. It also describes development boards like Arduino that provide necessary circuitry for control tasks. Specifically, it outlines the AVR microcontroller, ports, registers like DDRx, PORTx and PINx used for input/output operations. Examples provided include using a bump sensor and analog to digital converter to read a potentiometer.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

MICROCONTROLLERS AND PROGRAMMING

By: Akanksha Patel

MICROCONTROLLERS
Microcontroller is a small computer placed on a single IC. It includes processor, memory and other peripherals. It acts as the brain of the robot and takes decisions according to the programming done by the user

DEVELOPMENT BOARDS

Printed circuit boards that provide all the circuitry necessary for a useful control task like I/O circuit, clock generator, stored program etc. We use two type of development boards:
AVR Arduino

AVR

AVR is a microcontroller manufactured by Atmel We use atmega16A microcontroller. Atmega 16A is used in AVR and atmega 328 is used in arduino.

PORTS

Ports : Points of transferring data on the MCU Present as pins on the IC. Ports are named as Port A, Port B, Port C and Port D. Other pins are used for power supply, clock etc.

ATMEGA16A

COMPILER
Avr studio It converts the code written in c in hex file(machine language).

PROGRAMMER
Programmer(matches the frequency of computer with the board) It could be inbuild (arduino) or we will have to use it externally(AVR) .

WHAT TO INCLUDE IN THE PROGRAM?

Define clock (max 16MHz) Libraries main() while(1)

BASIC I/O OPERATIONS

Working with ports:

DDRX REGISTER
First define the pins as input/output. DDRx = 0b01110101;

PORTX REGISTER

It has two functions:


It sets the pins high/low (depending on 1/0) if the pin is set as output. It manages the internal pull registers.

PINX REGISTER

Reading the status of an input pin

EXAMPLE: BUMP SENSOR

USING ANALOG TO DIGITAL CONVERTER


ADC: Converts analog signals to understandable digital signals In avr, Port A has been specified for ADC.

PULSE WIDTH MODULATION


PWM: Technique of getting analog result with digital means. timerinit() In avr, D4 and D5 pins are specified for PWM.

EXAMPLE: POTENTIOMETER

You might also like