Now has come the time to wrap up our little timer exercise.
What we still have to do:
Figure out a way to select different timer delays.
Find a way to reset the timer.
The second problem should be easy enough. In fact, if we do this right we will not need a RESET button.
RESET
Pin-16 of...
In the previous post the program is set to flash for 10ms every 1 sec. I did this in order to determine the minimum flash duration that would still be very visible.
A pulse width of 10ms and a repetition delay of 1 second is highly visible. This gives a duty cycle of 1:100. If you wish, a...
We are getting close to the end of this little exercise, that is, building a simple low power timer.
Now we come to the MSP430 low power modes.
The current consumption of a microcontroller is directly related to its operating clock frequency. Stopping the CPU clock gives the lowest power mode...
Okay, get out the soldering iron and solder the 32768Hz crystal to the SMD pads provided at pins 18 and 19 of the MSP430G2553 chip.
Our goal is to run with the lowest current drain and still keep accurate time.
Here is our program modified to use the crystal oscillator.
// Timer...
Interrupts can be tricky to program and they function somewhat magically.
However, it is a very important feature of embedded microcontroller systems and should be used to its full advantage.
Here is a simple example of the interrupt mechanism followed by some explanations.
// Timer example...
The MSP430G2553 has everything we need, including an internal clock, in order to make a decent timer. This is the first of two solutions I will present.
This chip also has a low frequency, low power crystal oscillator circuit. So if we really want to do this properly we might as well go all...
Let us review the LED flash program with a twist.
// Patrol Cruiser Flashing LEDs Example
// 2013.04.25 - MrChips
#include "io430.h"
#define ON 1
#define OFF 0
#define LED1 P1OUT_bit.P0
#define LED2 P1OUT_bit.P6
#define DELAY 10000
void init(void)
{
// Stop watchdog timer to prevent time...
I had never intended for this to be a tutorial on programming in the C language. There are many excellent tutorials available online. I cannot endorse any particular site but will only provide an example:
http://www.cprogramming.com/tutorial/c/lesson1.html
However, I will make a few comments...
At this point you should have the IAR EW integrated development environment (IDE) up and running. You are now able to setup, edit, download and verify a program written in C running on the target MSP430 chip.
Let us take a break from the coding and look at some of the program elements.
P1OUT...
The next step is to insert two delays in order to slow down the LED flash rate.
A 16-bit unsigned integer can represent a value from 0 to 65535.
While this is sufficient for our simple delay, we will use a 32-bit unsigned integer in case we need a longer delay at some point in the future...
This series of tutorials is in response to a request for a very low power timer with selectable time delays from 1 hour to 24 hours.
These tutorials are based on the Texas Instruments MSP430 LaunchPad.
Some useful links
Texas Instruments product page:
http://www.ti.com/product/msp430g2553...
Question: How the heck does a solar array work?
Scope: I will explain how a solar array works so that you can decide how to use your array in your application. I will explain Solar Array...
Its funny to think that when I started this little PCB gig I thought that I would continue to produce simple boards. Well after a year it looks like the only thing Im missing now is through hole plating.
The solder mask experiment was a complete success and when I attempted to solder away the...
Its been a long time since I started testing. At least 6 months. The darn ink never worked :(
I used the tube solder mask repair stuff with the very poor instructions and I was NOT getting anywhere. No matter what I tried, nothing.
Until.....I saw a tub. A small black tub with strange looking...
This thermostat has been in service since January 14, 1980 and has never needed a repair. Even the aluminum electrolytic (capacitor) on the power supply has not failed!
The "real" one drives a triac for the output (short sighted of me to do that.) If you set the hysteresis with any...
It stopped spinning some weeks ago.
The PSU turned very hot.
A lot of dust had accumulated!
But the fan did not spin anymore at all.
I had an idea!
Maybe dust would have made it's way between the magnet and the coils.
I tried to pour some white spirit into the fan, and soon, the fan again...
Rated current
The level of continuous DC current that can be passed through the inductor, this DC current level is based on a maximum temperature rise of the inductor at the maximum rated ambient temperature, the rated current is related to the inductor's ability to minimize the power losses in...
DCR(DC resistance)
The resistance of the inductor winding measured with no alternating current, the DCR is most often minimized in the design of an inductor, the unit of measure is ohms, and it is usually apecified as a maximum rating.
OHM
The unit of measurement for resistance and impedance...
Q value
The Q value of an inductor is a measure of the relative losses in an inductor, the Q is also knows as the "quality factor" and is technically defined as the ratio of inductive reactance to effective resistance and is represented by Q=XL/R=2pifL/R
Since XL and R are functions of...
Number turns
The series impedance of a high frequency ferrite device can be increased by running two or more turns of the treated conductor through the ferrites core, magnetic theory predicts that the impedance of the device will increase with the square of the number of turns, however, due to...