DIP Switches

29

description

DIP Switches. The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example, if the switch for PORTB is OFF, all PORTB LEDs will be turned off - PowerPoint PPT Presentation

Transcript of DIP Switches

Page 1: DIP Switches
Page 2: DIP Switches
Page 3: DIP Switches

DIP Switches• The upper four switches of SW1 are used to enable LEDs connected to

– PORTB/C, PORTA/D, PORTE and PORTF. For example, if the switch for PORTB is OFF, all PORTB LEDs will be turned off

– Switches 5 and 6 of SW1 are used to enable SDO(Serial Data Output) and switches 7 and 8 to enable SDi (Serial Data input).

• SW2– The first two switches of SW2 are used to enable SCK, – switches 3, 4 and 5 are used for enabling CS (Chip Select) lines.– Switches 7 and 8 are used to enable LCD Backlight and GLCD Backight respectively.

Page 4: DIP Switches

Different MCU Sockets

Page 5: DIP Switches

Summary

Page 6: DIP Switches

Switches

Page 7: DIP Switches

Power Supply

Page 8: DIP Switches

Programmer

Page 9: DIP Switches

Main Features• High-Performance, Modified RISC CPU:

– Modified Harvard architecture– C compiler optimized instruction set architecture with flexible addressing

modes– 83 base instructions– 24-bit wide instructions, 16-bit wide data path– 48 Kbytes on-chip Flash program space (16K instruction words)– 2 Kbytes of on-chip data RAM– 1 Kbyte of nonvolatile data EEPROM– Up to 30 MIPS operation:

• DC to 40 MHz external clock input• 4 MHz-10 MHz oscillator input with PLL active (4x, 8x, 1 6x)

– 30 interrupt sources:• 3 external interrupt sources• 8 user-selectable priority levels for each interrupt source• 4 processor trap sources

– 16 x 16-bit working register array

Page 10: DIP Switches

http://www.ee.nmt.edu/~rison/ee308_spr99/supp/990119/harvard.gif

Harvard Architecture

Page 11: DIP Switches

Pinout and Family Differences

Page 13: DIP Switches

1. Power-on Reset (POR), – Power-up Timer (PWRT) and – Oscillator Start-up Timer (OST)

2. Brown-out Reset (BOR):– A momentary dip in the power supply to

the device has been detected which may result malfunction.

3. The Controller Area Network (CAN) module is a serial interface, useful for communicating with other CAN modules or digital signal controller devices.

4. The 10-bit, high-speed Analog-to-Digital Converter (ADC) allows conversion of an analog input signal to a 10-bit digital number.

5. Input capture is useful for such modes as:– Frequency/Period/Pulse Measurements

6. Output Compare is useful in applications requiring operational modes, such as:

– Generation of Variable Width Output Pulses

– Power Factor Correction7. The Inter-Integrated Circuit module

provides complete hardware support for both Slave and Multi- Master modes of the 120 serial communication standard with a 16-bit interface.

CI 2

CPU

Program Memory

Data Memory With two address generators

Input/Output Ports

Peripherals

Program Counter

Page 14: DIP Switches

8. The Serial Peripheral Interface (SPI) module is a synchronous serial interface. It is useful for communicating with other peripheral devices, such as EEPROMs, shift registers, display drivers and A/D converters, or other microcontrollers.

9. Timers 5x16 bit timers10. The QEI module provides the

interface to incremental encoders for obtaining mechanical position data.

11. PWM. This module simplifies the task of generating multiple, synchronized Pulse-Width Modulated (PWM) outputs. In particular, the following power and motion control applications are supported by the PWM module:

12. UART. UNIVERSAL ASYNCHRONOUS RECEIVER TRANSMITTER:

– Full-Duplex, 8 or 9-bit Data Communication

13. PSV Program Space Visibility

CPU

Program Memory

Data Memory With two address generators

Input/Output Ports

Peripherals

Program Counter

Page 15: DIP Switches
Page 16: DIP Switches
Page 17: DIP Switches
Page 18: DIP Switches

Traffic Light Control Int ledRed = 13;

int ledGreen = 11;int ledYellow = 12;

void setup(){ pinMode(ledRed, OUTPUT); // sets the digital pin as output pinMode(ledYellow, OUTPUT); // sets the digital pin as output pinMode(ledGreen, OUTPUT); // sets the digital pin as output}

void loop(){ digitalWrite(ledGreen, HIGH); // sets the Green LED on delay(1000); // waits for a second digitalWrite(ledGreen, LOW); // sets the Green LED off digitalWrite(ledYellow,HIGH); // sets the Yellow LED on delay(1000); // waits for a second digitalWrite(ledYellow, LOW); // sets the Yellow LED off digitalWrite(ledRed, HIGH); // sets the Red LED on delay(1000); // waits for a second digitalWrite(ledRed, LOW); // sets the Reed LED off}

Page 19: DIP Switches

Button

• The pushbutton is a component that connects two points in a circuit when you press it. The example turns on an LED when you press the button.

• We connect three wires to the Arduino board. The first goes from one leg of the pushbutton through a pull-up resistor (here 10 KOhms) to the 5 volt supply. The second goes from the corresponding leg of the pushbutton to ground. The third connects to a digital i/o pin (here pin 2) which reads the button's state.

• When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to 5 volts (through the pull-up resistor) and we read a HIGH. When the button is closed (pressed), it makes a connection between its two legs, connecting the pin to ground, so that we read a LOW. (The pin is still connected to 5 volts, but the resistor in-between them means that the pin is "closer" to ground.)

Page 20: DIP Switches

Arduino USB Board

Page 21: DIP Switches

Arduino USB Board

Page 22: DIP Switches

Arduino USB Board

Page 23: DIP Switches

Arduino Ethernet Shield

Page 24: DIP Switches

Arduino Mega

Page 25: DIP Switches

ATmega64O/1 280/1281/2560/2561

Page 26: DIP Switches

ATmega64O/1 280/1281/2560/2561

Page 27: DIP Switches

ColdFire

Page 28: DIP Switches

ColdFire

Page 29: DIP Switches