Difference between revisions of "ME 333 Readings, Videos, and Sample Code"

From Mech
Jump to navigationJump to search
(Replaced content with "'''This page is now obsolete. It was last used for ME 333 in January to March, 2015. Please consult the videos linked to the NU32 page.''' (If you really want ...")
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''This page is now obsolete. It was last used for ME 333 in January to March, 2015. Please consult the videos linked to the [[NU32|NU32 page]].'''
'''This page is now obsolete. It was last used for ME 333 in January to March, 2015. Please consult the videos linked to the [[NU32|NU32 page]].'''


(If you really want to see this out-of-date page, it is [[OBSOLETE NU32 video page|here]].)
Readings, videos, exercises, and sample code for [[ME 333 Introduction to Mechatronics|ME 333 Introduction to Mechatronics]].

If you have questions about the readings or videos, you can [https://docs.google.com/forms/d/1V5VmjJdQGrsS3PjslubUS3cHMgHWLJCCPHxrewsFAyA/viewform post them (anonymously if you wish) for possible discussion in the next class], or use the Canvas discussion group for an online discussion

You can download the most updated version of the class readings [[Media:book-current.pdf|here]].

===Appendix: A Crash Course in C===

'''Reading''': [[Media:book-current.pdf|A Crash Course in C]], [[C Compilers]]

'''Videos''':
# [http://www.youtube.com/watch?v=tVInDFCDVZA&feature=youtu.be '''Writing your first program in C, HelloWorld.c'''] (5:09). Chapter A.1. Exercises: 1.
# [http://www.youtube.com/watch?v=fjSGtiPb-YY&feature=youtu.be '''Differences between C and MATLAB'''] (7:30). Chapter A.2. Exercises: 2, 3.
# [http://www.youtube.com/watch?v=kC4EoTxnJys&feature=youtu.be '''Binary and hexadecimal (Base 2 and 16)'''] (4:47). Chapter A.3.1. Exercises: 4, 6.
# [http://www.youtube.com/watch?v=V1mBtAZxHgw&feature=youtu.be '''Data types'''] (5:30). Chapter A.3.1. Exercises: 8, 10.
# [http://www.youtube.com/watch?v=4XleTmp-RR4&feature=youtu.be '''Using the data types'''] (3:49). Chapter A.3.1. Exercises: 11.
# [http://www.youtube.com/watch?v=jsmCIpBeKjk&feature=youtu.be '''Representations of data types'''] (5:15). Chapter A.3.1. Exercises: 12, 13.
# [http://www.youtube.com/watch?v=47IS8VtAM9E&feature=youtu.be '''Pointer basics'''] (5:54). Chapter A.3.2. Exercises: 14, 15.
# [http://www.youtube.com/watch?v=yBLApvS7fcY&feature=youtu.be '''Sample program: printout.c'''] (5:55). Chapter A.4. Exercises: 16 (not covered in video, reading only) 17, 18.
# [http://www.youtube.com/watch?v=YH-h-hGHIBw&feature=youtu.be '''Sample program: datasizes.c'''] (2:57). Chapter A.4. Exercises: 9.
# [http://www.youtube.com/watch?v=HXXCdVuGm70&feature=youtu.be '''Sample program: overflow.c'''] (2:43). Chapter A.4. Exercises: 19.
# [http://www.youtube.com/watch?v=dd_Uk00yURI&feature=youtu.be '''Sample program: typecast.c'''] (5:43). Chapter A.4. Exercises: 20.
# [http://www.youtube.com/watch?v=MQaHeovdTCU&feature=youtu.be '''invest.c, part 1/5: intro to a typical C program'''] (4:18). Chapter A.4. Exercises: 23.
# [http://www.youtube.com/watch?v=CGmxOs7uxwI&feature=youtu.be '''invest.c, part 2/5: overview'''] (3:58). Chapter A.4. Exercises: 24, 25.
# [http://www.youtube.com/watch?v=x218qBniZdo&feature=youtu.be '''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.
# [http://www.youtube.com/watch?v=2Rl3Dno42pc&feature=youtu.be '''invest.c, part 4/5: sections 5-6: helper function prototypes and the main function'''] (4:40). Chapter A.4.
# [http://www.youtube.com/watch?v=soT9_c6XXko&feature=youtu.be '''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).
# [http://www.youtube.com/watch?v=5UMHbzZGQuE '''Header files and libraries'''] (9:31).

'''Sample Code''':

*'''Section A.1''': [[Media:CCCHelloWorld.c|HelloWorld.c]]
*'''Section A.4''': [[Media:CCCprintout.c|printout.c]], [[Media:CCCdatasizes.c|datasizes.c]], [[Media:CCCoverflow.c|overflow.c]], [[Media:CCCtypecast.c|typecast.c]], [[Media:CCCinvest.c|invest.c]]
*'''Section A.4.16''': [[Media:CCChelper.h|helper.h]], [[Media:CCChelper.c|helper.c]], [[Media:CCCmain.c|main.c]]
*'''Problems, Section A.5''': [[Media:CCCbubble.c|bubble.c]], [[Media:CCClights.c|lights.c]], [[Media:CCChexdump.c|hexdump.c]]

'''Microchip Documentation''':

[http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC32MX795F512L Microchip PIC32MX795F512L]

----

===Chapter 1: Quickstart===

'''Reading''': [[Media:book-current.pdf|Chapter 1]]

'''Videos''': none

'''Code''': [[Media:PIC32quickstart.zip|PIC32quickstart.zip]]
<!--
'''Sample Code''':
*'''Section 1.3''': [[Media:PIC32quickstart.zip|PIC32quickstart.zip]]
Individual files:
** [[Media:NU32bootloader.hex|NU32bootloader.hex]]
** [[NU32: Bootloading from command line]]
** [[Media:NU32test.hex|NU32test.hex]]
** [[Media:simplePIC.c|simplePIC.c]]
** [[Media:NU32bootloaded.ld|NU32bootloaded.ld]]
** [[Media:simplePIC_standalone.c|simplePIC_standalone.c]]
** [[Media:talkingPIC.c|talkingPIC.c]]
** [[Media:NU32.c|NU32.c]]
** [[Media:NU32.h|NU32.h]]
-->

----

===Chapter 2: Looking Under the Hood: Hardware===

'''Reading''': [[Media:book-current.pdf|Chapter 2]]

'''Videos''':
# [http://youtu.be/xaq6RAO9d3o '''Introduction to the PIC32 microcontroller'''] (5:10).
# [http://youtu.be/UOv0zG_04Bg '''Introduction to the PIC32 architecture'''] (6:02).
# [http://youtu.be/YrkUKYBcVA8 '''The PIC32 physical memory map'''] (5:20).
# [http://youtu.be/CFcf7_xXZpc '''Introduction to the NU32 development board'''] (4:03).

----

===Chapter 3: Looking Under the Hood: Software===

'''Reading''': [[Media:book-current.pdf|Chapter 3]]

'''Videos''':

# [http://www.youtube.com/watch?v=VqCPafcov1c '''The PIC32 virtual memory map'''] (5:24).
# [http://www.youtube.com/watch?v=sSvou7gxsaQ '''Understanding simplePIC.c'''] (5:42). (The latest version of simplePIC.c includes xc.h, not plib.h)
# [http://www.youtube.com/watch?v=inq7l6p_ppE '''Digging through PIC32 header files'''] (7:12). (Information on plib.h, which is no longer included in simplePIC.c, can be ignored. Focus on xc.h and later.)
# [http://www.youtube.com/watch?v=ZlJmjcGkTl4 '''The PIC32 executable build process'''] (4:26). (The command line compiler commands are a bit different than in Chapter 3, but the main ideas are the same.)

<!--
'''Sample Code''':
* [[Media:Bootloader.zip|Bootloader.zip]]
-->
----

===Chapter 4: Using Libraries===

'''Reading''': [[Media:book-current.pdf|Chapter 4]]

'''Videos''':
# [https://www.youtube.com/watch?v=ovhNxIq9Kwo '''The NU32 library'''] (5:28).

'''Code''': [[Media:04_Code.zip|04_Code.zip]]
<!--
'''Sample Code''':
*'''Section 4.5''':
** NU32.c and NU32.h are included in Chapter 1
** [[Media:LCD.c|LCD.c]]
** [[Media:LCD.h|LCD.h]]
** [[Media:LCDwrite.c|LCDwrite.c]]
-->
----

===Chapter 5: Time and Space===

'''Reading''': [[Media:book-current.pdf|Chapter 5]]

'''Videos''':
# [http://www.youtube.com/watch?v=Yxq2GuCQed0&feature=youtu.be '''Timing PIC32 code and the disassembly file'''] (8:27). (Note that the timing.c code is slightly different from what is seen in Chapter 5.)
# [http://www.youtube.com/watch?v=994vc171K4A '''The PIC32 memory map file'''] (7:15). (Note that the map file looks a bit different from the one in the book, due to changes in timing.c.)

'''Code''': [[Media:05_Code.zip|05_Code.zip]]
----

===Chapter 6: Interrupts===

'''Reading''': [[Media:book-current.pdf|Chapter 6]]

'''Videos''':
# [http://www.youtube.com/watch?v=Kmss3C732Kg&feature=youtu.be '''Overview of interrupts on the PIC32'''] (4:29).
# [http://www.youtube.com/watch?v=aLJX-CxMb-w&feature=youtu.be '''PIC32 interrupt SFRs'''] (6:22).
# [http://www.youtube.com/watch?v=aIClq90qV7E&feature=youtu.be '''The PIC32 shadow register set'''] (1:25).
# [http://www.youtube.com/watch?v=6Ap3H39iCVI&feature=youtu.be '''Seven steps to using an interrupt with the PIC32'''] (3:47)
# [http://www.youtube.com/watch?v=40YZFMw2nBs&feature=youtu.be '''PIC32 interrupt code example'''] (4:10) NOTE: The code in this video is an old version of the code in Chapter 6. Do not use this code, use what's in Chapter 6.

'''Code''': [[Media:06_Code.zip|06_Code.zip]]

<!--
'''Sample Code''':
* [[Media:INT_core_timer.c|INT_core_timer.c]]
* [[Media:INT_ext_int.c|INT_ext_int.c]]
* [[Media:INT_timing.c|INT_timing.c]]
-->
----

===Chapter 7: Digital Input and Output===

'''Reading''': [[Media:book-current.pdf|Chapter 7]]

'''Videos''':
# [http://youtu.be/QweUbVV6zOQ '''Intro to digital I/O on the PIC32'''] (6:24)
# [http://youtu.be/TyhJXYsvSgE '''Change notification on the PIC32'''] (1:18)
# [http://youtu.be/hgeACkWSYxc '''PIC32 program with digital I/O and change notification'''] (9:02)

'''Code''': [[Media:07_Code.zip|07_Code.zip]]
<!--
'''Sample Code''':
* [[Media:DIO_sfrs.c|DIO_sfrs.c]]
* [[Media:DIO_plib.c|DIO_plib.c]]
-->
----

===Chapter 8: Counters / Timers===

'''Reading''': [[Media:book-current.pdf|Chapter 8]]

'''Videos''':
# [http://youtu.be/wOeRTo55BCE '''Intro to PIC32 counter/timers'''] (5:59)
# [http://youtu.be/5bNf9GZUdk8 '''PIC32 timer SFRs'''] (5:55)
# [http://youtu.be/uv-vANdWVeQ '''Using PIC32 timers to generate interrupts'''] (3:34)
# [http://youtu.be/Y5MaR-D7YuM '''Example PIC32 timer interrupt program'''] (5:08)

'''Code''': [[Media:08_Code.zip|08_Code.zip]]

<!--
'''Sample Code''':
* [[Media:TMR_5Hz.c|TMR_5Hz.c]]
* [[Media:TMR_external_count.c|TMR_external_count.c]]
* [[Media:TMR_pulse_duration.c|TMR_pulse_duration.c]]
-->
----

===Chapter 9: Output Compare===

'''Reading''': [[Media:book-current.pdf|Chapter 9]]

'''Videos''':
# [http://youtu.be/U4T53SFPhXI '''Introduction to the PIC32 output compare'''] (5:30)
# [http://youtu.be/iQGtVHH4UM0 '''A PWM program on the PIC32'''] (3:12)
# [http://youtu.be/xhdiiYYF-zY '''Using output compare to create an analog output'''] (3:09)

'''Code''': [[Media:09_Code.zip|09_Code.zip]]

<!--
'''Sample Code''':
* [[Media:OC_PWM_sfrs.c|OC_PWM_sfrs.c]]
* [[Media:OC_PWM_plib.c|OC_PWM_plib.c]]
* [[Media:OC_analog_out.c|OC_analog_out.c]]
* [[Media:OC_signal.m|OC_signal.m]]
-->

----

===Chapter 10: Analog Input===

'''Reading''': [[Media:book-current.pdf|Chapter 10]]

'''Video''':
# [http://youtu.be/JvlPeWEU5i8 '''The PIC32 analog-to-digital converter'''] (6:47)

'''Code''': [[Media:10_Code.zip|10_Code.zip]]

<!--
'''Sample Code''':
* [[Media:ADC_Read2.c|ADC_Read2.c]]
* [[Media:ADC_max_rate.c|ADC_max_rate.c]]
-->
----

===Chapter 11: PID Feedback Control===

'''Reading''': [[Media:book-current.pdf|Chapter 11]]

'''Videos''':
# [http://youtu.be/taSlxgvvrBM '''Introduction to PID control'''] (4:28)
# [http://youtu.be/La9vll93h44 '''Improving the basic PID control algorithm'''] (2:33)
# [http://youtu.be/T9_C3jhnQXI '''PID control of a mass-spring-damper'''] (4:10)
# [http://youtu.be/LE6SIRA2v48 '''P, PI, and PD variants of PID control'''] (2:42)
# [http://youtu.be/uXnDwojRb1g '''Empirical PID gain tuning'''] (7:08)

'''Code''': [[Media:PID_Code.zip|PID_Code.zip]]

----

===Chapter 12: Feedback Control of LED Brightness===

'''Reading''': [[Media:book-current.pdf|Chapter 12]]

'''Code''': [[Media:LED_Code.zip|LED_Code.zip]]

'''A faster version of nu32utility''': [[Media:nu32utility_fast.zip|nu32utility_fast.zip]] - replace your nu32utility program with this version (remember, to compile it use "gcc nu32utility.c -o nu32utility" on mac and "gcc nu32utility.c -o nu32utility -lwinmm" on windows.)

----

===Chapter 13: Brushed Permanent Magnet DC Motors===

'''Reading''': [[Media:book-current.pdf|Chapter 13]]

'''Video''':
# [http://youtu.be/Mj2bV03mVM8 '''Intro to brushed permanent magnet DC motors, part 1/2'''] (4:31)
# [http://youtu.be/9n9QiALi4E4 '''Intro to brushed permanent magnet DC motors, part 2/2'''] (7:10)
# [http://youtu.be/8_SQnN6eNz4 '''Brushed DC motor equations'''] (6:53)
# [http://youtu.be/pxtRlKs0pAg '''Brushed DC motor speed-torque curve'''] (5:59)
# [http://youtu.be/drkC5P11Ch4 '''DC motor output power'''] (2:05)
# [http://youtu.be/nSPgvxoKZIg '''Friction in DC motors'''] (0:55)
# [http://youtu.be/SM1b0co89yg '''A DC motor data sheet'''] (4:34)
----

===Chapter 14: Motor Sizing===

'''Reading''': [[Media:book-current.pdf|Chapter 14]]

'''Video''':
# [http://youtu.be/D1chF7_pIR0 '''Introduction to gears'''] (4:12)
# [http://youtu.be/vVg8jb5vaMI '''Gear efficiency'''] (2:40)
# [http://youtu.be/Cc9uvnWaNl0 '''Types of gears'''] (3:47)
----

===Chapter 15: Motor Control===

'''Reading'''':

'''Video''':
# [http://youtu.be/6R_3jHeimiE '''Driving DC motors, part 1/3: Flyback diodes'''] (7:03)
# [http://youtu.be/m5JYkgCRbBI '''Driving DC motors, part 2/3: PWM'''] (3:05)
# [http://youtu.be/fVgnUWIWzZ8 '''Driving DC motors, part 3/3: H-bridges'''] (4:22)
# [http://youtu.be/LdVyC8BOBjA '''A professional motor control system'''] (6:55)
----

===Chapter 16: A Motor Control System===

'''Reading''': [[Media:book-current.pdf|Chapter 16]]

'''Code''': [[Media:Motor_Project_Code.zip|Motor_Project_Code.zip]]
----

===UART===
** [[Media:UART_loopback.c|UART_loopback.c]]
** [[Media:UART_pic_to_pic.c|UART_pic_to_pic.c]]
** [[Media:UART_hfc_to_pc.c|UART_hfc_to_pc.c]]
** [[Media:UART_xbee.c|UART_xbee.c]]
** [[Media:UART_pic_to_matlab.c|UART_pic_to_matlab.c]]
** [[Media:UART_pic_to_matlab.m|UART_pic_to_matlab.m]]
** [[Media:UART_pic_to_processing.c|UART_pic_to_processing.c]]
** [[Media:UART_pic_to_processing.pde|UART_pic_to_processing.pde]]
** [[Media:UART_pic_to_html5.zip|UART_pic_to_html5.zip]]

----

===SPI Communication===
** [[Media:SPI_loopback.c|SPI_loopback.c]]
** [[Media:SPI_pic_to_pic.c|SPI_pic_to_pic.c]]
** [[Media:SPI_DAC_MCP4922.c|SPI_DAC_MCP4922.c]]
** [[Media:SPI_ADC_MCP3008.c|SPI_ADC_MCP3008.c]]
** [[Media:SPI_SRAM_23K256.c|SPI_SRAM_23K256.c]]
** [[Media:SPI_microSDcard.c|SPI_microSDcard.c]]
** [[Media:SPI_accelerometer_ADXL362.c|SPI_accelerometer_ADXL362.c]]

----

===I2C Communication===
** [[Media:I2C_loopback.c|I2C_loopback.c]]
** [[Media:I2C_pic_to_pic.c|I2C_pic_to_pic.c]]
** [[Media:I2C_DAC_MAX518.c|I2C_DAC_MAX518.c]]
** [[Media:I2C_ADC_NAU7802.c|I2C_ADC_NAU7802.c]]
** [[Media:I2C_SRAM_PCF8570P.c|I2C_SRAM_PCF8570P.c]]
** [[Media:I2C_accelerometer_LSM303DLHC.c|I2C_accelerometer_LSM303DLHC.c]]
----

===USB===
** [[Media:USB_HID.zip|USB_HID.zip]]
** [[Media:USB_CDC.zip|USB_CDC.zip]]
** [[Media:USB_thumbDrive.zip|USB_thumbDrive.zip]]

----

===Input Capture===
** [[Media:IC_loopbackPWM.c|IC_loopbackPWM.c]]
** [[Media:IC_readRemoteControl.c|IC_readRemoteControl.c]]

----

===Comparator===
** [[Media:COMP_internal.c|COMP_internal.c]]
** [[Media:COMP_output16values.c|COMP_output16values.c]]
** [[Media:COMP_INT2values.c|COMP_INT2values.c]]

----

===Watchdog Timer===
** [[Media:WDT_enableReset.c|WDT_enableReset.c]]
** [[Media:WDT_checkPreviousReset.c|WDT_checkPreviousReset.c]]

----

===Storing Data in Flash Memory===
** [[Media:FLASH_write.c|FLASH_write.c]]

----

===Power Saving===
** [[Media:PWR_sleep.c|PWR_sleep.c]]

----

===Real-time Clock and Calendar===
** [[Media:RTCC_set.c|RTCC_set.c]]

----

===Controller Area Network (CAN)===
** [[Media:CAN_pic_to_pic.c|CAN_pic_to_pic.c]]

----

===Direct Memory Access===
** [[Media:DMA_adc.c|DMA_adc.c]]
** [[Media:DMA_spi.c|DMA_spi.c]]

----

===Sensors and Signal Conditioning===

----

===Digital Signal Processing===

----

===Chapter 26: DC Motor Control===

----

===Chapter 27: Brushless Motor Control===

----

===Chapter 28: Stepper Motors and RC Servos===

----

===Chapter 29: Connecting to an Android Device===

----

Latest revision as of 02:21, 21 December 2015

This page is now obsolete. It was last used for ME 333 in January to March, 2015. Please consult the videos linked to the NU32 page.

(If you really want to see this out-of-date page, it is here.)