ARM Microcontroller Course May 27, 2015 ARM Microcontroller Course - - PowerPoint PPT Presentation

arm microcontroller course
SMART_READER_LITE
LIVE PREVIEW

ARM Microcontroller Course May 27, 2015 ARM Microcontroller Course - - PowerPoint PPT Presentation

Serial Peripheral Interface Direct Digital Synthesis Exercises ARM Microcontroller Course May 27, 2015 ARM Microcontroller Course Serial Peripheral Interface Direct Digital Synthesis Exercises Table of Contents 1 Serial Peripheral Interface


slide-1
SLIDE 1

Serial Peripheral Interface Direct Digital Synthesis Exercises

ARM Microcontroller Course

May 27, 2015

ARM Microcontroller Course

slide-2
SLIDE 2

Serial Peripheral Interface Direct Digital Synthesis Exercises

Table of Contents

1 Serial Peripheral Interface 2 Direct Digital Synthesis 3 Exercises

ARM Microcontroller Course

slide-3
SLIDE 3

Serial Peripheral Interface Direct Digital Synthesis Exercises

SPI

Four wire serial interface: SCLK MOSI MISO CS / SS

ARM Microcontroller Course

slide-4
SLIDE 4

Serial Peripheral Interface Direct Digital Synthesis Exercises

SPI

Four wire serial interface: SCLK MOSI MISO CS / SS

ARM Microcontroller Course

slide-5
SLIDE 5

Serial Peripheral Interface Direct Digital Synthesis Exercises

SPI Options

Clock polarity CPOL Clock phase CPHA (also known as clock edge CKE) Word length (usually 8- or 16-bit) Data order: MSB first or LSB first. Hardware or software Slave Select.

ARM Microcontroller Course

slide-6
SLIDE 6

Serial Peripheral Interface Direct Digital Synthesis Exercises

SPI Timing diagrams

ARM Microcontroller Course

slide-7
SLIDE 7

Serial Peripheral Interface Direct Digital Synthesis Exercises

Table of Contents

1 Serial Peripheral Interface 2 Direct Digital Synthesis 3 Exercises

ARM Microcontroller Course

slide-8
SLIDE 8

Serial Peripheral Interface Direct Digital Synthesis Exercises

DDS

DDS consists of: Reference clock Tuning Word Phase Accumulator Phase to Amplitude algorithm

ARM Microcontroller Course

slide-9
SLIDE 9

Serial Peripheral Interface Direct Digital Synthesis Exercises

Phase Accumulator

Size of Phase Accumulator 2N Jump size (tuning word) M Reference clock fs

ARM Microcontroller Course

slide-10
SLIDE 10

Serial Peripheral Interface Direct Digital Synthesis Exercises

Example

We want: fs = 100kHz N = 16 8-bit sawtooth wave fo = 1kHz

ARM Microcontroller Course

slide-11
SLIDE 11

Serial Peripheral Interface Direct Digital Synthesis Exercises

Example

We want: fs = 100kHz N = 16 8-bit sawtooth wave fo = 1kHz To calculate magic M: fo = Mfs 2N

ARM Microcontroller Course

slide-12
SLIDE 12

Serial Peripheral Interface Direct Digital Synthesis Exercises

Example

We want: fs = 100kHz N = 16 8-bit sawtooth wave fo = 1kHz To calculate magic M: fo = Mfs 2N M = 216 · 103 100 · 103 = 655.36

ARM Microcontroller Course

slide-13
SLIDE 13

Serial Peripheral Interface Direct Digital Synthesis Exercises

Example

We want: fs = 100kHz N = 16 8-bit sawtooth wave fo = 1kHz To calculate magic M: fo = Mfs 2N M = 216 · 103 100 · 103 = 655.36 Our 8-bits are in the most significant byte.

ARM Microcontroller Course

slide-14
SLIDE 14

Serial Peripheral Interface Direct Digital Synthesis Exercises

Table of Contents

1 Serial Peripheral Interface 2 Direct Digital Synthesis 3 Exercises

ARM Microcontroller Course

slide-15
SLIDE 15

Serial Peripheral Interface Direct Digital Synthesis Exercises

What to do today

Try to finish the exercises on timers and ADC using HAL or registers. Talk to the DAC using SPI. Start with a frequency generator.

ARM Microcontroller Course

slide-16
SLIDE 16

Serial Peripheral Interface Direct Digital Synthesis Exercises

Material

You can find all material on http://www.scintilla.utwente.nl/docs/cursus Make sure you download: The Updated Manual (0527) The Usermanual of the Nucleo-F411RE The Reference Manual of the STM32F411RE Datasheet AD5611 DAC. Optional: HAL document Programming Guide

ARM Microcontroller Course