1 / 12

University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering

University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering. Microcontroller Lab. 1:. General I/O Ports. In this session, we will . Review the previous session. Determine on how to program general I/O Ports. Determine on the software package. Review.

aran
Download Presentation

University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. University Of Khartoum Faculty Of Engineering Electrical and Electronic Engineering Microcontroller Lab. 1: General I/O Ports

  2. In this session, we will • Review the previous session. • Determine on how to program general I/O Ports. • Determine on the software package.

  3. Review • Micro WHAT ?? Processor, computer or controller?? • Microcontroller’s basic architectures, and basic modules? • what are the differences between using Assembly language and C-language ?

  4. What can I do with MCUs

  5. Atmega 32 pin description Dual nature of most of the 40 pins. Serial communications Analog to Digital Conversion Voltage supply < Ground. << 4 I/O ports; PORTA ( ADC ) PORTB,PORTC PORTD. interrupt pins 40 pins structure, with 32 I/O pins. The pins mostly have a dual functionalty nature, i.e. it does more than one job. we will concentrate on atmega 32 many reasons ( availabilty, ease of use, suitable for simple apps and with a powerful RISC architecture and good processing power and RAM/ROM capacity. in this sesion we discuss some of the pins, furthur details will be presented later in this lap.

  6. General Digital I/O Ports • The Atmel Atmega32 is equipped with 4 8-bits general purpose I/O ports designed PORTA, PORTB, PORTC, and PORTD. • Each port pin can be used as input or output. • When initialization we adjust the ports as IN or OUT ports, a sample of an initialization code is given below DDRB = 0x00; //make port b as input PORTB = 0x00; //disable pull-ups and make it tri stat.

  7. All these ports have two functions: general digital I/O ports and alternate functions for the peripheral features on the device. •   enabling the alternate function of some of the port pins does not affect the use of the other pins in the port as general digital I/O

  8. Each port has three registers associated with it: • Data Direction Register (DDRx): used to set a specific port pin to either output (1) or input (0). • Data Register (PORTx): used to write output data to the port. • Port Input Pins (PINx): used to read input data from the port.

  9. Software packages • In order to program the AVR MCU we use a special C compiler packed with hardware oriented libraries to ease the dealing with MCU hardware; AVR Codevision. • The codevision has a special feature that helps the programmer to generate the initialization code without having to write it from scratch; you only needs to know the features of the MCU that you are using for the certain app at hand and how you are going to use them.

  10. Software packages; For simulation purposes we have the proteues application for electronics circuits simulation. And in order to have the program downloaded in the MCU we use the .hex file version generated by the code vision; this file is downloaded to the MCU using a communication interface; Ponyprog. Ponyprog is a serial device programmer software with a user friendly GUI framework available for Windows95/98/ME/NT/2000/XP and Intel Linux. Its purpose is reading and writing every serial device. At the moment it supports I²C Bus, Microwire, SPI EEPROM, the Atmel AVR and Microchip PIC micro.

More Related