Category Archives: Tutorials

Introductory Videos on Gyroscopic Motion

I made a couple of videos to help introduce and explain the incredibly counter-intuitive concept of Gyroscopic Motion to students in a 3rd year Mechanical Engineering unit that I am a Teaching Assistant for at UWA. A small part of the explanation is in the context of the material provided in the unit, however all of the information that you need to form a basic understanding is present. Hopefully this can help others get their head around this crazy concept, I know it took me a little while to understand it when I first encountered it.

The maths is actually really simple with a basic high school understanding of vectors. So just keep that in mind. Don’t try and understand WHY it moves like it does, it is way too counter-intuitive for that and you will just get confused. Rather, try to understand WHY the MATHS says that it moves like it does. Then you can confirm that the maths agrees with reality.

Introduction to Gyroscopic Motion #1

This is a basic introduction to Gryoscopic Motion by looking at the motion of a top spinning with constant angular velocity, at an angle from horizontal.

Introduction to Gyroscopic Motion #2

A more in depth look at Gryoscopic motion. Euler’s equations for rotational motion, their derivation and simplifications that can be made; along with how they can be applied to the spinning top problem.

 

–Chris

[TUTORIAL] Interrupt Driven TWI Interface for AVR (Part 1: MT/MR)


Hello Everyone, I bring to you a tutorial on how the AVR TWI module operates. This is part 1 of the tutorial and deals with Master Transmitter and Master Receiver mode. Stay tuned for part 2 which will build on this to add Slave Receiver and Slave Transmitter functionality.

I2C (Inter Integrated Circuit) or TWI (Two Wire Interface) is a half duplex serial two wire interface for interconnecting low to medium speed peripherals. It uses two open drain signal lines, Serial Data (SDA) and Serial Clock (SCL). As these are open drain lines the device may sink however it cannot drive a line high. In order to allow for high signals the lines must be pulled high using a pull-up resistor. The bus drivers of all TWI compliant devices are open drain and this is essential to the operation of the interface.
TWI is a master/slave protocol. Multiple masters are allowed however only one device may be master at any one time.

The ATMEGA and ATTINY range of ATMEL MCU’s (along with the majority of other ATMEL MCU’s) have a dedicated TWI bus interface which takes care of START/STOP conditions, SCL clock, arbitration and address detection. They also have dedicated shift registers for sending and receiving data on the bus. The TWI pins also have slew rate limiting and a spike detection to remove spikes shorter than 50ns. The internal pull ups can be enabled by setting the PORT bits on the SDA and SCL pins to high.

I will first provide an overview of the TWI interface, followed by an overview of the AVR TWI hardware before I get into designing the interrupt driven TWI library.

Continue reading