Check out the new projects site for A-i-S

Sunday, July 26, 2009


"Every government interference in the economy consists of giving an unearned benefit, extorted by force, to some men at the expense of others."

Ayn Rand

"There is a similar effect when personal incomes are taxed 50, 60 or 70 percent. People begin to ask themselves why they should work six, eight or nine months of the entire year for the government, and only six, four or three months for themselves and their families. If they lose the whole dollar when they lose, but can keep only a fraction of it when they win, they decide that it is foolish to take risks with their capital. In addition, the capital available for risk-taking itself shrinks enormously. It is being taxed away before it can be accumulated. In brief, capital to provide new private jobs is first prevented from coming into existence, and the part that does come into existence is then discouraged from starting new enterprises. The government spenders create the very problem of unemployment that they profess to solve." - Hazlitt

"Just as man can't exist without his body, so no rights can exist without the right to translate one's rights into reality, to think, to work and keep the results, which means: the right of property."
Ayn Rand

"The smallest minority on earth is the individual. Those who deny individual rights cannot claim to be defenders of minorities."
Ayn Rand

"My politics are based...on things I and millions like me were brought up with. An honest day's work for an honest day's pay; live within your means; put by a nest egg for a rainy day; pay your bills on time; support the police."
Margaret Thatcher (1981)

"There can be no liberty unless there is economic liberty."
Margaret Thatcher

"To wear your heart on your sleeve isn't a very good plan; you should wear it inside, where it functions best."
Margaret Thatcher

Freedom is never more than one generation away from extinction. We didn’t pass it on to our children in the bloodstream. It must be fought for, protected, and handed on for them to do the same, or one day we will spend our sunset years telling our children what it was once like in the United States when men were free.
R. Regan

"Throughout the centuries there were men who took first steps down new roads armed with nothing but their own vision."
Ayn Rand, from "The Foutainhead"

Saturday, July 25, 2009

Great quote

"Every government interference in the economy consists of giving an unearned benefit, extorted by force, to some men at the expense of others."

Ayn Rand

Thursday, July 23, 2009

Motors are never linear

With PWM, the output is never linear to the input.

You usually get the motors kicking in at around 60%

Saturday, July 18, 2009

ERE Board ports and my L293D board

This is a note about the wiring on the Tank Bot.

The ERE Board ports have Vcc above the number 7 pin (last pin). Due to the fact I was replicating the ERE Board ports on my L293D driver board, a two wire connector (the home made blue and yellow ones) can be connected directly as it will feed the Vcc on the L293D board.

Just be aware the in this case a light blue wire is carrying Vcc not Gnd like all the others,

Wednesday, July 15, 2009

Timer problem, timer solution

With an AVR Mega32, when using a timer such as Timer2 (8-bit), you do not want to toggle the output pin as this will only give you a 50% duty cycle and you will only be able to control the frequency of that 50% cycle.

This is because the pin is cleared on reaching TOP. So you want to set the pin on match and let it automatically clear on top.

So for Timer2 on the Mega 32 you want to set the TCCR2 register to something like this

TCCR2 = 0b01111011; //0x7B

Magic code

Give your fingers a break and let the web do the typing.

The following website will generate code for an AVR Mega32. It will setup all three timers, the UART and TWI peripherals and ADCs

A timer for all occasions

Ok, FreeRTOS is great but not so great if you need to use timers on an AVR to control PWM for motors.

- The Goal -
Run FreeRTOS on a Mega32 and also control DC motors via a L293D using PWM

- The Challenges -
FreeRTOS uses Timer1 to control the FreeRTOS kernel. This leaves Timer0 and Timer2 (both 8 bit) for PWM. Timer0 and Timer1 share a common pre-scaler.

Note that FreeRTOS set the Timer1 pre-scaler in the port.c file via the portCLOCK_PRESCALER and other defines.

Apart from this Timer0 and Timer2 appear to by unmolested by FreeRTOS.