embedded systems. today introduction to mechatronics microcontroller –input / output ports (i/o)...
TRANSCRIPT
Embedded Systems
Today
• Introduction to Mechatronics
• Microcontroller
– Input / Output Ports (I/O)
– Memory
– ADC
– PWM
Introduction to Mechatronics
http://en.wikipedia.org/wiki/Mechatronics_engineering
Embedded Systems
• Special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints.
• Usually controls a device
• Often meant for harsh environments
• Designed to be optimized, reducing the size and cost of the product, or increasing the reliability and performance.
• The Mun’der board is a embedded system
Microcontroller
• A microcontroller or embedded microprocessor is essentially a computer-on-a-chip.
• They are used in everyday electronic devices, such as cellular telephones, household appliances, automobiles, etc.
• In contrast to general-purpose microprocessors (the kind used in a PC) they are self-sufficient and cost-effective.
• Anywhere you want to give a design a small amount of ‘intelligence’, or the ability to generate different outputs based on the given inputs.
• Allows the system to be highly flexible
Microcontrollers
PIC18F4550 Microcontroller
Microcontroller
Microprocessor
• The ‘brains’ of the microcontroller
• Carries out programs instructions
• Performs arithmetic and logic operations
Memory
• ROM - Read only Memory
– Non-Volatile - Data retains in memory even when its power supply is removed.
• RAM - Random Access Memory
– Volatile - Data is lost when the power supply is removed.
• Flash RAM – Random Access Memory
• EEPROM - Electrically Erasable Programmable ROM
• Used for instruction set, programs, variables.
Microcontrollers - I/O
• There are 5 input/output (I/O) ports on the PIC18F4550 microcontroller
– Labeled A through E
– The ports are Bi-directional, can accept input signal or send out a output signal
– TRISB = 0x00;
• 0 – Output
• 1 – Input
• Note: Don’t use A6 as I/O
And Operation (Side Note)
• Denoted by a ‘&’
• Used to single out bits of a port
Microcontrollers - I/O
• Input
char var = PORTB & 0x01
• Output
LATBbits.LATB0 = 1;
LATB = 0x00;
Microcontrollers - ADC
• ADC - Analog to Digital Convertor
• Class Notes
• 10-bit ADCs on the PIC18F4550 microcontroller, on 13 channels
• Code - Right Turn