Monday, February 24, 2014

Check list for first two weeks

Make sure you have addressed the following topics.

Week one
Access class Moodle site.
Access class blog.
Created own blog.
Put blog URL into Moodle wiki.
Started tasks from class blog.
Purchased Arduino kit.
Unpacked kit and got default led flash after plug in.

Week two
Get Arduino IDE going.
Look at main Arduino site.
Checked pages on how to get started.
Found example programs in IDE.
Run famous Blink Program.
Did simple mods to Blink and ran them.
Understand structure of Arduino sketch.
Found the Arduino C language reference.
Installed kit's project software in examples.
Do blink sketch from kit book.
Download Fritzing.
Accessed specs for LED project.
Continued with blog tasks.



Sunday, February 16, 2014

List of Tasks. You have to respond to all of these in your blog.
Please number your tasks in your blog so they can be found easily.


1. Start your blog.

2. Edit the permissions in your blog so that just prjbrook@gmail.com is invited to see it.

3. Make sure you can access the Arduino environment. Find the Blink program in the examples and paste into your blog. Test that it compiles in the Arduino IDE but you don't have to send it to your Arduino yet.

4. What is the name of the Atmel microprocessor in your Arduino board? Insert the link to the large pdf from Atmel associated with this chip. Insert an image of the first page of this pdf. Finally insert a picture of the pin-out of this chip.

5. Find the forum associated with main Arduino site. Take a screen shot of something in the forum that interests you with a comment on what appeals to you.

6. Find a picture of your Arduino  publish it in your blog and label the main parts. You may need a special graphics program to do this. Add another interesting Arduino variation. You can see some on this page.

7. Put the url for your blog into the wiki in Moodle. Add some other contact details. If you wish to remain private that's OK too.

8. Check out the following sites. Insert a screen shot and a URL link into your blog. Small images or large ones are both OK .
The Arduino environment version 1.0.
The Processing environment.
The Fritzing files.
Link to Blogger.
GNU gcc
Moodle
AVR Studio download. Latest version.
PDF of ATMega 328
PDF of specs of USB-to_serial chip. The one used in the Duemilanove.
Good pic of our arduino clone
The MindKits site.
One cool video on Youtube.
One other interesting internet resources. eg "Make" site or electonics sites.
The Nice Gear store in Timaru that sells good Arduinos.

9. Find 4 more Arduino LED related videos in Youtube, BlipTV etc. Put a link and a two-sentence review about each one in your blog. Be prepared to talk about one or more of them to the class.

10. Establish a sketchpad folder in the D Drive or in a USB pen or somewhere you can get to.


The next tasks will relate to programming your Arduino using the Blink program with variations. So you might like to get going on setting things up.

All programs from now on need their source code to be entered into your blog with comments. Make sure you comment the the top of your blog posting with the number of the task and enter too the task number as a //coment in your code.

11. Copy the famous Blink program to your blog and make sure you can run it on you Arduino.
12. Create a variation in timing and put your new program into your blog. Indicate with a comment what your change was.
13. Write a program that will have the LED mostly off. That is it only blips on once a second if you look closely.

14. Same as 13 but this time have your LED mostly on.
15. Repeat 14 with an external LED on a breadboard.
16. Copy the two LED program into your blog and run it.
17. Insert a variation so that the LEDs blink together.
18. Write a program so that one LED is blinking fast while the other blinks slowly.

18.1 (Look at analog pins.) Pin A0 will read any voltage value between 0 and 5 volts. Set up your Arduino board so that its circuit looks like the Fritzing diagram on this site. Run the program and make a change with a comment in your blog.
(Now looking at serial monitor.)
19. Copy the ASCII printing program from http://arduino.cc/en/Tutorial/ASCIITableand run it. A good background site is the lady ada serial tutorial.

20. Same as 19 but make some changes in formatting. Indicate your changes through a comment.
20.1 Have a look at this blog and run the following programs as they are set out in the blog then make some interesting chnages that you indicate with a comment and publish your versions in your blog.
20.11 Echo, echo.
20.12 Stage 2, delimiters.
20.13 Stage 3, Arduino maths.
20.14 Stage 4, simple transmission of a double.
20.15 Stage 4 again, Double, double.
20.16 Stage 5, analog read. (Very similar to 18.1 above.)

21. Randoms. Write a program to output random numbers between 0 and 100 to the serial terminal.
22. Write a program to output the throwing of a dice every second and display the number that comes up.
23. Same as 22 but display as well the number of sixes that you have thrown so far.
24. Same as 23 but speed it up and stop when you get to 25 sixes.
25. Same as 24 but don't display the dice numbers, rather say how many throws it takes to get to 100 sixes. Then start again each time you get to 100 sixes.

25A. Write a program that takes the output of the voltage between two resistors into an analog port pin for reading. This voltage will be between 0 and 5 volts. Output the number you get between 0 and 1023 to the screen. (Try different resisitors and predict what will happen.)

25B. Same as 25A but this time make one of the resistors a variable resisitor so that your output will change.

25.5 Download the AVR Studio assembler and simulator, AVR Studio 4, from:

I:\COURSES\AITEIT3\BITY2\IN620 EMBEDDED SYSTEMS.
 It's a self install exe file called AvrStudio4Setup.exe. This is a simpler version that will do all we want for our course, but you can download more modern and fuller systems from Atmel.

25.6 Build the program in the blog page called  "Our first AVR Studio program". Then take a screen shot for your blog showing some register changes.

25.7 Try to explain using a diagram or text why the instruction inc r1 is compiles to $1394 in code. Use the help screen in AVR Studio as in blog post on inc opcode above.

25.8 Ditto for inc r21.

25.85 Ditto for ldi r30,$r36

25.86 Explain what these instructions do in your own words: inc, dec, ldi, mov, rjmp, .include

25.87 Write a small assembler program to put $02 into r2 and r3 and put $11 into r11.
25.88 Write a small piece of code to subtract one from what's in r4 and put result into r5.

26. Copy the code from the blog called "Delays in Assembler" into a new AVR Studio project. Run it and write in your blog the number of cycles required to get to the nop instruction. 
27. Extend the program above to get r17 to count the number of times through the original subroutine. Make this a maximum, that is keep going until r17 is 0 again. Put your code into your blog and say how many microseconds your revised program uses up.

28) Look at posting "Delays in assembler and some tasks" and do the ten tasks there.

29) Write an assembler program in AVR Studio 4 that writes out 0,1,2, $ff into r3 with a 50ms (approx) delay between each write. Stop after writing 0 for the second time.

30) Repeat but his time output 0,1,2..$ff out PORT C.

31) Repeat 30 but this time output $00 and $01 alternately out PORT C 256 times.

32) Write a delay subroutine that lasts for exactly 50ms in AVR Studio.

33) What binary instruction corresponds to (a) inc r12 (b) ret.

34. Check out the interrupts PowerPoint in the Moodle site. Give an example of where you would use interrupts in a project you might do and a link to a good Arduino interrupt site. 






Welcome to the 2014 Embedded class




Most of our work will come from tasks set on this blog and you will respond with your own work in your blog. For example you will have to write a short program to flash a LED early on the course. You get this going in the Arduino environment then transfer the code, and perhaps, pictures, links or movies onto your blog page that corresponds with the task. Please remember to put the task number somewhere in or near the title for easy marking purposes.

Sometimes extra information is given in our Moodle pages.