dspic30f4011 fall 2007. dip switches the upper four switches of sw1 are used to enable leds...

30
dsPIC30F4011 Fall 2007

Upload: lucinda-moore

Post on 18-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

dsPIC30F4011

Fall 2007

Page 2: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Page 3: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

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: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Jumper Settings J16 is used as switch to connect the 4.096V

voltage reference to RB0

Page 5: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Jumper Settings There can be used to select between different

connection options

Page 6: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Different MCU Sockets

Page 7: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Summary

Page 8: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Switches

Page 9: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Power Supply

Page 10: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Programmer

Page 11: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

ADC Caution. What

would happen if: You are powering

the board from your laptop computer,

The center pin of the potentiometers is at VCC,

It is also connected to RB0,

The switches are set to connect to ground and

Somebody presses the RB0 switch

Page 12: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

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 13: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

The Modified Harvard architecture Harvard Architecture is a computer architecture with physically

separate storage and signal pathways for instructions and data The Modified Harvard Architecture is very like the Harvard

architecture but provides a pathway between the instruction memory and the CPU that allows words from the instruction memory to be treated as read-only data. This allows constant data, particularly text strings, to be accessed without first having to be copied into data memory, thus preserving more data memory for read/write variables.

In a computer with the contrasting Von Neumann Architecture (and no cache), the CPU can be either reading an instruction or reading/writing data from/to the memory. Both cannot occur at the same time since the instructions and data use the same signal pathways and memory. In a computer using the Harvard architecture, the CPU can read both an instruction and perform a data memory access at the same time, even without a cache.

Page 14: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

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

Harvard Architecture

Page 15: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Von Neumann Architecture

http://www.ccwu.edu/Thesis_Moynihan/Chapter3_files/image002.gif

Page 16: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Pinout and Family Differences

Page 17: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Page 18: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Page 19: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

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 20: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

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 21: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Device Overview The core has a 24-bit instruction word. The Program

Counter (PC) is 23 bits wide with the Least Significant bit (LSb) always clear and the Most Significant bit (MSb) is ignored during normal program execution, except for certain specialized instructions. Thus, the PC can address up to 4M instruction words of user program space.

The working register array consists of 16x16-bit registers, each of which can act as: data, address or offset registers. One working register (W15) operates as a software Stack

Pointer for interrupts and calls. Program loop constructs, free from loop count management

overhead, are supported using the DO and REPEAT instructions, both of which are interruptible at any point.

Page 22: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Oscillator

Page 23: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

FOSC REGISTER

Page 24: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Parallel I/O (PIO) Ports All port pins have three registers

directly associated with the operation of the port pin. The Data Direction register (TRISx) determines whether the pin is an input or an output. If the Data Direction register bit is a ‘1’, then the pin is an input. All port pins are defined as inputs after a Reset.

Reads from the latch (LATx), read the latch.

Writes to the latch, write the latch (LATx).

Reads from the port (PORTx), read the port pins and

writes to the port pins, write the latch (LATx).

When a peripheral is enabled and the peripheral is actively driving an associated pin, the use of the pin as a general purpose output pin is disabled. The I/O pin may be read, but the output driver for the Parallel Port bit will be disabled. If a peripheral is enabled, but the peripheral is not actively driving a pin, that pin may be driven by a port.

Page 25: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Page 26: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

ADPCFG

Page 27: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Timer 1 16-bit Timer Mode: In the 16-bit

Timer mode, the timer increments on every instruction cycle up to a match value, preloaded into the Period register, PR1, then resets to 0 and continues to count.

When the CPU goes into the Idle mode, the timer will stop incrementing unless the TSIDL (T1CON<13>) bit = 0. If TSIDL = 1, the timer module logic will resume the incrementing sequence upon termination of the CPU Idle mode.

16-bit Synchronous Counter Mode: In the 16-bit Synchronous Counter mode, the timer increments on the rising edge of the applied external clock signal, which is synchronized with the internal phase clocks. The timer counts up to a match value preloaded in PR1, then resets to 0 and continues.

When the CPU goes into the Idle mode, the timer will stop incrementing unless the respective TSIDL bit o. If TSIDL 1, the timer module logic will resume the incrementing sequence upon termination of the CPU Idle mode.

Page 28: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Page 29: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

Timer 1 16-bit Asynchronous

Counter Mode: In the 16-bit Asynchronous Counter mode, the timer increments on every rising edge of the applied external clock signal. The timer counts up to a match value preloaded in PR1, then resets to 0 and continues.

When the timer is configured for the Asynchronous mode of operation, and the CPU goes into the Idle mode, the timer will stop incrementing if TSIDL = 1.

The 16-bit timer has the ability to generate an interrupt on period match.

9.5 Real-Time Clock Timer1, when operating in Real-

Time Clock (RTC) mode, provides time-of-day and event time-stamping capabilities.

Gated Time Accumulation Mode The Gated Time Accumulation mode allows the

internal timer register to increment based upon the duration of the high time applied to the TxCK pin. In the Gated Time Accumulation mode, the timer clock source is derived from the internal system clock. When the TxCK pin state is high, the timer register will count up until a period match has occurred, or the TxCK pin state is changed to a low state.

Page 30: DsPIC30F4011 Fall 2007. DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,

T1CON=0b1010000001101000;