FYS4240 / FYS3240, is all about how Micro-controllers, PC Processors and busses are made and gives you a very wide perspective in choice of connection technologies and micro controllers. Topics from internal structure of micro controllers to interfaces on it and parallel programming on multi core / multi processor machines. It also includes LABView and C programming for AVR micro controllers in the lab assignments. This course is recommended to take by all electronics, Robotics students and I would have a much wider point of view if I had taken this course in the beginning of my studies (something that did not happen because of lack of communication between physics department and departments of informatic). Here you can download the exam paper for spring 2011. (more…)
Computer based instrumentation and micro controllers, FYS4240 / FYS3240
August 31st, 2011 | Posted by in Arduino | Electronics | My Studies | Programming | Rapid Prototyping | Robotics | Shahab | UiO | VC++ | Video - (0 Comments)RxTx / Serial Communication on Windows
August 25th, 2011 | Posted by in Arduino | Electronics | IT | Java | Programming | Shahab - (0 Comments)- unzip rxtx-*-win32.zip
- copy rxtxSerial.dll / rxtxParallel.dll to %JAVA_HOME%\bin
(e.g. c:\Program Files\Java\j2re1.4.1_01) - copy RXTXcomm.jar to %JAVA_HOME%\lib\ext
Arduino Ethernet shield problem when on External Power
May 23rd, 2011 | Posted by in Arduino | Electronics | Shahab - (0 Comments)When Arduino/ethernet shield is connected with an external voltage source I have to press reset button to make it work. But when I use it with the USB source everything works fine. This code is not exactly pretty, but it solves the problem of the need to restart on Ethernet shield startup. Open relay and hooked the coil pins to ground and digital pin 02, and the switched pins to ground and the reset pin. The trick is to before initializing the Ethernet library, check an address in EEPROM. If the flag is 0, we set it to 1 and then trigger the relay, and the unit resets. If the flag is 1, we assume that we just did a warm reset and set the flag back to 0, for next time we power up.
<pre>int relayPin = 02;
int addr = 128;
void eepThang() {
eep_value = EEPROM.read(addr);
if (eep_value == 1) {
Serial.println("already reset. writing 0");
EEPROM.write(addr, 0);
}
else {
Serial.println("not reset.. writing 1, restarting");
Serial.println(eep_value);
EEPROM.write(addr, 1);
Serial.println("done wrote... here we go");
digitalWrite(relayPin, HIGH);
delay(1000);
}
}</pre>
source : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225354009/15
Processing, the key for Arduino board independent programming
May 23rd, 2011 | Posted by in Arduino | Electronics | Java | Processing | Programming | Robotics | Shahab - (0 Comments)When it comes to Arduino, there are several ways to do things. Using simple Arduino IDE to communicate with the board through serial port. Write a Java program to do it, or maybe do send orders to Arduino through your program that is not uploaded on Arduino card and can be changed anytime without even updating the pde file on the board. The tool that gives you the power to do this is called Processing & the library used exactly for Arduino is called StandardFirmdata. The very good thing about Processing is that it is based on Java and all Java codes works right out of the box on it. You can also import processing libraries into your Java framwork and enjoy the power of processing right in the middle of your Java project(in Eclipse).
The instruction to get Processing & Arduino talk together :
- Download this file.
- Unzip the library and copy the “arduino” folder into the “libraries” sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven’t made a “libraries” sub-folder, create one.)
- Run Arduino, open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduino board.
- Configure Processing for serial:http://processing.org/reference/libraries/serial/
- In Processing, open one of the examples that comes with with the Arduino library(in the same folder that we just unzipped).
- Edit the example code to select the correct serial port.
- Run the example.
>Arduino Nano and new possibilities in electronic design
April 30th, 2011 | Posted by in Electronics - (0 Comments)>The new Arduino Nano is the smallest and most versatile Arduino board yet. It contains an ATmega168 micro-controller (w/ boot loader), integrated USB (FTDI chip) w/ Mini-B jack, a full complement of i/o pins, an ICSP programming header, and on-board regulator. Measuring 0.73″ x 1.70″, it’s smaller and cheaper than the combination of Arduino Mini and Mini-USB adapter.
The possibilities that this state of art design brings to Walloid project can be new electronics design as it is now very easy to have a network of Arduino boards, communicating data, processing things faster, etc … My previous post about I2C is about the same idea; connecting multiple Arduino boards …
[youtube http://www.youtube.com/watch?v=FJR5wqiGLjM&w=425&h=349]
>I2C inter micro controller communication
First experiment, failed !!! The problem : Grounds were not connected together !!!
Second experiment, Succeeded :-)
Master Writer Code – Program for Arduino 1
// Wire Master Writer// by Nicholas Zambetti
// Demonstrates use of the Wire library// Writes data to an I2C/TWI slave device// Refer to the "Wire Slave Receiver" example for use with this
// Created 29 March 2006
// This example code is in the public domain.
#include
void setup(){ Wire.begin(); // join i2c bus (address optional for master)}
byte x = 0;
void loop(){ Wire.beginTransmission(4); // transmit to device #4 Wire.send("x is "); // sends five bytes Wire.send(x); // sends one byte Wire.endTransmission(); // stop transmitting
x++; delay(500);}
Slave Receiver Code – Program for Arduino 2
// Wire Slave Receiver// by Nicholas Zambetti
// Demonstrates use of the Wire library// Receives data as an I2C/TWI slave device// Refer to the "Wire Master Writer" example for use with this
// Created 29 March 2006
// This example code is in the public domain.
#include
void setup(){ Wire.begin(4); // join i2c bus with address #4 Wire.onReceive(receiveEvent); // register event Serial.begin(9600); // start serial for output}
void loop(){ delay(100);}
// function that executes whenever data is received from master// this function is registered as an event, see setup()void receiveEvent(int howMany){ while(1 < Wire.available()) // loop through all but the last { char c = Wire.receive(); // receive byte as a character Serial.print(c); // print the character } int x = Wire.receive(); // receive byte as an integer Serial.println(x); // print the integer}
>Use of FPGA, Pros & Cos vs. use of Arduino
March 30th, 2011 | Posted by in Electronics | Video | Walloid - (0 Comments)>[youtube http://www.youtube.com/watch?v=L2wsockKwPQ&w=480&h=390]
FPGA advantages
[youtube http://www.youtube.com/watch?v=gLxS9SvniA0&w=480&h=390]
One of the main disadvantages can be complexity.
>I2C Inter Board communication, Arduino
March 15th, 2011 | Posted by in Electronics | Walloid - (0 Comments)>http://www.arduino.cc/playground/Learning/I2C
http://en.wikipedia.org/wiki/I%C2%B2C
http://www.lammertbies.nl/comm/info/I2C-bus.html
http://absences.sofianaudry.com/en/node/10
>New challenges with the robot arm, while I am working with positioning. The prototype(robot arm) is not totally functional as just one of the three motors work the way it should. Problems with mechanic design, and the motor axle is worn away(3D printer product in plastic) …




