Difference between revisions of "ME 333 Readings, Videos, and Sample Code"
Line 239: | Line 239: | ||
---- |
---- |
||
=== |
===UART=== |
||
** [[Media:UART_loopback.c|UART_loopback.c]] |
** [[Media:UART_loopback.c|UART_loopback.c]] |
||
** [[Media:UART_pic_to_pic.c|UART_pic_to_pic.c]] |
** [[Media:UART_pic_to_pic.c|UART_pic_to_pic.c]] |
||
Line 252: | Line 252: | ||
---- |
---- |
||
=== |
===SPI Communication=== |
||
** [[Media:SPI_loopback.c|SPI_loopback.c]] |
** [[Media:SPI_loopback.c|SPI_loopback.c]] |
||
** [[Media:SPI_pic_to_pic.c|SPI_pic_to_pic.c]] |
** [[Media:SPI_pic_to_pic.c|SPI_pic_to_pic.c]] |
||
Line 263: | Line 263: | ||
---- |
---- |
||
=== |
===I2C Communication=== |
||
** [[Media:I2C_loopback.c|I2C_loopback.c]] |
** [[Media:I2C_loopback.c|I2C_loopback.c]] |
||
** [[Media:I2C_pic_to_pic.c|I2C_pic_to_pic.c]] |
** [[Media:I2C_pic_to_pic.c|I2C_pic_to_pic.c]] |
||
Line 272: | Line 272: | ||
---- |
---- |
||
=== |
===USB=== |
||
** [[Media:USB_HID.zip|USB_HID.zip]] |
** [[Media:USB_HID.zip|USB_HID.zip]] |
||
** [[Media:USB_CDC.zip|USB_CDC.zip]] |
** [[Media:USB_CDC.zip|USB_CDC.zip]] |
||
Line 279: | Line 279: | ||
---- |
---- |
||
=== |
===Input Capture=== |
||
** [[Media:IC_loopbackPWM.c|IC_loopbackPWM.c]] |
** [[Media:IC_loopbackPWM.c|IC_loopbackPWM.c]] |
||
** [[Media:IC_readRemoteControl.c|IC_readRemoteControl.c]] |
** [[Media:IC_readRemoteControl.c|IC_readRemoteControl.c]] |
||
Line 285: | Line 285: | ||
---- |
---- |
||
=== |
===Comparator=== |
||
** [[Media:COMP_internal.c|COMP_internal.c]] |
** [[Media:COMP_internal.c|COMP_internal.c]] |
||
** [[Media:COMP_output16values.c|COMP_output16values.c]] |
** [[Media:COMP_output16values.c|COMP_output16values.c]] |
||
Line 292: | Line 292: | ||
---- |
---- |
||
=== |
===Watchdog Timer=== |
||
** [[Media:WDT_enableReset.c|WDT_enableReset.c]] |
** [[Media:WDT_enableReset.c|WDT_enableReset.c]] |
||
** [[Media:WDT_checkPreviousReset.c|WDT_checkPreviousReset.c]] |
** [[Media:WDT_checkPreviousReset.c|WDT_checkPreviousReset.c]] |
||
Line 298: | Line 298: | ||
---- |
---- |
||
=== |
===Storing Data in Flash Memory=== |
||
** [[Media:FLASH_write.c|FLASH_write.c]] |
** [[Media:FLASH_write.c|FLASH_write.c]] |
||
---- |
---- |
||
=== |
===Power Saving=== |
||
** [[Media:PWR_sleep.c|PWR_sleep.c]] |
** [[Media:PWR_sleep.c|PWR_sleep.c]] |
||
---- |
---- |
||
=== |
===Real-time Clock and Calendar=== |
||
** [[Media:RTCC_set.c|RTCC_set.c]] |
** [[Media:RTCC_set.c|RTCC_set.c]] |
||
---- |
---- |
||
=== |
===Controller Area Network (CAN)=== |
||
** [[Media:CAN_pic_to_pic.c|CAN_pic_to_pic.c]] |
** [[Media:CAN_pic_to_pic.c|CAN_pic_to_pic.c]] |
||
---- |
---- |
||
=== |
===Direct Memory Access=== |
||
** [[Media:DMA_adc.c|DMA_adc.c]] |
** [[Media:DMA_adc.c|DMA_adc.c]] |
||
** [[Media:DMA_spi.c|DMA_spi.c]] |
** [[Media:DMA_spi.c|DMA_spi.c]] |
||
Line 324: | Line 324: | ||
---- |
---- |
||
=== |
===Sensors and Signal Conditioning=== |
||
---- |
---- |
||
=== |
===Digital Signal Processing=== |
||
---- |
|||
===Chapter 25: Brushed Permanent Magnet DC Motors=== |
|||
---- |
---- |
Revision as of 23:41, 24 February 2014
Readings, videos, exercises, and sample code for ME 333 Introduction to Mechatronics.
You can download the most updated version of the class readings here.
Appendix: A Crash Course in C
Reading: A Crash Course in C, C Compilers
Videos:
- Writing your first program in C, HelloWorld.c (5:09). Chapter A.1. Exercises: 1.
- Differences between C and MATLAB (7:30). Chapter A.2. Exercises: 2, 3.
- Binary and hexadecimal (Base 2 and 16) (4:47). Chapter A.3.1. Exercises: 4, 6.
- Data types (5:30). Chapter A.3.1. Exercises: 8, 10.
- Using the data types (3:49). Chapter A.3.1. Exercises: 11.
- Representations of data types (5:15). Chapter A.3.1. Exercises: 12, 13.
- Pointer basics (5:54). Chapter A.3.2. Exercises: 14, 15.
- Sample program: printout.c (5:55). Chapter A.4. Exercises: 16 (not covered in video, reading only) 17, 18.
- Sample program: datasizes.c (2:57). Chapter A.4. Exercises: 9.
- Sample program: overflow.c (2:43). Chapter A.4. Exercises: 19.
- Sample program: typecast.c (5:43). Chapter A.4. Exercises: 20.
- invest.c, part 1/5: intro to a typical C program (4:18). Chapter A.4. Exercises: 23.
- invest.c, part 2/5: overview (3:58). Chapter A.4. Exercises: 24, 25.
- invest.c, part 3/5: sections 1-4: program comments, preprocessor commands, new data type definitions, and global variables (4:48). Chapter A.4. Exercises: 26.
- invest.c, part 4/5: sections 5-6: helper function prototypes and the main function (4:40). Chapter A.4.
- invest.c, part 5/5: section 7: helper functions (7:42). Chapter A.4. Exercises: 28-30, 32, 33 (some material covered in reading only).
- Header files and libraries (9:31).
Sample Code:
- Section A.1: HelloWorld.c
- Section A.4: printout.c, datasizes.c, overflow.c, typecast.c, invest.c
- Section A.4.16: helper.h, helper.c, main.c
- Problems, Section A.5: bubble.c, lights.c, hexdump.c
Microchip Documentation:
Chapter 1: Quickstart
Reading: Chapter 1
Videos: none
Sample Code:
- Section 1.3: PIC32quickstart.zip
Chapter 2: Looking Under the Hood: Hardware
Reading: Chapter 2
Videos:
- Introduction to the PIC32 microcontroller (5:10).
- Introduction to the PIC32 architecture (6:02).
- The PIC32 physical memory map (5:20).
- Introduction to the NU32 development board (4:03).
Sample Code: none
Chapter 3: Looking Under the Hood: Software
Reading: Chapter 3
Videos:
- The PIC32 virtual memory map (5:24).
- Understanding simplePIC.c (5:42).
- Digging through PIC32 header files (7:12).
- The PIC32 executable build process (4:26).
Sample Code:
Chapter 4: Using Libraries
Reading: Chapter 4
Videos:
- The NU32 library (5:28).
Sample Code:
- Section 4.5:
- NU32.c and NU32.h are included in Chapter 1
- LCD.c
- LCD.h
- LCDwrite.c
Chapter 5: Time and Space
Reading: Chapter 5
Videos:
- Timing PIC32 code and the disassembly file (8:27).
- The PIC32 memory map file (7:15).
Sample Code:
- Section 5.1:
Chapter 6: Interrupts
Reading: Chapter 6
Videos:
- Overview of interrupts on the PIC32 (4:29).
- PIC32 interrupt SFRs (6:22).
- The PIC32 shadow register set (1:25).
- Seven steps to using an interrupt with the PIC32 (3:47)
- PIC32 interrupt code example (4:10)
Sample Code:
Chapter 7: Digital Input and Output
Reading: Chapter 7
Videos:
- Intro to digital I/O on the PIC32 (6:24)
- Change notification on the PIC32 (1:18)
- PIC32 program with digital I/O and change notification (9:02)
Sample Code:
Chapter 8: Counters / Timers
Reading: Chapter 8
Videos:
- Intro to PIC32 counter/timers (5:59)
- PIC32 timer SFRs (5:55)
- Using PIC32 timers to generate interrupts (3:34)
- Example PIC32 timer interrupt program (5:08)
Sample Code:
Chapter 9: Output Compare
Reading: Chapter 9
Videos:
- Introduction to the PIC32 output compare (5:30)
- A PWM program on the PIC32 (3:12)
- Using output compare to create an analog output (3:09)
Sample Code:
PID Control
Reading: None required, but you can check out the wikipedia article if you like.
Videos:
- Introduction to PID control (4:28)
- Improving the basic PID control algorithm (2:33)
- PID control of a mass-spring-damper (4:10)
- P, PI, and PD variants of PID control (2:42)
- Empirical PID gain tuning (7:08)
Sample Code: None.
Chapter 10: Analog Input
Reading: Chapter 10
Video:
Sample Code:
Chapter 11: Brushed Permanent Magnet DC Motors
Reading: Chapter 11
Video:
- Intro to brushed permanent magnet DC motors, part 1/2 (4:31)
- Intro to brushed permanent magnet DC motors, part 2/2 (7:10)
- Brushed DC motor equations (6:53)
- Brushed DC motor speed-torque curve (5:59)
- DC motor output power (2:05)
- Friction in DC motors (0:55)
- A DC motor data sheet (4:34)
Chapter 12: Motor Sizing
Reading: Chapter 12
Video:
- Introduction to gears (4:12)
- Gear efficiency (2:40)
- Types of gears (3:47)