Monday, June 5, 2017

Outline of what's in the test

A outline of what's in the test.

The test will be in our normal classroom on Thursday 15 June at 10:08am

There will be a picture of an Arduino like this below and you'll annotate it with text and arrows. You may be asked to identify a crystal, capacitor, resistor, LED or voltage regulator too.




There will be one of the two pages from the Atmel mega 328 family's data pdf. You'll be required to comment on some of the functions in the page below and most of the features in the very front page.







There will be questions about a schematic involving the Arduino red board like the one below.


The red board schematic is on another page and in Spark Fun's site.



Test Information

There will be a theory test on Thursday 15 June. It will be closed book and you must complete it in 1 hour and 45 minutes.  All the items in the test we have discussed in class or will be notified in a revision class prior to the test. 

There will be a question on the main parts of the Arduino. See the labelled diagram above. This is not exactly the same as our Arduino but, apart from the DIL processor, USB to serial IC and colour, is pretty close.

There may be a question on the page above called The Front Page of the Mega328. You will be expected to write a sentence explaining some of the features listed. 

There may be questions on the functions diagram of the Mega328. You will be given a copy of this diagram and be expected to write a short paragraph on up to three blocks.

There will be a question about the Arduino schematic diagram above or similar.

Also there's buggy program. A program will be given to you with errors in it. You will have to identify the errors. Mostly syntax violations.

A problem to do with sampling real world inputs will be given and you will be asked how you would respond to this using the Arduino.

You will be asked to write a simple assembly language program. You will be asked to write a program in Arduino C.

There may be other questions but only on items we have studied in class including serial buses, pin outs of the Arduino and the mega328p, voltage dividers, assembly language etc.

Please contact me about any problems. Good luck.

PeterB





Monday, May 8, 2017

arduino schematic



The SPI bus

Fastest of the serial I/O on the Arduino.

A good tutorial on spi using a digital potentiometer chip here

A tutorial on the spi bus, more technical here

Two Arduino's connected via spi here. Code via link to github.





Sunday, May 7, 2017

AVR assembler delays

Using delays in AVR studio



Write a variation on the above program to produce any delay required for your project.

AVR assembler example




You'll need to download AVR Studio 4.19 for further work on AVR assembly language.

Monday, May 1, 2017

The I2C bus

Most popular of the serial buses. Uses one wire for clock and one wire for bidirectional data. Based on Phillips' iic network. Lots of chips use the i2c protocol.

Good short introduction here. Not Arduino based.

Using i2c to connect arduino to eeprom chip that holds 256k bits, here.



Interesting use of i2c OLED display.

SPI or i2c. Which one is ""better"?

This video is about the IIC bus and gives a brief overview.

and this one is more of an ad but has some essential information.

This You Tube video is a bit more comprehensive than the above two.

A good example is here.

Wednesday, April 12, 2017

IO Ports

All AVR devices, like our Mega328, have ports. Usually they are a group of 8 pins that send or receive binary to or from the outside world.

There are three registers associated with each port.

  1. The output register PORTX
  2. The input register PINX
  3. The data direction register DDRX.
For instance port B is made up of 8 pins PB0, PB1, PB2 ....PB7. It has three associated registers:
  1. PORTB
  2. PINB
  3. DDRB
These registers live in the I/O register space just above the 32 general purpose registers.




Some good port pages:
Useful but about GCC.
Some good stuff here.

Wednesday, April 5, 2017

RS232 protocol

The RS232 protocol has been around for many years now. There are various versions and we have to be aware that non-standard applications are used often. The main aspects are the sockets and plugs and the packet sending rules.





Monday, March 6, 2017

Voltage division

Most sensors are detected via a changing voltage that's fed into the analog inputs using voltage division.


 There are some good introductions to analog voltage on the Arduino including this one.

And here's the Arduino tutorial about the analog pins.




Sunday, March 5, 2017

LDR, our first sensor






Some good code and information here.
Light dependent resistor circuit. See http://www.ladyada.net/learn/sensors/cds.html





Two LED program

/*
Blink2
Turns on a LED on for half a second, then off for half a second, repeatedly. It also does the same to an off-board LED connected to pin 12 so that when one LED is on the other is off.
The circuit:
* LED connected from digital pin 13 to ground via resistor.
* second LED connected from digital pin 12 to ground via resistor. I used 330 ohms.
* Note: On most Arduino boards, there is already an LED on the board
connected to pin 13.
Created 1 June 2005
By David Cuartielles. Adapted by Peter Brook
based on an orginal by H. Barragan for the Wiring i/o board
*/
int ledPin = 13; // LED connected to digital pin 13
int redLedPin = 12; // LED connected to digital pin 13
int del =500;
// The setup() method runs once, when the sketch starts
void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
pinMode(redLedPin, OUTPUT);
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop()
{
digitalWrite(ledPin, HIGH); // set the LED on
digitalWrite(redLedPin, LOW); // set the LED on
delay(del); // wait
digitalWrite(ledPin, LOW); // set the LED off
digitalWrite(redLedPin, HIGH); // set the LED on
delay(del); // wait
}

Monday, February 20, 2017

Some background




The classic intro on "talk like a pirate day"


Also: lots about LEDs:

More LEDs and good planning.


LED Pixel Matrix Project

http://www.youtube.com/watch?v=hEKEM6ZOsZE

A good intro via Jaycar (but slightly different Arduino)

Another Arduino introduction. This time for the Uno.

Also  an introduction the Chinese clone Arduinos. Cheap but don't help the Arduino community.



The maker movement




Massimo Banzi, inventor of Arduino, talks about maker revolution in TED talk.

The kits are designed for inventing
https://nicegear.co.nz/electronics-gear/sparkfun-inventors-kit-v32/

Adafruit are leaders in the Maker Movement
https://www.adafruit.com/category/17

Link to Wikipedia article on open source hardware

The maker culture explained


Dunedin's makerspace

Hackaday uses existing stuff to repurpose into something new.

Atmel, big US microprocessor company, embraces Maker Movement


Some current notions




1 amp per second means that 1.6x10^19 electrons pass a given point each second. That comes from the definition of a Coulomb as 1 amp per second and that one Coulomb is 1.6x10^19 electrons.




Monday, February 6, 2017

Checklist 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.


The kit guide





Find the contents here:

Tasks

Tasks

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 your cell phone number 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.5 or (stop press) 1.6.
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.

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 View the little video on resistors at this site . Attach a colour code table to your blog and take a photo of three of your resistors in your kit with their resistances shown in text labels near each resistor.

18.2 (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. Find 5 RS232 devices you can use with an Arduino. Put the names and the functions in a list. Show a picture of a pin out where one of the devices is connected to an Arduino.

21.  Find 5 I2C devices you can use with an Arduino. Put the names and the functions in a list. Show a picture of a pin out where one of the devices is connected to an Arduino.



Wednesday, February 1, 2017

Welcome

Welcome to the 2017 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.