Arabic Course - 01 - Lecture1
Arabic Course - 01 - Lecture1
Assembly
AVR
Bascom-AVRBasic
Proteus
Development Board
50
Practical Class 1
Programming Microcontrollers
Bascom-AVR
Bascom-AVR Compiler
Bascom-AVR
Faculty of Electrical and Electronic Eng.
Compile
Bascom-AVR
LCD Designer
Graphic Converter
*.bgfGLCD
Practical Class 1
Programming Microcontrollers
Plugin Manager
/
Patch Compiler
TCP/IP
LIB Manager
\
Stack Analyzer
PDF Update
ATMEL
AVR
Faculty of Electrical and Electronic Eng.
.Export to HTML
Bascom-AVR
. .1
1- Directives
Directives are special instructions for the compiler. They can override a setting from the IDE.
2- Configuration
Configuration commands initialize the hardware to the desired state.
3- Variables
Dimension all required variables.
4- Main Program
Contains all executive instructions such as: Mathematical Instruction.
5- Sub Routines
They are sub programs or sub procedures, call from the main program
ProgramSyntax Check
LOOP
.DO
Practical Class 1
Programming Microcontrollers
Program Compile
ProgramSend to programmer
Bascom-AVR
1-WIRE
I2C
RS232
Bascom-AVR
350
TCP/IP
PS2
SPI
ISIS Proteus
Faculty of Electrical and Electronic Eng.
Proteus
AVR
PIC
8051
16MHZ
20MHZ
24MHZ
1Cycle
4Cycle
12Cycle
16/1 = 16MIPS
20/4 = 5MIPS
24/12 = 2MIPS
100%
70%
50%
132
35
215
>256KBytes
<64KBytes
<32KBytes
Liner
banked
Liner
RISC/Harvard
RISC/Harvard
CISC/Von
Neumann
16 Bit
12 Bit
8 Bit
AVR
8-Bit
AVR
Automotive AVR
AVR Z-Link
Battery Ma nageme nt AVR
CAN AVR
LCD AVR
Lighting AVR
USB AVR
Tiny AVR
MEGA AVR
XMEGA AVR
AT90Sxxxx
IEEE 802.15.4 / ZigBee
1.8~25
LCD
USB
20MIPS
32MIPS
MEGA
8
Practical Class 1
Programming Microcontrollers
BatteryM AVR
Lighting AVR
USB AVR
megaAVR
tinyAVR
18 ~ 48 Pin
MAX I/O 4~18
4KB~40KB Flash
256B~1KB EPROM
512B~2KB SRAM
Up To 8MIPS
1.8V 25V
24 ~ 32 Pin
MAX I/O 19~27
8KB~16KB Flash
512B EPROM
512B~1KB SRAM
Up To 16MIPS
2.7V 5.5V
32 ~ 64 Pin
MAX I/O 22~48
8KB~128KB Flash
512B~4KB EPROM
512B~8KB SRAM
Up To 16MIPS
2.7V 5.5V
28 ~ 100 Pin
MAX I/O 23~86
4KB~256KB Flash
512B~4KB EPROM
512B~16KB SRAM
Up To 20MIPS
1.8V 5.5V
8 ~ 32 Pin
MAX I/O 6~28
1KB~8KB Flash
64B~512B EPROM
32B~512B SRAM
Up To 20MIPS
1.8V 5.5V
AVR 8-Bit
Automotive AVR
14 ~ 64 Pin
MAX I/O 6~54
2KB~128KB Flash
128B~4KB EPROM
128B~4KB SRAM
Up To 16MIPS
2.7V 5.5V
CAN AVR
LCD AVR
64 Pin
32KB~128KB Flash
1KB~4KB EPROM
1K~4KB SRAM
Up To 16MIPS
2.7V 5.5V
64 ~ 100 Pin
MAX I/O 54~69
16KB~64KB Flash
512B~2KB EPROM
1KB~4KB SRAM
Up To 20MIPS
1.8V 5.5V
AVR Z-Link
MCU Wireless
chipset for:
IEEE 802.15.4
and
ZigBee
applications.
xmegaAVR
44 ~ 100 Pin
MAX I/O 36~78
16KB~384KB Flash
1KB~4KB EPROM
2KB~32KB SRAM
Up To 32MIPS
1.8V 3.6V
AVR
AVR
Faculty of Electrical and Electronic Eng.
.ATMEL :AT
:Mega
8,16,32,64,128,256, etc8
2.7V~5.5V L :L
4.5V~5.5V
2016 :8
:P
SOIC, TQFP, LQFPPDIP
IC :I
M
10
Practical Class 1
Programming Microcontrollers
Datasheet
Bascom-AVR
Assembly
ATmega128
Features
8-bit
RISC
133
+ 32 x 8
16 MHz 16
128KB
10,000
EEPROM 4KB
100,000
SRAM 4KB
64KB
SPI
JTAG
Debug
11
Peripheral Features
8-bit/
Two 8-bit Timer/Counters with Separate Prescalers and
16-bit/
Compare Modes
Two Expanded 16-bit Timer/Counters with Separate
Prescaler, Compare Mode and Capture Mode
Real Time Counter with Separate Oscillator
8-bit PWM
Two 8-bit PWM Channels
6 PWM Channels with Programmable Resolution from 2 to 16-bit PWM
16 Bits
162
Output Compare Modulator
10-bit/
8-channel, 10-bit ADC
I2C
Byte-oriented Two-wire Serial Interface
USARTs
Dual Programmable Serial USARTs
Master/Slave SPI Serial Interface
/SPI
Programmable Watchdog Timer with On-chip Oscillator
On-chip Analog Comparator
Special Microcontroller Features
Power-on Reset and Programmable Brown-out Detection
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save,
Power-down, Standby, and Extended Standby
Software Selectable Clock Frequency
ATmega103 Compatibility Mode Selected by a Fuse
ATmega103
Global Pull-up Disable
PDIP/53
TQFP/64
Operating Voltages
2.7 - 5.5V for ATmega128L
4.5 - 5.5V for ATmega128
Speed Grades
0 - 8 MHz for ATmega128L
0 - 16 MHz for ATmega128
ATmega128L 8-MHz
ATmega128 16-MHz
ATmega128
. ATmegaxxx
12
Practical Class 1
Programming Microcontrollers
PE0(RXD/PDI) 2
PE0 /
JTAG UART
Faculty of Electrical and Electronic Eng.
13
Block Diagram
RISC Harvard AVR
14
Practical Class 1
Programming Microcontrollers
Von NeumannHarvard
Von-Neumann
Harvard
15
AMD& INTEL
RISC
RISC
DSPsMicrocontrollers
A
MISC
16
Practical Class 1
Programming Microcontrollers
AVR
AVR
50
--
Human-Computer Interaction Methods
.1
.2
.3
.4
.5
.LCD 20x4 .6
GLCD 128x64
Faculty of Electrical and Electronic Eng.
17
.7
.8
DTMF
.9
.10
.11
.0 9999 .15
RS232UART1 .16
UART2 .17
RS485 .18
.19
.20
.21
.ADC .25
.26
.27
.28
PWM .29
.30
.31
.32
DACLadder .33
DAC .34
18
Practical Class 1
Programming Microcontrollers
.35
RTC .36
.EEPROM .37
.38
Overflow, Compare & Capture modes .39
MMC .40
Smart Card .41
PS2 .42
PS2 .43
DS18211-Wire .44
LED-Matrix Displays .45
USARTRS232 .46
EEPROM .47
.48
.49
.50
.51
.JTAG .52
.53
ESD, EMC & EMIPCBs .54
RTSMultitasking .55
.56
SPI .57
Faculty of Electrical and Electronic Eng.
19
AVR
-1
-2
-3
-4
Embedded EMC,EMR,ESD
Systems
Proteus
-5
compilers
-1
AVR
In System Programming
-2
-3
10060
-4
-5
self learners
-6
-7
USD120
.USD700
20
Practical Class 1
Programming Microcontrollers
-8
Lab-Center Proteus-7.2
Bascom-AVR
Debugger
-9
RS232 Interface
-10
48 I/O
AVR -11
SPI
-12
-13
5% : a
85% b
c
90%
96% d
.98% e
f
1507045%
-14
-15
Open Source
21
-16
22
Practical Class 1
Programming Microcontrollers
Faculty of Electrical and Electronic Eng.
23
24
Practical Class 1
Programming Microcontrollers
Faculty of Electrical and Electronic Eng.
25
26
Practical Class 1
Programming Microcontrollers
USART
Faculty of Electrical and Electronic Eng.
27
EEPROM & RTC I2C
28
Practical Class 1
Programming Microcontrollers
RS485
Faculty of Electrical and Electronic Eng.
29
30
Practical Class 1
Programming Microcontrollers
MMC/SD
PWM
Faculty of Electrical and Electronic Eng.
31
PS2
32
Practical Class 1
Programming Microcontrollers
1-Wire
33
34
Practical Class 1
Programming Microcontrollers
35
36
Practical Class 1
Programming Microcontrollers
Faculty of Electrical and Electronic Eng.
37
38
Practical Class 1
Programming Microcontrollers
Faculty of Electrical and Electronic Eng.
39
Px.0
Px.1
Px.2
Px.3
Port E
RS485 Interface
INT4~7
UART1
AIN
OC3A,B,C
T3
ICP3
Px.4
Px.5
Px.6
Px.7
Four Buttons/Leds1
PWM>DAC
Port B
Programmer
SPI
OC1A,B
OC0,2
OC1C
Speaker
IR Sender
PWM
IR Receiver
Hexadecimal Keypad
Port D
External Port Connector for further connecting and can be set to Pull Up/Down Resistor
INT0~3
UART2
TWI
T1~2
ICP1
Four Buttons/Leds2
PS2 SCK
ICP1
T1
Relay2
UART2
RTC & EEPROM
External Port Connector for further connecting and can be set to Pull Up/Down Resistor
DS1820
Port C
Relay1
Ex.MI-H
Port A
UART2 Hand-checking
Basic Card
Quad Seven Segment Data Bus
Port F
ADC0~7
JTAG
Port G
External Port Connector for further connecting and can be set to Pull Up/Down Resistor
TOSC
WR/RD
LDR
Resistor
NTC
Resistor
Pressure
sensor
Variable
Resistor
Variable
Resistor
4 Switches
On a line
Temperature
Sensor
JTAG Interface
Dual Led-Matrix Display
Control Lines
ASK TR
ASK RE
RC Circuit
23KHZ Crystal
PS2 Data
1
2
Buttons for Interrupt 4~7 can be set to VCC or GND by Jumper, connected with led indicators.
Buttons for Interrupt 0~3 can be set to VCC or GND by Jumper, connected with led indicators.
40