PRINCIPALES FUNCIONES Y DIRECTIVAS

Slides:



Advertisements
Similar presentations
EEE305 Microcontroller Systems
Advertisements

1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
MC68HC11 System Overview. System block diagram (A8 version)
More fun with Timer/Counters
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Oscilloscope Watch Teardown. Agenda History and General overview Hardware design: – Block diagram and general overview – Choice of the microcontroller.
Prof. Jorge A. Ramón Introducción a Microcontroladores.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
Railway Foundation Electronic, Electrical and Processor Engineering.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Blackfin BF533 EZ-KIT Control The O in I/O
Railway Foundation Electronic, Electrical and Processor Engineering.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.
AVR  Modern RISC architecture: Compact and FAST.  Tuned for high level languages.  Consistent architecture across entire line.  Small AVR are subsets.
September, 2007ENGR Low-Level Robot Control Mechatronics: Motors, sensors & embedded controls.
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
Clock Options and Sleep Modes. Clock Sources Flash Fuse bits can be programmed to choose one of the following Clock sources: 1. External RC Osc. f = 1/(3RC).
I/O PORTS (Simplest Peripherals) PORT A: 6 bits wide (7th and 8th bit always read as 0) PORT B: 8 bits wide PORT C: 8 bits wide PORT D: 8 bits wide.
RS232 #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
CCP MODULES  The CCP module (Capture/Compare/PWM) is a peripheral which allows the user to time and control different events.  Capture Mode provides.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
By James Cockrell and Justin Loveless
Interrupts Microprocessor and Interfacing
DsPIC30F4011 Fall DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
I NTRODUCTION TO PIC PROGRAMMING By : S HERIF H ARHASH.
Chapter 5 - Interrupts.
CSCI1600: Embedded and Real Time Software Lecture 16: Advanced Programming with I/O Steven Reiss, Fall 2015.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
بسم الله الرحمن الرحيم MEMORY AND I/O.
#1 of 10 Tutorial Introduction PURPOSE -To explain how to configure and use the Timer Interface Module in common applications OBJECTIVES: -Identify the.
Tulsanus Hurricanus Digitalus Mus Controller • EDU Processor 10 MIPS • Variable space: 2K SRAM • Program space: 32K FLASH • Serial port • Interrupts •
Interrupts Microprocessor and Interfacing
ECET 340 Entire Course (All ilabs and Homework) For more classes visit ECET 340 Week 1 HomeWork 1 ECET 340 Week 1 iLab 1 ECET 340.
Microcontrollers JULES CALELLA. Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package.
Microcontroller basics Embedded systems for mortals.
Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
Atmega328p Introduction for Digital and PWM Output Brion L Fuller II Robotics Club.
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
Embedded Systems Programming
UMAC 구성예 (1) ▪ CPU (w/ WD Board) - Ethernet (TCP/IP)
80C51 Block Diagram ECE Overview.
Input/Output Ports and Interfacing
Microprocessor and Assembly Language
AVR ATMEGA 8 MICRO-CONTROLLER
Microcontroller basics
Hardware Source: ttp:// under
Interrupt Source: under
Atmega32 Serial Programming Basics
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
The Arduino Microcontroller: Atmel AVR Atmega 328
Timer/Counter Modified from Dr. Lam Phung’s Slides.
Introduction to Microprocessors and Microcontrollers
CSCI1600: Embedded and Real Time Software
Morgan Kaufmann Publishers Computer Organization and Assembly Language
AVR – ATmega103(ATMEL) Architecture & Summary
CSCI1600: Embedded and Real Time Software
Presentation transcript:

PRINCIPALES FUNCIONES Y DIRECTIVAS COMPILADOR C DE CCS PRINCIPALES FUNCIONES Y DIRECTIVAS

DIRECTIVAS DE PREPROCESADO

#DEVICE Syntax: #device chip options Example: chip is the name of a specific processor (like: PIC16C74), Options are qualifiers to the standard operation of the device. Example: #device PIC16F877

#INCLUDE Syntax: Ejemplos: #include <filename> #include <16f877.h> #include “lcd.h”

#DEFINE Syntax: #define id text Used to provide a simple string replacement of the ID with the given text from this point of the program and on. Examples: #define verdadero 1 #define falso 0

#USE ****_I/O Afectan a como utilizamos los TRISX Syntax: Ejemplo #use fast_io (port) #use fixed_io (port_outputs=pin, pin?) #USE STANDARD_IO (port) Ejemplo #use fast_io (A)

#USE DELAY Syntax: #use delay (clock=speed(Hz)) Tells the compiler the speed of the processor and enables the use of the built-in functions: delay_ms() and delay_us(). Ejemplo: #use delay (clock=20000000)

#BYTE Syntax: #byte id = x Elements: id is a valid C identifier, x is a C variable or a constant Coloca la variable id en la posicion de memoria x. Ejemplo: #byte portb=5

#INT_xxx Indica que la funcion a continuacion es la rutina de atencion de una determinada interrupción #INT_EXT External interrupt #INT_RTCC Timer 0 (RTCC) overflow #INT_TIMER1 Timer 1 overflow

FUNCIONES ESPECIFICAS DEL COMPILADOR RS232 I/O I2C I/O Discrete I/O SPI two wire I/O Parallel Slave I/O Delays Processor Controls Bit/Byte Capt/Comp/PWM Timers A/D Conversion EEPROM C Math Etc.

DELAYS delay_ms(tiempo) delay_us(tiempo) delay_cycles(ciclos) (0-255) 1 ciclo= 4 ciclos de reloj

INPUT( ) Syntax: value = input (pin) Returns: Ejemplo: 0 (or FALSE) if the pin is low, 1 (or TRUE) if the pin is high Ejemplo: Encendido=input(PIN_A4)

INPUT_x() Syntax: value = input_a() value = input_b() value = input_c() ... Returns: An 8 bit int representing the port input data.

OUTPUT_X() Syntax: Parameters: value is an 8 bit int output_a (value) output_b (value) ... Parameters: value is an 8 bit int Function: Output an entire byte to a port.

OUTPUT_BIT( ) Syntax: output_bit (pin, value) Function: Outputs the specified value (0 or 1) to the specified I/O pin. Ejemplos Output_bit (PIN_D1,0) Output_bit(PIN_A3,1)

OUTPUT_xxxx() OUTPUT_HIGH( ) OUTPUT_LOW( ) Syntax: output_high (pin) Function: Sets a given pin to the high state. OUTPUT_LOW( ) Syntax: output_low (pin) Function: Sets a given pin to the ground state.

SET_TRIS_X() Configura los registros de direccionamiento de los puertos (TRIS) 0 significa salida 1 significa entrada Ejemplo: Set_tris_a(0b00001011)

ENABLE/DISABLE INTERRUPTS Permiten o inhiben las interrupciones. Ejemplos: enable_interrupts(GLOBAL); disable_interrupts(INT_TIMER0); enable_interrupts(INT_TIMER1);

OTRAS FUNCIONES setup_adc_ports() setup_adc() set_adc_channel() read_adc() setup_timer_X() set_timer_X() get_timer_X() swap() setup_ccpX() set_pwmX_duty()