EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff...
Transcript of EECS192 Lecture 2 Jan. 23, 2018ee192/sp18/files/lec2.pdfEECS192 Lecture 2 Jan. 23, 2018 • Checkoff...
![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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/1.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/2.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/3.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/4.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/5.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/6.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/7.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/8.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/9.jpg)
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://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/10.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/11.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/12.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/13.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/14.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/15.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/16.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/17.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/18.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/19.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/20.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/21.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/22.jpg)
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](https://reader031.fdocuments.in/reader031/viewer/2022041921/5e6bc2d56e961819130dea06/html5/thumbnails/23.jpg)
PWM and Timer Intro: Dead Time Insertion