Robotraffic software and programming aids Robotics Laboratory Faculty of Mechanical Engineering Technion Israel Institute of Technology.

Slides:



Advertisements
Similar presentations
C Examples 1.
Advertisements

ECE 371 Unit 13 - Part 1 Serial Peripheral Interface (SPI)
Eng. Husam Alzaq The Islamic Uni. Of Gaza
SENIOR PROJECT PRESENTATION REMOTE CONTROL CAR MURAT DİNÇER.
The PIC uCs PIC Microcontroller and Embedded Systems Muhammad Ali Mazidi, Rolin McKinlay and Danny Causey Eng. Husam Alzaq The Islamic Uni. Of Gaza 9-1.
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
Introduction to Microcontrollers
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Today’s Lecture List the Timers of PIC18 and their associated registers Describe the various modes of the PIC18 timers Program the PIC18 timers in Assembly.
Input/Output mechanisms
September, 2007ENGR Low-Level Robot Control Mechatronics: Motors, sensors & embedded controls.
© AJH 2013, V2.0 Computer Programming Embedded Systems Programming Stand-alone code, system initialisation, operating systems. Low-level operations; port.
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
A Few Words From Dilbert
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Timers The timers of the PIC16C7X microcontroller can be briefly described in only one sentence. There are three completely independent timers/counters.
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.
Embedded System Design Laboratory October 11, 2002Stanford University - EE281 Lecture #4#1 Lecture #4 Outline Announcements Project Proposal AVR Processor.
Microprocessors A practical approach Subjects Goals for this module Results Subjects of the module Plans Questions.
Page 1 D&C EBV Seminar June 2003 Motor Demo C868 Chevillot/Jansen June 2003 N e v e r s t o p t h i n k i n g. Infineon C868 Hands On Training CAPCOM6.
RS232 #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
Industrial Reference Design Platform RS-232 Interface Developed by the TSC Americas Release 1.0.
Time Measurement Capture Mode of the Capture/Compare/PWM module is used for time measurement. TMR1 or TMR3 16-bit value transferred to 16-bit capture.
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.
Microprocessoren lesson 6. PWM /motor control/servo.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
Saxion University of Applied Sciences Advanced Microcontrollers A practical approach.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
DsPIC30F4011.
Chapter 5 - Interrupts.
Lecture 11: Liquid Level Control System: A Case Study 1.
Device Overview 1.  The advantages of all PIC18Fxxxx microcontrollers:  High computational performance  High-endurance  Enhanced Flash program memory.
C Examples 1. Download Links dsPIC30F4011/4012 Data Sheet dsPIC30F4013/3014 dsPIC30F Family Reference Manual MikroC MikroC Manual MikroC Quick Reference.
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
PIC16F887.
Microcontrollers session. What is Microcontroller? Microcontroller is composed of microprocessor,ram, flash memory,EEPROM and some modules like timers,
Microcontrollers JULES CALELLA. Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package.
WHY PARALLEL PORT? The simplest computer controlled robot Requires only basic programming skills in C to start off with Can take inputs from your robot.
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
One more PIC18F252 example and revision for exam B222L Branislav Vuksanovic, UoP, ECE.
Microprocessors A practical approach..
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.
TIMERS.
Timer modules in PIC 16F877.  The PIC 16F877 basically has three independent timer modules,  denoted by the symbols, TIMER-0, TIMER1,andTIMER2. . These.
 Mini-Computer ◦ Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output)  Low-Cost.
16F877A.
Chapter 9 PIC18 Timer Programming in Assembly
Timers and Event Counters
Microprocessor Systems Design I
connect a DC-Motor with an arduino
Microprocessors and Programming Department of Mechatronics Engineering
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessors Timers
The PIC uCs PIC Microcontroller and Embedded Systems Muhammad Ali Mazidi, Rolin McKinlay and Danny Causey Eng. Husam Alzaq The Islamic Uni. Of Gaza 11-1.
Pugazhendhi.M 11/12/2018 TIMERS 11/12/2018 CCET CCET.
EE Embedded Systems Fall 2015
8251A UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER
PIC18 Timer Programming “Explain the assembly language programming for the timer and counter module”
8051 Micro Controller.
EECE.3170 Microprocessor Systems Design I
Figure CCP1 Control Register
Figure Simplified View of Interrupts (default for power-on reset)
PIC18 Interrupt Programming
Timers Chapter 2.
Microprocessors and Programming Department of Mechatronics Engineering
A modular robot for use in the RoboSumo lab
Presentation transcript:

Robotraffic software and programming aids Robotics Laboratory Faculty of Mechanical Engineering Technion Israel Institute of Technology

PICKit 2 RS232 IrDA Encoder Run/Stop 5Vdc out Power input Strip sensorDistance SensorServo Motor DC Motor Select rs232 Select rs232 or IrDA BUS jumpers Fuse 5A Car main board Reset

PICKit 2 (J3) 1 - pin Vpp 2 – pin Vdd 3 – pin Gnd 4 – pin PGD 5 - pin PGC RS232 (J1) 1 – pin RX 2 - pin Gnd 3 – pin TX IrDA (J9) 1 –pin Vdd 2 – pin Gnd 3 – pin RXIr 4 – pin TXIr Encoder (J13) 1 – pin Vdd 2 – pin Gnd 3 – pin QEA 4 – pin QEB 5 – pin Index Run/Stop (J15) Open RC2->High Close RC2 -> Low 5Vdc out (J16) 1 – pin +5Vdc 2 - Gnd Reset (J6) 1 – pin Reset 2 - Gnd Power input (J2) 1 – pin (+) Battery 2 – pin (-) Battery Strip sensor (J11) 1 – pin Vdd 2 – pin Gnd 3 – pin Left 4 – pin BL 5 – pin BR 6 – pin Right 7 – pin Stop Distance Sensor (J12) 1 – pin Vdd 2 – pin Gnd 3 - pin Left 4 – pin Right Servo Motor (J14) 1 –pin Vm 2 – pin Input 3 – pin Gnd DC Motor (J10) 1 – pin (+)Motor 2 – pin (-)Motor BUS jumpers Fuse 5A 1-2 close RS close IrDA Car main board

PIC18F4431 external device connection jumpers

PIC18F4431 PORTA TRISA = 0x00; TRISA0 = 0; PORTA = 0xFA; RA0 = 1; TRISA = 0xFF; TRISA0 = 1; char a = PORTA;

Exercise_1 Port setup #include char a = 0x55; void main(void) { TRISA = 0xf0;// b all bits, are input TRISA6 = 0;// bit RA6 set to output PORTA = a; }

#include<htc.h> char a; void initialization (void); void interrupt ISR(void); /*==============================================================*/ void initialization (void) { /* Interrupt init */ IPEN= 1;/* Interrupt Priority Enable bit, 1 = Enable priority levels on interrupts */ /* 0 = Disable priority levels on interrupts */ /* 0 = Disable priority levels on interrupts */ GIEH= 1;/* Enables all high priority interrupts */ GIEL= 1;/* Enables all low priority peripheral interrupts */ /* init TMR0 */ T0CON= 0x46;/* 16-bit 1:2 prescale value */ TMR0L= 0x80;/* prescaler for the Timer0 module */ TMR0H= 0x00;/* prescaler for the Timer0 module */ TMR0IP= 1;/* TMR0 Overflow Interrupt Priority bit, High priority */ TMR0IE= 1;/* Enables the TMR0 overflow interrupt */ TMR0IF= 0;/* TMR0 Overflow Interrupt Flag bit */ /* I/O ports */ TRISA= 0xff;/* Port A data direction */ TRISB= 0x00;/* Port B data direction */ }/*==============================================================*/ void interrupt ISR(void) {if((TMR0IF)&&(TMR0IE)) { PORTB = a; PORTB = a; a++; a++; TMR0L= 0x80;/* prescaler for the Timer0 module */ TMR0H= 0x00;/* prescaler for the Timer0 module */ TMR0H= 0x00;/* prescaler for the Timer0 module */ TMR0IF= 0;/* TMR0 Overflow Interrupt Flag bit */ }}/*==============================================================*/ void main (void) { initialization (); initialization (); TMR0ON = 1; /* Timer0 On/Off Control bit, 1 = Enables Timer0 */ TMR0ON = 1; /* Timer0 On/Off Control bit, 1 = Enables Timer0 */ while(1) while(1) { }}

ENHANCED UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (EUSART)