Home Final Project Week 1 Week 2a Week 2b Week 3 Week 4 Week 5 Week 6 Week 7 Week 8 Week 9 Week 10 Week 11 Week 12 Week 13 Week 7: Embedded Programming
Week 7: Embedded Programming
7.1 Introduction
The final board I fabricated in week 5, incorporated a D11D microcontroller, and is shown in the image below. I did not read the D11D's 981 page datasheet in its entirety, but instead focused on the following sections: pinout, block diagram, memory, power supply, internal clock, electrical characteristics, packaging information, ports, and analog-to-digital convertor. I will discuss findings and comparisons with other microcontrollers in the group assignment section. While reading the datasheet, I often found myself searching on the Internet for more layman component descriptions. Prior to this week it was difficult for me to fathom how the capabilities of a microcontroller fit in such a small package, and after learning more about the D11D I am even more astonished.


7.3 My Coding
Previously to this course, my programming experience was extremely limited. I was briefly introduced to the enterprise of Arduino during a previous course, so I elected to use Arduino's IDE application which I already had installed on my computer. Working in Arduino's IDE I developed code using programming language "C". The three simple codes that I developed to demonstrate the programmability of my board are presented in the following subsections.


7.3.1 LED Flash Code
The first code I developed was to make the LED on my board blink at a set frequency. In the code shown to the left, I set the LED to an ON duration of 1 sec, followed by an OFF duration of 1 sec. Using an oscilloscope to probe the pin output to the LED, I was able to observe that the LED was in fact cycling ON/OFF once every two seconds. The below image shows the oscilloscope screen while the LED was cycling.



7.3.2 LED-Button Code
The second code I developed was to control the ON/OFF of the LED with a button. I was aware that my button was contacted to an analog pin of the microcontroller, but since the button is either ON or OFF, I used the "digitalRead" command instead of the "analogRead" command in my code. Again, I used an oscilloscope, this time to observe the button bounce that Anthony demonstrated during week 5. I added a 50 ms delay between the ‘if’ statements of the void loop to eliminate the initial button bounce.



7.3.3 Motor Code
The final code I developed was designed to test my final project prototype shown in the below image. Using the MOSFETs on my board and a DC power supply, I created a code that cycles current to wire coil pairs around my induction machine. Sadly, the magnetic field induced by the current carrying coils was not strong enough to create rotation of the rotor. Using the Hall Effect sensor shown below I attempted to increase the induced magnetic field by decreasing the distant between wire coils and the permanent magnetics affixed to the rotor and by adding iron cores to the coils. These alternates doubled the magnetic field strength, but was still not sufficient for inducing rotation in the rotor. I was able to use an oscilloscope to confirm that the MOSFETs were cycling OPEN/CLOSED as anticipated. To have success with my final project I will have to refine my design to increase magnetic field strength.

This is the Hall Effect sensor I used to measure the magnetic field induced by my wire coils.
This is the prototype I developed for testing my final project design; glad I made a prototype, because it looks like I have some significant changes to make.