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

Post on 12-Mar-2020

4 views 0 download

transcript

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

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

Black: tNames, tValues, tPlace

White or off: tOrigins, Unrouted

Eagle parts layout- no copper

Project Proposal: Documentation

Project Proposal: Documentation

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

Project Proposal: Input/Output

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

Thrun et al

Stanley 2005

Project Proposal: Block Diagram/Software Model

Project Proposal: Timing and priority of processes

test_thread1

test_thread1

RealTime

RealTime1

Main() idle

Project Proposal: RTOS timer and threads example

LED & CPU Port Information

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

emitting-diode-basics/

Connecting LED & CPU Port Information

3.3V

3.3V

LED & CPU Port Information

LATCHUP!

LED & CPU Port Information

LED & CPU Port Information

PWM and Timer Intro: e.g. periodic interrupt

0x0000

0x0004TOF= Timer OverFlow

PWM and Timer Intro: PWM Generation

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);

PWM and Timer Intro: Flexible Timer Module

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)

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

Extra Slides

PWM and Timer Intro: PWM (edge)

PWM and Timer Intro

PWM and Timer Intro: Dead Time Insertion