Professional Documents
Culture Documents
Microcontroller PIC
16F84 and 16F877A
Giới thiệu môn học (1/2)
• 45 tiết
• C.1: Giới thiệu về VĐK PIC
• C.2: Phần cứng PIC 16F84 và 16F877A
• C.3: Tập lệnh của VĐK PIC và lập trình hợp
ngữ
• C.4: Bộ định thời, truyền dữ liệu đồng
bộ/không đồng bộ
Giới thiệu môn học (2/2)
• C.5: Ngắt
• C. 6: Bộ chuyển đổi tương tự sang số
• C.7: Kit phát triển
• The input
– digital devices
• Switches push buttons - keypads
• pressure mats - radio receivers
• float switches - …
The microcontroller system (2/4)
– analogue sensors
• light dependant resistors
• thermistors,
• gas sensors,
• pressure sensors
• …
The microcontroller system (3/4)
• The control unit is the microcontroller
– monitor the inputs -> turns output ON/OFF
– stores the program
– executes the instructions
The microcontroller system (4/4)
• The output devices:
– LEDs,
– buzzers,
– motors,
– Alpha numeric displays,
– radio transmitters,
– 7 segment displays,
– heaters,
– Fans
– ...
choose a microcontroller
• minimum number of inputs and outputs (I/O)
– digital inputs
– analogue inputs (must have an A/D)
– outputs
• size of program memory storage
• The clock frequency
• number of interrupts and timer circuits
• data EEPROM
Types of microcontroller (1/2)
• Basically two types
– Flash devices
• reprogrammed in the programmer
– One Time Programmable Devices (OTP)
• once programmed cannot be reprogrammed
• The windowed devices
– suffix JW
Types of microcontroller (1/2)
• Ex. 16C54 configurations are:
– 16C54JW Windowed device
– 16C54RC OTP, R-C oscillator
– 16C54LP OTP, LP oscillator, 32kHz
– 16C54XT OTP, XT oscillator, 4MHz
– 16C54HS OTP, HS oscillator, 20Mhz
Microcontroller specification (1/2)
• The device number
• Types
– Windowed : JW suffix
– OTP : Oscillator Frequency
– flash device : an F such as 16F84
• The oscillation frequency
– 04 => 4MHz
– 10 => 10MHz
– 20 => 20MHz.
• Temperature range
– 0oC +70oC
Microcontroller specification (2/2)
Using the microcontroller
• connect the microcontroller to the hardware?
• write and program the code into the
microcontroller?
How to do?
Microcontroller hardware
Microcontroller power supply
Connecting switches (1/2)
• via a pull-up resistor
Connecting switches (2/2)
• Via an internal pull-up
Connecting outputs
• output pin : 20–25mA
• Directly for LEDs or small relays
• a transistor, for dc
• a triac, for ac
Programming the microcontroller
• 35 words (instructions)
tips
• Search and download datasheet
• Read datasheet
• Flow chart