+ All Categories
Home > Documents > EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff...

EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff...

Date post: 12-Mar-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
23
EECS192 Lecture 2 Jan. 23, 2018 Checkoff 1/26: Hello World/LED Blink Checkoff 2/2: car built/stripped+proposal Project proposal Documentation Block Diagram/Software Model LED/Port Information PWM Intro Motor Model Notes: Check off- Hello World+LED blink ``look don’t touch’’ Github repo
Transcript
Page 1: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

EECS192 Lecture 2

Jan. 23, 2018

• Checkoff 1/26: Hello World/LED Blink

• Checkoff 2/2: car built/stripped+proposal

• Project proposal– Documentation

– Block Diagram/Software Model

• LED/Port Information

• PWM Intro

• Motor Model

Notes:

Check off- Hello World+LED blink

``look don’t touch’’

Github repo

Page 2: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Eagle: File → export → image (300 dpi png)

Black: tNames, tValues, tPlace

White or off: tOrigins, Unrouted

Eagle parts layout- no copper

Project Proposal: Documentation

Page 3: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Project Proposal: Documentation

Page 4: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Motor Drive Quick and Dirty w/ Op Amp

11v

LiPo+

Vm

-

+

VDS

-

VGS

+

-

+

-

Details On board….Checklist:

1) Emergency stop

2) Reset Protection

3) SnubbingTLC084 or TLC074 quad op amp

Page 5: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Project Proposal: Input/Output

https://www.sparkfun.com/tutorials/283

Page 6: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Thrun et al

Stanley 2005

Project Proposal: Block Diagram/Software Model

Page 7: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Project Proposal: Timing and priority of processes

Page 8: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

test_thread1

test_thread1

RealTime

RealTime1

Main() idle

Project Proposal: RTOS timer and threads example

Page 9: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

LED & CPU Port Information

Page 10: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

https://www.electronicshub.org/light-

emitting-diode-basics/

Connecting LED & CPU Port Information

Page 11: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

3.3V

3.3V

LED & CPU Port Information

LATCHUP!

Page 12: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

LED & CPU Port Information

Page 13: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

LED & CPU Port Information

Page 14: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro: e.g. periodic interrupt

0x0000

0x0004TOF= Timer OverFlow

Page 15: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro: PWM Generation

Page 16: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro: Code

Quick Start -> Import SDK Examples -> driver_examples -> ftm -> ftm_simple_pwm

ftm_config_t ftmInfo;

ftm_chnl_pwm_signal_param_t ftmParam;

ftm_pwm_level_select_t pwmLevel = kFTM_LowTrue;

/* Configure ftm params with frequency 24kHZ */

ftmParam.chnlNumber = BOARD_FTM_CHANNEL;

ftmParam.level = pwmLevel;

ftmParam.dutyCyclePercent = updatedDutycycle;

ftmParam.firstEdgeDelayPercent = 0U;

FTM_GetDefaultConfig(&ftmInfo);

/* Initialize FTM module */

FTM_Init(BOARD_FTM_BASEADDR, &ftmInfo);

FTM_SetupPwm(BOARD_FTM_BASEADDR, &ftmParam,

1U, kFTM_CenterAlignedPwm, 24000U, FTM_SOURCE_CLOCK);

Page 17: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro: Flexible Timer Module

Page 18: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Clock Choice for K64 CPU

• CPU and system clocks = 100 MHz

• Bus clock = 50 MHz

• FlexBus clock = 50 MHz

• Flash clock = 25 MHz

kCLOCK_CoreSysClk, /*!< Core/system clock */

kCLOCK_PlatClk, /*!< Platform clock */

kCLOCK_BusClk, /*!< Bus clock */

kCLOCK_FlexBusClk, /*!< FlexBus clock */

kCLOCK_FlashClk, /*!< Flash clock */

Example to choose clock frequency#FTM_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_BusClk)

Page 19: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Motor Model

On board….

http://inst.eecs.berkeley.edu/~ee192/sp18/files/NiseAppendixI.pdf

http://inst.eecs.berkeley.edu/~ee192/sp13/pdf/motor_modeling.pdf

Page 20: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

Extra Slides

Page 21: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro: PWM (edge)

Page 22: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro

Page 23: EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff 1/26: Hello World/LED Blink • Checkoff 2/2: car built/stripped+proposal • Project

PWM and Timer Intro: Dead Time Insertion


Recommended