programmable system-on-chip (psoc) general overview embedded architectures ee446

36
Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Upload: noah-austin

Post on 30-Dec-2015

246 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Programmable System-on-Chip (PSoC) General Overview

Embedded ArchitecturesEE446

Page 2: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Typical Microcontroller Purposes

• The purpose for uC’s is to interface multiple types of hardware.

– Digital Input/Outputs:• Switches• Relays• LEDs

– Digital Communications: I2C, SPI

– Analog Input/Outputs

Computer

uC

Thermal

Gyro

Acceleration

Page 3: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Example of Hardware Interfacing

Page 4: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Regular Microcontroller Caveats

– What if you need more Analog Inputs?– What if you need more Interrupts?– Advanced projects: more PWMs needed?

• Use external circuitry• Buy a larger microcontroller

Page 5: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

What is a Programmable System-on-Chip (PSoC)?

• A customizable microcontroller that includes flexible analog and digital logic blocks.

– Analog blocks:• High-resolution inputs (up to 20-bit)• 4 Digital-to-Analog Converters

– Digital logic blocks (UDBs):• A wide mix of digital peripherals can be

implemented into a single chip.

– Up to 4 voltage domains

– Almost all pins can be flexible in terms of being digital or analog.

Page 6: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

What is a Programmable System-on-Chip (PSoC)?

• PSoC-5

(Powered by ARM Core)

– Provides above features plus ARM processor benefits:

• Up to 67Mhz

• Flash: Up to 256kb

• SRAM: Up to 65kb

– Up to 70 I/O pins

Page 7: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

General Overview of PSoC Features

Page 8: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446
Page 9: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Cypress PSoC IDEAPI

Page 10: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Cypress PSoC IDE (Block Configuration)

Page 11: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

PSoC Pin Routing

Page 12: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

PSoC Main Program Code

Main loop

ISR Flag

ISR Flag

Page 13: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

API’s for the PSoC Blocks

Page 14: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

API’s for the PSoC Blocks

Page 15: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Top-level UDB Block Diagram

Page 16: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Top-level UDB Routing Diagram

Page 17: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Extensive Uses of UDBs

• Examples of possible hardware configurations on a single (and largest) PSoC chip:– 12 UARTs

or– 28 PWMs

• For a normal microcontroller, this configuration is impossible without resorting to additional external hardware, such as:– Daisy-chain or bus-connected peripherals:

• Microcontrollers• I2C/SPI-connected hardware for UART, PWM, etc.

Page 18: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Extensive Uses of UDBsTechnology Mapping

Summary

Page 19: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Extensive Uses of UDBsTechnology Mapping

Summary

Page 20: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

PSoC Top-Level Analog Routing Diagram

Page 21: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

PSoC Analog Routing

• Analog Local Bus– 4 on left side, 4 on right side– Connects to analog resource blocks only– No access to GPIO’s

• Analog Global Bus– Connects I/O to analog resource blocks on same side– Connects to GPIO on their respective quadrant– 8 routes on left side, 8 routes on right side

• Analog Mux Bus– Connects the buses to the ‘outside’ world– Can connect to all GPIO’s and all analog resource blocks

Page 22: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

PSoC Die Quadrants Analog Routing

Global Bus

Page 23: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Detailed Analog Routing

Page 24: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Interrupts

Page 25: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Why have interrupts?

• An external event that needs immediate attention.– An ‘emergency’ switch– A long-running timer

• PSoC-5 supports 16 system interrupts and 32 from peripherals.– Tail Chaining (Back-to-Back)– Late Arrival (Lower Higher)– Reprioritize Interrupts

• Same Priority?– Fixed Function DMA UDB

Page 26: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Interrupts

• Some modules that are used needs immediate attention in real time.

Page 27: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Interrupt Vector Table

Page 28: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

How Interrupts Work

Page 29: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Interrupt Setup and ISR

Page 30: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Tail Chaining Interrupts

Page 31: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Late Arrival Interrupts

Page 32: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Polling vs Interrupting

• Signals can happen too fast for the CPU to read or process!

Page 33: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Example PSoC ProjectFirmware Overview

I/O Communications InputsFrom

Sensors

OutputsTo

Devices

Page 34: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Raw Sensor Data Collection to the Host PC

• Digital:– I2C used in Gyroscopes, Accelerometers,

Magnetometers (IMU), and Temperature Sensor– UART from Sonar @ 9600bps (8N1)

• For this particular usage, very inefficient.• Requires interrupts and additional code complexity.• Very slow data updates.

• ADC Settings and Inputs: – 14-bits @ 70,000 Samples Per Second (currently)– Vcc = 5 Volt (Reference)– Raw value range:

• 0v 5v• 0 16384

Page 35: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

PSoC Data Output

• Raw ADC Values: 85 updates/sec over Serial UART @ 115200bps (8N1)

Servo Position Infrared Gyro

X-AxisGyro

Y-AxisGyro

Z-AxisSonar

(analog)

Page 36: Programmable System-on-Chip (PSoC) General Overview Embedded Architectures EE446

Host PC Application GUI