Ubc104 embedded systems
Download
1 / 38

UBC104 Embedded Systems - PowerPoint PPT Presentation


  • 153 Views
  • Updated On :

UBC104 Embedded Systems. Microcontroller / 8051 family. Topics for Today. Microcontrollers Memory Registers Ports. Processors. General purpose processors: 80386 Pentium Core Duo Large number of pins External memory External peripherals . * Figure from Intel 386 DX Datasheet.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'UBC104 Embedded Systems' - bart


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Ubc104 embedded systems l.jpg

UBC104 Embedded Systems

Microcontroller / 8051 family


Topics for today l.jpg
Topics for Today

  • Microcontrollers

  • Memory

  • Registers

  • Ports

UBC 104 Embedded Systems


Processors l.jpg
Processors

  • General purpose processors:

    • 80386

    • Pentium

    • Core Duo

  • Large number of pins

  • External memory

  • External peripherals

* Figure from Intel 386 DX Datasheet

UBC 104 Embedded Systems


Functions of pins l.jpg
Functions of Pins

  • Designed to be generic

  • Indented to move data around

* Figure from Intel 386 DX Datasheet

UBC 104 Embedded Systems


General purpose registers l.jpg
General Purpose Registers

  • Registers are dedicated for moving data

    • EAX, EBX, ECX, EDX: general purpose registers

    • EBP: Base pointer

    • ESP: Stack pointer

    • ESI, EDI: Index register

UBC 104 Embedded Systems


Pentium l.jpg
Pentium

  • Bigger,

    better,

    more

* Figure from Intel Pentium Datasheet

UBC 104 Embedded Systems


Microcontrollers l.jpg
Microcontrollers

  • Support for peripherals inside uController

  • Limited number of pins

  • Dedicated purpose

    • Controlling devices, taking measurements

UBC 104 Embedded Systems


Microcontroller families l.jpg
Microcontroller Families

  • 68H12: Motorola 68H11, 68HC12, …

  • 8051: Intel 8051, 8052, 80251,…

  • PIC: Microchip PIC16F628, 18F452, 16F877, …

  • AVR: Atmel ATmega128, ATtiny28L, AT90S8515,…

UBC 104 Embedded Systems


Rita51j l.jpg
Rita51J

  • 8051

  • 128K of SRAM

  • 128K FLASH ROM

  • Serial port

  • Digital I/O lines

* Figure from www.rigelcorp.com

UBC 104 Embedded Systems


Motes l.jpg
Motes

  • Sensor nodes based on Atmel ATMega128

* Figures from CrossbowMPR-MIBUser Manual

UBC 104 Embedded Systems


At91sam7p64 l.jpg
AT91SAM7P64

  • 16/32 bit ARM7TDMI

  • 64K Bytes Program Flash, 16K Bytes RAM,

  • USB 2.0

  • 10 bit ADC 384 ksps 2x UARTs

  • I2C, SPI

  • 3x 32bit TIMERS

  • 4x PWM, WDT

* Figure from www.olimex.com

UBC 104 Embedded Systems


At91sam7p6412 l.jpg
AT91SAM7P64

* Figure from www.olimex.com

UBC 104 Embedded Systems


Microcontroller families13 l.jpg
Microcontroller Families

  • 68H12: Motorola 68H11, 68HC12, …

  • 8051: Intel 8051, 8052, 80251,…

  • PIC: Microchip PIC16F628, 18F452, 16F877, …

  • AVR: Atmel ATmega128, ATtiny28L, AT90S8515,…

 We are going to look at 8051s

UBC 104 Embedded Systems


8051 history l.jpg
8051 History

  • Introduced 1980

  • 12 MHz

  • 128 bytes Internal RAM

  • 4 kbytes ROM

  • 1 Serial port support

UBC 104 Embedded Systems


Typical features of modern 8051 l.jpg
Typical features of modern 8051

  • 32 input / output lines.

  • Internal data (RAM) memory - 256 bytes.

  • Up to 64 kbytes of ROM memory (usually flash)

  • Three 16-bit timers / counters

  • 9 interrupts (2 external) with two priority levels.

  • Low-power Idle- and Power-down modes

UBC 104 Embedded Systems


8051 manufacturers l.jpg
8051 Manufacturers

  • AMD: Enhanced 8051 parts (no longer producing 80x51 parts)

  • Atmel: FLASH and semi-custom parts

  • Dallas: Battery backed, program download, and fastest variants

  • Intel: 8051 through 80c51gb / 80c51sl

  • ISSI: IS80C51/31 runs up to 40MHz

  • Matra: 80c154, low voltage static variants

  • OKI: 80c154, mask parts

  • Philips87c748 thru 89c588 - more variants than anyone else

    • now NXP

  • Siemens: 80c501 through 80c517a, and SIECO cores

  • SMC: COM20051 with ARCNET token bus network engine

  • SSI: 80x52, 2 x HDLC variant for MODEM use

from http://www.faqs.org/faqs/microcontroller-faq/8051/

UBC 104 Embedded Systems


Selection of atmel 8051devices l.jpg
Selection of Atmel 8051Devices

* Figure from Atmel Function Spreadsheet

UBC 104 Embedded Systems


Datasheets your new friends l.jpg
Datasheets – Your New Friends!

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Packaging l.jpg
Packaging

  • Plastic Dual In-Line package (PDIL)

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Packaging i l.jpg
Packaging I

  • Very small Quad Flat Package (VQFP)

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Packaging ii l.jpg
Packaging II

  • Plastic Leaded Chip Carrier (PLCC)

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Packaging22 l.jpg
Packaging

UBC 104 Embedded Systems


Pin out of an 8051 l.jpg
Pin-Out of an 8051

UBC 104 Embedded Systems


8051 components l.jpg
8051 Components

  • Ports

  • RAM

  • Interrupt Controller

  • Timer

  • SPI Controller

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Mcbx51 board l.jpg
MCBX51 Board

UBC 104 Embedded Systems


Mcbx51 board26 l.jpg
MCBx51 Board

* Figure from MCBx51 Datasheet

UBC 104 Embedded Systems


8051 internal ram l.jpg
8051 Internal RAM

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Special function registers sfrs l.jpg
Special Function Registers (SFRs)

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Special function registers sfr l.jpg
Special Function Registers (SFR)

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems


Special function registers sfr30 l.jpg
Special Function Registers (SFR)

* Figure from Atmel AT89C51RD2 Datasheet

UBC 104 Embedded Systems



Pin out of an 805132 l.jpg
Pin-Out of an 8051

UBC 104 Embedded Systems


Ports l.jpg
Ports

  • Driving low-power peripherals ie. LEDs, relays

UBC 104 Embedded Systems


Port defintion in header files l.jpg
Port Defintion in Header Files

#define Sfr(x, y) sfr x = y

#define Sbit(x, y, z) sbit x = y^z

#define Sfr16(x,y) sfr16 x = y

/* BYTE Register */

Sfr (P0 , 0x80);

Sbit (P0_7 , 0x80, 7);

Sbit (P0_6 , 0x80, 6);

Sbit (P0_5 , 0x80, 5);

Sbit (P0_4 , 0x80, 4);

Sbit (P0_3 , 0x80, 3);

Sbit (P0_2 , 0x80, 2);

Sbit (P0_1 , 0x80, 1);

Sbit (P0_0 , 0x80, 0);

Sfr (P1 , 0x90);

Sbit (P1_7 , 0x90, 7);

Sbit (P1_6 , 0x90, 6);

Sbit (P1_5 , 0x90, 5);

UBC 104 Embedded Systems


Philips arm lpc example l.jpg
Philips ARM LPC Example

void Initialize() {

/* Initialize PLL */

/* Setting Multiplier and divider values */

PLLCFG=0x25;

feed();

/* Enabling the PLL */

PLLCON=0x1;

feed();

/* Wait for the PLL to lock to set frequency */

while(!(PLLSTAT & PLOCK)){}

/* Connect the PLL as the clock source */

PLLCON=0x3;

feed();

...

UBC 104 Embedded Systems


Another example l.jpg
Another Example

static unsigned short ADC_Read (unsigned char ch) {

unsigned int i;

ADCR = 0x00200300 | ch; // Init ADC & select channel

ADCR |= 0x01000000; // Start A/D Conversion

do {

i = ADDR; // Read A/D Data Register

} while ((i & 0x80000000) == 0); // Wait for end of A/D Conversion

return (i >> 6) & 0x03FF; // bit 6:15 is 10 bit AD value

}

UBC 104 Embedded Systems


Accessing ports in c l.jpg
Accessing Ports in C

void main (void) {

unsigned int i; /* Delay var */

unsigned char j; /* LED var */

while (1) { /* Loop forever */

for (j=0x01; j< 0x80; j<<=1) { /* Blink LED 0, 1, 2, 3, 4, 5, 6 */

P1 = j; /* Output to LED Port */

for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */

wait (); /* call wait function */

}

}

for (j=0x80; j> 0x01; j>>=1) { /* Blink LED 6, 5, 4, 3, 2, 1 */

P1 = j; /* Output to LED Port */

for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */

wait (); /* call wait function */

}

}

}

}

UBC 104 Embedded Systems


Exercise 4 l.jpg
Exercise 4

  • Becoming familiar with the development environment:

    • Simulation & Execution on board

    • Debugging

    • Using peripherals Ports

    • Using low-level C e.g. bit-level operations

UBC 104 Embedded Systems


ad