Professional Documents
Culture Documents
Rogramming Mbedded Ystems Icrocontroller: You Can Practice Microcontroller Programming Easily Now!
Rogramming Mbedded Ystems Icrocontroller: You Can Practice Microcontroller Programming Easily Now!
ﺍﻟﺘﺠﺎﺭﺏ ﺍﻟﻌﻤﻠﻴﺔ
א א
Programming
Embedded Systems Microcontroller
אא אא
אא א א א א א א א א
،אאאאאאא،אא
אאאאאאאאא
Kאא
،EAssemblyF א א א א א א א
א א א א
Kאא
אאAVRאאא،אא
KBascom-AVRאא، Basic
א אא א Proteus א א א
Kא
א א EDevelopment BoardF א א
א
Kאא50
אאאאEcompilersFאאאא
KATMELאAVR
KאאאאWאאא• א
Kאאאאאא_אWאא •
Faculty of Electrical and Electronic Eng.
3 Automatic Control & Automation Dept.
אא אא
KCompileאאאא Wאא •
א א א א א א Wא א א •
Kאאא
WאBascom-AVRאאא
אאא 4 אאא
Practical Class 1 Programming Microcontrollers
אWTCP/IPאא
Kאאא
WEStack AnalyzerFאא
Kאא
Faculty of Electrical and Electronic Eng.
5 Automatic Control & Automation Dept.
אא א
א
KWORD
W אWEExxport to RT
TF fileF
א
אא
.
אWEExport
E H F
to HTML
א
אא
W
Bascom
m-AVR א אא
.אאאא .1
،
K2
Wא
אאאא
1 Directives
1‐
Directivves are speccial instructtions for thee compiler. TThey can ovverride a setting from tthe IDE.
2‐ Configuratiion
Configuration com
mmands inittialize the hardware to the desired
d state.
3 Variabless
3‐
Dimension all required
d variables.
4‐ Main Progr
M ram
Contains all execu
utive instrucctions such aas: Mathem
matical Instrruction.
5‐ Sub Routin
nes
They arre sub progrrams or sub
b procedurees, call from the main p
program
KEProgramFאESyntax ChheckF
א א
א K3
K
אEאאא
F א
K4
אא
א 6
אאא
Practical Class 1 Programming Microcontrollers
،EProgramF א ECompileF א ،א א K5
Kאאאא
KEProgramFאESend to programmerFאא K6
KKKBascom-AVRאאאא
ISIS Proteus Simulation WISIS Proteusא
Faculty of Electrical and Electronic Eng.
7 Automatic Control & Automation Dept.
אא אא
אאאאאאאא Proteus
Kאאאאאאאא
KKK אאא
Comparison between most famous µC families Wאא
AVR Microcontrollers Family WAVR® 8-Bitא
WאאאAVRא
א אא
Automotive AVR אאא
AVR Z-Link IEEE 802.15.4 / ZigBeeאאאא
Battery Management AVR 1.8~25אאא
CAN AVR CANopen, DeviceNet, OSEKWCANא
LCD AVR LCDאא
Lighting AVR אאאא
USB AVR USB
Tiny AVR אאא
MEGA AVR 20MIPSאאאא
XMEGA AVR 32MIPSאאאאאא
AT90Sxxxx אא MEGAאאא
אאא 8 אאא
Practical Class 1 Programming Microcontrollers
Reading AVR Package information WAVRאא
KאאאאאEאF
Wאא–א–AVRא
Wאאאאא
Faculty of Electrical and Electronic Eng.
9 Automatic Control & Automation Dept.
אא אא
.ATMELאאא :AT
Kאאא א:Mega
8,16,32,64,128,256, etc…WאאאאW8
אE2.7V~5.5VFאא Lא :L
KE4.5V~5.5VFאא–א–א
K2016،אא :8
א א א א ،א :P
KESOIC, TQFP, LQFP…Fאאאאאאא،EPDIPF
EIFECF ،אאא :I
KאאאאאאEMF
אאא 10 אאא
Practical Class 1 Programming Microcontrollers
،אא
Kאאא– Datasheet –אאאאא،א
אאאאאא
אאאא Bascom-AVRאא
KEAssemblyFאאאאאאאא
א،אאאאאאא،
Kאאאאא––
KאאאאאאאאW
Reading Datasheet of ATmega128 WATmega128אאא
KEFeaturesFאאאאא •
High-performance, Low-power AVR® 8-bit Microcontroller Kאא 8-bit
• Advanced RISC Architecture. WEאF RISCא •
– 133 Powerful Instructions Most Single Clock Cycle. א 133 –
– 32 x 8 General Purpose Working Registers + Peripheral
+א 32 x 8 –
Control Registers
– Fully Static Operation א –
– Up to 16 MIPS Throughput at 16 MHz 16 MHzא 16 –
– On-chip 2-cycle Multiplier א –
• Nonvolatile Program and Data Memories Wאא •
– 128K Bytes of In-System Reprogrammable Flash א א 128KB –
Endurance: 10,000 Write/Erase Cycles
10,000 א،אא
– Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program - True K–
Read-While-Write Operation א EEPROM א א 4KB –
– 4K Bytes EEPROM 100,000
Endurance: 100,000 Write/Erase Cycles
SRAMאא 4KB–
– 4K Bytes Internal SRAM
– Up to 64K Bytes Optional External Memory Space
אEF64KB–
– Programming Lock for Software Security אא–
– SPI Interface for In-System Programming אESPIFא–
• JTAG (IEEE std. 1149.1 Compliant) Interface WEJTAGFאא •
– Boundary-scan Capabilities According to the JTAG Standard
אאאא–
– Extensive On-chip Debug Support
–Programming of Flash, EEPROM, Fuses and Lock Bits EDebugF–
through the JTAG Interface Kאאאא–
Faculty of Electrical and Electronic Eng.
11 Automatic Control & Automation Dept.
אא אא
Wאא• א
• Peripheral Features
–Two 8-bit Timer/Counters with Separate Prescalers and 8-bitא/א–
Compare Modes 16-bitא/–א
–Two Expanded 16-bit Timer/Counters with Separate
Prescaler, Compare Mode and Capture Mode
אאאא–
– Real Time Counter with Separate Oscillator
– Two 8-bit PWM Channels 8-bit אEPWMF–
– 6 PWM Channels with Programmable Resolution from 2 to 16-bit אEPWMFא–
16 Bits 162א
– Output Compare Modulator
10-bit/א–
– 8-channel, 10-bit ADC
– Byte-oriented Two-wire Serial Interface
EI2CFא–
– Dual Programmable Serial USARTs EUSARTsFא–
– Master/Slave SPI Serial Interface /ESPIFא–
– Programmable Watchdog Timer with On-chip Oscillator
אא–
– On-chip Analog Comparator
–
،אאאא
Kאא
אאא 12 אאא
Pra
actical Class 1
1 Prrogramming M
Microcontrolllers
W
א
F
אאWPE0((RXD/PDI) 2
א
PE0 אא /
،Eא
KJTAG
א
UART א
א
Kא א
Facculty of Electrrical and Electtronic Eng.
13 Automatiic Control & A
Automation Dept.
אא אא
KEBlock DiagramFאאאאאא •
אאאא אאא
Kאא
،RISC Harvard AVR א אא א
KKKא
אאא 14 אאא
Practical Class 1 Programming Microcontrollers
Kאאאאאאאא
KEVon NeumannFEHarvardFWא
WVon-Neumann
،אאאאא
K א،א
W
Kאאאא •
Kאאאא •
Kאאא •
Kאאא •
WHarvard
א א
،א א א
א א א א
א
א،א
Kאאאאא
Methods Architecture Systems Design Wא
Wא
.(150 ~ 1500 Instruction) Complex Instruction Set Computer : CISC
.(30 ~ 130 Instruction) Reduced Instruction Set Computer : RISC
.(15 ~ 30 Instruction) Minimum Instruction Set Computer :MISC
،א CISC ،א א א
א ،א
Faculty of Electrical and Electronic Eng.
15 Automatic Control & Automation Dept.
אא אא
א א ،א א
א א א אאא א א
KאAMD& INTELאאאא
אאאאאא
א،אאאאא،EµAF
Kאאאאא،MISC
אאא 16 אאא
Pra
actical Class 1
1 Prrogramming M
Microcontrolllers
،AVRא
אא
א
אא
50
אא -
א-אא،
א
KEHum
man-Compputer Interaaction MethhodsFW
Wא
א
א
K
אא
א
אאא .1
K
אא
אאא .2
Kאא
/א
אאא .3
KEEF
א
.4
K
.5
.LCD 200x4
.6
KGLCD
G 128xx64
.7
Facculty of Electrrical and Electtronic Eng.
17 Automatiic Control & A
Automation Dept.
אא אא
K .8
KDTMF .9
Kאאאא .10
Kאאא .11
.RC5, RC5-Extendedאאא .12
.RC5, RC5-Extended אאאאא .13
K0 – 9א .14
.0 – 9999א .15
KRS232אאאאא UART1אא .16
K אUART2אא .17
KRS485אאאאא .18
Kאאאא א.19
Kא .20
K .21
.LM35DZאא-45⁰C ~ +100⁰Cאאא .22
KאאאאADCNTCאאאאא .23
K .24
.ADCאא .25
Kאאאאאא .26
Kאאאאא .27
Kאאאאאא .28
KEPWMFאא א.29
K .30
Kא .31
אאאאאא א.32
K
KEDACFאאאELadderF .33
KEDACFאאאאא א.34
אאא 18 אאא
Practical Class 1 Programming Microcontrollers
Kאא .35
KאאאERTCFאא .36
.EEPROMאאא .37
Kאאאא .38
KOverflow, Compare & Capture modesWאא .39
KEMMCFא .40
KאאאESmart CardFאאא א.41
KאאאאאEPS2F .42
KאאאאEPS2F .43
KאEDS1821Fא1-Wireא א.44
KELED-Matrix DisplaysFא .45
KאאUSARTאRS232א א.46
KEEPROMאאאא .47
Kאאא .48
Kאאא א.49
Kא .50
Kאאא .51
.JTAGאאאאאא .52
Kאאאא .53
KESD, EMC & EMIאאEPCBsFאאאאא א.54
KERTSFאאEMultitaskingFא א.55
Kאאא .56
KSPIאא .57
Faculty of Electrical and Electronic Eng.
19 Automatic Control & Automation Dept.
אא אא
KAVRאאאאאאא -1
א א א א אא -2
Kאא
،Fאאאאא -3
KE،،א
א א אא -4
Embedded FאאEEMC,EMR,ESDFאאאא
KאESystems
KProteusאאאא -5
Wאאא
Wאאאא
א א א א EcompilersF א א א -1
K א AVR
KEIn System ProgrammingFWאאא -2
Kאאאאא -3
K10060 -4
א א א אא -5
א א א אא EEmbedded Systems DesignF
Kאאא
،Eself learnersF אאאא -6
Kאאאאא
אאאא -7
אאאאאא ،USD120
אאאא
.USD700
אאא 20 אאא
Practical Class 1 Programming Microcontrollers
، א EאF אא -8
אאא Lab-Center Proteus-7.2אאאא
אאאאאאאא
>אאאאאBascom-AVRא
א א EDebuggerF א א -9
KאאאאERS232 InterfaceFא
אאאאאא -10
EFאE48 I/OFאא
K
אאAVRאאא -11
KאאSPIא
אאאאא -12
Kאא
Wאאאא -13
5% :אאאא Ka
85%Wאאאאא Kb
א א א א א אא Kc
K90%Wא
K96%Wאאאאא Kd
.98%Wאאאא Ke
אאאאאאא Kf
>15070א45%א
Kאאאא א-14
Fאאאאאא،א -15
אFאאאEאאא
א א EOpen SourceF א Eא
K
LabVIEW, VB6, Matlab, etc…אאאא -16
Faculty of Electrical and Electronic Eng.
21 Automatic Control & Automation Dept.
אא אא
Wאאא
KKKאאאאאא
אאא 22 אאא
Practical Class 1 Programming Microcontrollers
Faculty of Electrical and Electronic Eng.
23 Automatic Control & Automation Dept.
אא אא
KKKאאאאאאא
KKKאאאאאאאא
אאא 24 אאא
Practical Class 1 Programming Microcontrollers
KKKאאאא
KKKאאאאא
Faculty of Electrical and Electronic Eng.
25 Automatic Control & Automation Dept.