• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Embedded System Microcontroller Interactive Course using BASCOM-AVR -Lecture1, Included Universal AVR kit full design (Schematic and PCB). By: WALID BALID
 

Embedded System Microcontroller Interactive Course using BASCOM-AVR -Lecture1, Included Universal AVR kit full design (Schematic and PCB). By: WALID BALID

on

  • 3,172 views

Embedded System Microcontroller Interactive Course using BASCOM-AVR -Lecture1, Included Universal AVR kit full design (Schematic and PCB).

Embedded System Microcontroller Interactive Course using BASCOM-AVR -Lecture1, Included Universal AVR kit full design (Schematic and PCB).
By: WALID BALID

Statistics

Views

Total Views
3,172
Views on SlideShare
3,172
Embed Views
0

Actions

Likes
0
Downloads
280
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Embedded System Microcontroller Interactive Course using BASCOM-AVR -Lecture1, Included Universal AVR kit full design (Schematic and PCB). By: WALID BALID Embedded System Microcontroller Interactive Course using BASCOM-AVR -Lecture1, Included Universal AVR kit full design (Schematic and PCB). By: WALID BALID Document Transcript

    •    ‫ﺍﻟﺘﺠﺎﺭﺏ ﺍﻟﻌﻤﻠﻴﺔ‬     Programming Embedded Systems Microcontroller You Can Practice Microcontroller Programming Easily Now! Tuesday, December 15, 2009
    •   General Introduction about this course                      Assembly                                 AVR  Bascom-AVRBasic       Proteus             Development Board            50     2 
    • Practical Class 1 Programming Microcontrollers Bascom-AVR Compiler  Bascom-AVR    Bascom-AVR    ·   _ ·   Faculty of Electrical and Electronic Eng. 3 Automatic Control & Automation Dept.
    •   Compile ·               ·     Bascom-AVR   LCD Designer                 Graphic Converter            *.bgfGLCD  4 
    • 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. 5 Automatic Control & Automation Dept.
    •   WORDExport to RTF ile  f .Export to HTML  Bascom-AVR . .1  2  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   ProgramSyntax Check 3  4 ،LOOP ‫ﻳﺘﻮﻗﻊ ﻭﺟﻮﺩ ﺗﻌﻠﻴﻤﺔ‬ .DO‫ﻫﺬﺍ ﺻﺤﻴﺢ ﻷﻧﻪ ﻳﻮﺟﺪ‬  6 
    • Practical Class 1 Programming Microcontrollers  Program   Compile         5  ProgramSend to programmer 6  Bascom-AVR ‫لﻮ ﻮ ﺗوﺮ‬ ‫اﻟﴩﻃﻴﺔ‬ ‫ا ﳤﻴﺌﺔ‬ ‫اﻟﺘﺤﻮﯾﻼت‬ ‫اﻟﺘﻮﻗ ﺖ واﻟﺘﺎرﱗ‬ ‫اﻟﺘﺄ ﲑ اﻟﺰﻣﲏ‬ 1-WIRE ‫اﻟﺘﻌﺎﻣﻞ ﻣﻊ‬ ‫ ﺎ دﻹ ا‬I2C‫ج ﺮﺧﻹ‬ ‫ا او ل‬ ‫لﻮ ﻮ ﺗوﺮ‬ ‫ﺗﺼﻨﻴﻒ اﻟﺘﻌﻠ ت‬ ‫ت ﺎﻔﻠﳌا‬ ‫اﻟﺘﻮﺟﳱﺎ ت‬ ‫اﻟﱪﳎﻴﺔ ﰲ ﺑ ﺔ اﻟﱪ ﻣﺞ‬ ‫لﻮ ﻮ ﺗوﺮ‬ ‫اﻟﺘﻌﺎﻣﻞ ﻣﻊ‬ RS232 ‫اﻟﺘﺤﲂ ﻋﻦ ﺑﻌﺪ‬ Bascom-AVR ‫ةﺮ ا ا‬ ‫اﻟﺘﺤﲂ ﳌﻌﺎﰿ‬ ‫ﺪد اﻟﺘﻌﻠ ت ﺰﯾﺪ ﻋﻦ‬ ‫اﳊ ﺴﺎﺑﻴﺔ‬ ‫لﻮ ﻮ ﺗوﺮ‬ ‫لﻮ ﻮ ﺗوﺮ‬ ‫واﳌﺜﻠﺜﺎ ت‬ TCP/IP ‫053 ﺗﻌﻠﳰﺔ‬ ‫اﻟ ﺴﻼﺳﻞ اﶈﺮﻓ ﺔ‬ SPI ‫لﻮ ﻮ ﺗوﺮ‬ ‫ر ﺎﻬﻇﻹ ا ﺔﺷ ﺷ‬ ‫ﺎ‬ ‫ر ﺎﻬﻇﻹ ا ﺔﺷ ﺷ‬ ‫ﺎ‬ ‫ت ﺎﻌﻃ ﺎﻘﳌا‬ ‫تﴍ ﺆ ﳌا ﺰ ﻔﻘ ﻟاوت ﳊ ا‬ ‫ﺎﻘﻠ‬ ‫ا‬ PS2 ‫ا ﻟﻜ ﺮ ﺴ ﺘ ﺎ ﻟﻴ ﺔ‬ ‫ﺔ ﻣﻮﺳﺮ ﻟا‬     ISIS Proteus Simulation  ISIS Proteus   Faculty of Electrical and Electronic Eng. 7 Automatic Control & Automation Dept.
    •   Proteus       Comparison between most famous µC families    AVR, PIC, 8051   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 CISC/Von  RISC/Harvard RISC/Harvard Neumann  16 Bit 12 Bit 8 Bit   AVR Microcontrollers Family  AVR® 8-Bit  AVR       Automotive AVR   AVR Z-Link  IEEE 802.15.4 / ZigBee Batery M nagem nt A t a e VR  1.8~25 CAN AVR  CANopen, DeviceNet, OSEKCAN LCD AVR LCD Lighting AVR   USB AVR USB Tiny AVR   MEGA AVR 20MIPS XMEGA AVR  32MIPS AT90Sxxxx   MEGA  8 
    • Practical Class 1 Programming Microcontrollers BatteryM AVR Lighting AVR USB AVR megaAVR tinyAVR 18 ~ 48 Pin 24 ~ 32 Pin 32 ~ 64 Pin 28 ~ 100 Pin 8 ~ 32 Pin MAX I/O 4~18 MAX I/O 19~27 MAX I/O 22~48 MAX I/O 23~86 MAX I/O 6~28 4KB~40KB Flash 8KB~16KB Flash 8KB~128KB Flash 4KB~256KB Flash 1KB~8KB Flash 256B~1KB EPROM 512B EPROM 512B~4KB EPROM 512B~4KB EPROM 64B~512B EPROM 512B~2KB SRAM 512B~1KB SRAM 512B~8KB SRAM 512B~16KB SRAM 32B~512B SRAM Up To 8MIPS Up To 16MIPS Up To 16MIPS Up To 20MIPS Up To 20MIPS 1.8V – 25V 2.7V – 5.5V 2.7V – 5.5V 1.8V – 5.5V 1.8V – 5.5V AVR® 8-Bit        Automotive AVR CAN AVR LCD AVR AVR Z-Link xmegaAVR 14 ~ 64 Pin 64 ~ 100 Pin 44 ~ 100 Pin MAX I/O 6~54 64 Pin MAX I/O 54~69 MCU Wireless MAX I/O 36~78 2KB~128KB Flash 32KB~128KB Flash 16KB~64KB Flash chipset for: 16KB~384KB Flash 128B~4KB EPROM 1KB~4KB EPROM 512B~2KB EPROM IEEE 802.15.4 1KB~4KB EPROM 128B~4KB SRAM 1K~4KB SRAM 1KB~4KB SRAM and 2KB~32KB SRAM Up To 16MIPS Up To 16MIPS Up To 20MIPS ZigBee Up To 32MIPS 2.7V – 5.5V 2.7V – 5.5V 1.8V – 5.5V applications. 1.8V – 3.6V   Reading AVR Package information  AVR    ––AVR     Faculty of Electrical and Electronic Eng. 9 Automatic Control & Automation Dept.
    •       .ATMEL :AT   :Mega 8,16,32,64,128,256, etc…8 2.7V~5.5V L :L  4.5V~5.5V––  2016 :8                  :P  SOIC, TQFP, LQFP…PDIP   IC :I  M  10 
    • Practical Class 1 Programming Microcontrollers Reading Datasheet of ICs     – Datasheet –   Bascom-AVR  Assembly   ––     Reading Datasheet of ATmega128  ATmega128 Features · High-performance, Low-power AVR® 8-bit Microcontroller    8-bit  · Advanced RISC Architecture.    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    · – 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  – 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  64KB– – Programming Lock for Software Security  – – SPI Interface for In-System Programming  SPI– · JTAG (IEEE std. 1149.1 Compliant) Interface   JTAG  · – Boundary-scan Capabilities According to the JTAG Standard  – – Extensive On-chip Debug Support –Programming of Flash, EEPROM, Fuses and Lock Bits  Debug– through the JTAG Interface  – Faculty of Electrical and Electronic Eng. 11 Automatic Control & Automation Dept.
    •      · · 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 PWM– – 6 PWM Channels with Programmable Resolution from 2 to  16-bit PWM– 16 Bits  162 – Output Compare Modulator  10-bit/– – 8-channel, 10-bit ADC – Byte-oriented Two-wire Serial Interface  I2C– – Dual Programmable Serial USARTs  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  – · I/O and Packages   / · – 53 Programmable I/O Lines-PDIP  PDIP/53– – 64-lead TQFP and 64-pad MLF  TQFP/64– · Operating Voltages    · – 2.7 - 5.5V for ATmega128L  ATmega128L 2.7 - 5.5V – – 4.5 - 5.5V for ATmega128  ATmega128 4.5 - 5.5V – · Speed Grades    · – 0 - 8 MHz for ATmega128L  ATmega128L 8-MHz – – 0 - 16 MHz for ATmega128  ATmega128 16-MHz –       ATmega128   . ATmegaxxx   12 
    • Practical Class 1 Programming Microcontrollers Pin Confgur ations  · i   PE0(RXD/PDI) 2     PE0   /               JTAG       UART        Faculty of Electrical and Electronic Eng. 13 Automatic Control & Automation Dept.
    •   Block Diagram ·            RISC  Harvard     AVR        14 
    • Practical Class 1 Programming Microcontrollers Standard Systems Design      Von NeumannHarvard  Von-Neumann        ·   ·   ·   ·    Harvard                          Methods Architecture Systems Design     .(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.
    •                               AMD& INTEL    RISC                                RISC  DSPsMicrocontrollers  µA  MISC    16 
    • Practical Class 1 Programming Microcontrollers AVR Development Board  AVR  AVR   50  --  Human-Computer Interaction Methods      .1  .2 / .3  .4  .5 .LCD 20x4 .6 GLCD 128x64 .7 Faculty of Electrical and Electronic Eng. 17 Automatic Control & Automation Dept.
    •    .8 DTMF .9  .10  .11 .RC5, RC5-Extended .12 .RC5, RC5-Extended  .13 0 – 9 .14 .0 – 9999 .15 RS232UART1 .16 UART2 .17 RS485 .18  .19  .20  .21 .LM35DZ-45⁰C ~ +100⁰C .22 ADCNTC .23  .24 .ADC .25  .26  .27  .28 PWM .29  .30  .31  .32 DACLadder .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 DS18211-Wire .44 LED-Matrix Displays .45 USARTRS232 .46 EEPROM .47  .48  .49  .50  .51 .JTAG .52  .53 ESD, EMC & EMIPCBs .54 RTSMultitasking .55  .56 SPI .57       Faculty of Electrical and Electronic Eng. 19 Automatic Control & Automation Dept.
    •   AVR Development Board Designing schedule   AVR -1              -2   -3                -4 Embedded EMC,EMR,ESD Systems Proteus -5            compilers      -1  AVR In System Programming -2  -3 10060 -4                 -5             Embedded Systems Design  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 1507045%  -14  -15          Open Source      LabVIEW, VB6, Matlab, etc… -16 Faculty of Electrical and Electronic Eng. 21 Automatic Control & Automation Dept.
    •   Development Board Layout Diagram        22 
    • Practical Class 1 Programming Microcontrollers Development Board Schematic & Board Design           Faculty of Electrical and Electronic Eng. 23 Automatic Control & Automation Dept.
    •              24 
    • Practical Class 1 Programming Microcontrollers               Faculty of Electrical and Electronic Eng. 25 Automatic Control & Automation Dept.
    •              26 
    • Practical Class 1 Programming Microcontrollers  USART         Faculty of Electrical and Electronic Eng. 27 Automatic Control & Automation Dept.
    •          EEPROM & RTC I2C      28 
    • Practical Class 1 Programming Microcontrollers  RS485         Faculty of Electrical and Electronic Eng. 29 Automatic Control & Automation Dept.
    •              30 
    • Practical Class 1 Programming Microcontrollers  MMC/SD            PWM   Faculty of Electrical and Electronic Eng. 31 Automatic Control & Automation Dept.
    •    PS2                32 
    • Practical Class 1 Programming Microcontrollers              1-Wire Faculty of Electrical and Electronic Eng. 33 Automatic Control & Automation Dept.
    •                34 
    • Practical Class 1 Programming Microcontrollers                                                  Faculty of Electrical and Electronic Eng. 35 Automatic Control & Automation Dept.
    •        36 
    • Practical Class 1 Programming Microcontrollers     Faculty of Electrical and Electronic Eng. 37 Automatic Control & Automation Dept.
    •        38 
    • Practical Class 1 Programming Microcontrollers     Faculty of Electrical and Electronic Eng. 39 Automatic Control & Automation Dept.
    •     Px.0 Px.1 Px.2 Px.3 Px.4 Px.5 Px.6 Px.7 RS485 Interface PWM>DAC Four Buttons/Leds1 INT4~7 UART1 UART1 with Hand-checking and LEDs Indicators Port E AIN OC3A,B,C T3 8-bit DAC Interface ICP3 External Port Connector for further connecting and can be set to Pull Up/Down Resistor Programmer SPI MMC/SD Card SPI Interface Speaker IR Sender PWM IR Receiver Port B OC1A,B OC0,2 OC1C Hexadecimal Keypad External Port Connector for further connecting and can be set to Pull Up/Down Resistor Four Buttons/Leds2 ICP1 Relay1 T1 Relay2 INT0~3 Port D UART2 PS2 SCK UART2 TWI T1~2 RTC & EEPROM ICP1 External Port Connector for further connecting and can be set to Pull Up/Down Resistor DS1820 GLCD Control Bus LCD Port C Ex.MI-H Quad Seven Segment Control Lines Dual Led-Matrix Display Data Bus External Port Connector for further connecting and can be set to Pull Up/Down Resistor GLCD Data Bus UART2 Hand-checking Basic Card Port A Ex.MI-L Quad Seven Segment Data Bus External Port Connector for further connecting and can be set to Pull Up/Down Resistor LDR NTC Pressure Variable Variable 4 Switches Temperature Port F ADC0~7 Resistor Resistor sensor Resistor Resistor On a line Sensor JTAG JTAG Interface Dual Led-Matrix Display RC Circuit 23KHZ Crystal x x x Port G TOSC Control Lines WR/RD ASK TR ASK RE PS2 Data x x x x x   1 Buttons for Interrupt 4~7 can be set to VCC or GND by Jumper, connected with led indicators. 2 Buttons for Interrupt 0~3 can be set to VCC or GND by Jumper, connected with led indicators.  40 