woensdag 6 april 2011

No UART...

Unfortunally I noticed to late that the launchpad their msp430 devices have no hardware UART, so I had to look for a solution.
I decided to stay in the msp430 family and my eye felt on the MPS430F2132, it has the following benefits;
1x Hardware UART
1x Hardware I2C
2x timers (ideal to control my TEC's)
28 pins instead of 14 or 20
more flash

So, a tiny shield that can be mounted on the launchpad is under construction, and I hope it will be ready by friday :).
It is a shield because I want to be able to easily program and debug it, and since it has some more I/O's I added some features.
1x RGB led
1x usb-rs232 converter (these pins are on port 3)
1x buzzer
5x header for I2C

The sad thing is that I have to redesign my protoshield because the I2C pins no longer match...

donderdag 10 februari 2011

Mini-Tutorial 1; Blink-a-LED

Today I finally managed it to get my CCS version (code composer studio) working, it was stuck somewhere with the updating system, after reinstalling it, it finally worked =)

I haven’t done a lot, but I know how the basic works (at least I hope) and I fully commented the demo blink-a-led application so I know exactly what every instruction does.

The you can download the demo code from the site of TI (look for slac463a.zip) and the 'lab 1: Blink launchpad's leds' pdf written by Adrian Fernandez can be found here.

//******************************************************************************
// MSP430G2xx1 Demo - Software Toggle P1.0
//
// Description; Toggle P1.0 by xor'ing P1.0 inside of a software loop.
// ACLK = n/a, MCLK = SMCLK = default DCO
//
// ***code cut***
//
// D. Dang
// Texas Instruments, Inc
// October 2010
// Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
//
//Remade and comments added by watchout3
// mailto:
// watchout.3
// ***anti spam line*** tralalalaa
// @hot
// ***anti spam line*** badaboem
// mail.com
//
//******************************************************************************


#include <msp430g2231.h>

void main(void)
{

//****************************************************************
// PROGRAM INITIALISATION
//****************************************************************


WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
// See user manual (slau144f) p. 360


P1DIR |= 0x01; // Set P1.0 to output direction
P1DIR |= 0x40; // Set P1.4 to output direction

// If you wish to set a single bit to '0' without changing the state
// of the other bit-registers, you have to perform a "OR"-operation.
//
// You can do this on 2 ways, the short or the long one
//
// P1DIR |= 0x01; (short) (0x01 = bin "0000 0001")
// P1DIR = P1DIR | 0x01 (long )
//
// which results in xxxx xxx1 (where x means no state change)

// If you wish to reset a single bit to '1' without changing the state
// of the other bit-registers, you have to perform a "AND"-operation.
//
// P1DIR &= 0xFE (short) (0xFE = bin "1111 1110")
// P1DIR = P1DIR & 0xFE (long )
//
// which results in xxxx xxx0 (where 0 means no state change)



P1OUT = 0x40; // The two leds will toggle each on their turn
// ***Chose only one of both!!!***
//P1OUT = 0x00; // The two leds will toggle together

// You must preset the output registers.
// When you are debugging with your IDE open and don't repower the target aka
// launchpad (disconnect and reconnect it) the output registers won't be resetted.
//
// This will cause an unpredictable 'boot-up' state of the outputs (in my case they
// didn't toggled together)
//
// Probaly this comes beacause the ram is volatile memory witch only loses it's state
// when the power is shutted off (a reset didn't helped in my case)
//
// Also I noticed a sort of 'bug' when you go in debug mode and upload the code to your
// device, the reset ain't working until you remove the VCC jumper (once placed back
// the reset won't work anymore), remove the RST/TEST-jumpers or again, fully disconnect
// the device so the PC connection is interrupted
// Which method the correct one is, I don't know...

//****************************************************************
// MAIN PROGRAM
//****************************************************************


for (;;) // Start the infinitive loop
{
volatile unsigned int i;
// Reserving RAM memory

i = 50000; // Delay

// I suggest to initialise the memory as fast a s possible and not 'somewhere' in the code,
// because the possible errors like I mentioned above.


P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR (0x01 = bin 0000 0001)
P1OUT ^= 0x40; // Toggle P1.4 using exclusive-OR (0x40 = bin 0000 1000)

// Logic Table of an 'EXOR' function
//
// Input||Output
// A B || Q
//------||----
// 0 0 || 0
// 0 1 || 1
// 1 0 || 1
// 1 1 || 0


do (i--); // Delay function, increase 'i' aslong it is not differs from 0
while (i != 0); //
}
}

woensdag 2 februari 2011

launchpad DevBoard

During the weekend I made a small development/proto board.
It has the following features:
  • Small breadboard for quick and easy prototyping
  • 2 power sockets on each side (2x GND/side + 2x Vcc/side, each side is decoupled with a 100nF cap)
  • A I2C temperature sensor (TMP100), probally we will be using this type of sensor to measure the temperature of the peltier element.
  • Pull-Up resistors for a proper I2C communication. 

The sensor can be disconnected by 2 jumper pins, it is an SMD device, but if you wish you can also use a DIP version, Maxim-IC has some nice I2C temp sensors in DIP backage (we use this one because of the TI ADC ;) )
I also want to add a power LED (just because it looks cool) and mayby a RGB led to train my PWM skills and to show if the temperature is rising/falling.

dinsdag 25 januari 2011

It's alive!

Actually only the demo app that was preloaded in my launchpad is alive.
But it was a pain in the ass.

First I started with installing all the IDE's (there are 2 available), and then i wanted to check out the demo application.
But in my rush I forgot to instal the drivers for the launchpad... |:(

So if you are planning to use this make sure you do the next things:
1) Instal the IDE you want to use
2) Connect th launchpad to your PC
3) your PC will ask if he needs to search for drivers, make sure you can select were
4) Select "\ccsv4\emulation\drivers\msp430" (windows (even vista) will select the correct driver, so don't worry about that)
5) run the demo GUI you can find at he site of TI
6) That's it =).
This is how it looks :p

TI msp430 launchpad arrived! :)

I have some good news to anounce, today my order of TI's ADC arrived.

A first look tells me we have a potential winner were we can implement our PID controller in ;)

So the next few days I will do some 'experiments' with the launchpad to figure out how the IDE works and see what kind of stuff I can make with the launchpad.
Here is a picture of the launchpad:
To be continued... ;)

zondag 23 januari 2011

Peltiers revealed

In this post I will try to explain how Peltier elements work.
A Peltier element is a small device which basically transfers heat or cold from one side to other side.
In the industry they are widely used to cool laser modules because the wavelength depends of the temperature.
And since they are becoming cheaper and easier to get also computer enthusiasts are using them to cool their pc in the hope to get better performance.
How do they work?
A Peltier element, also called a thermoelectric module or cooler (TEC), is a semiconductor-based electronic component that functions as a small heat pump.
By applying a low voltage DC power source to a Peltier element, heat will be moved through the module from one side to the other.
One module face, therefore, will be cooled while the opposite face simultaneously is heated.
It is important to note that this phenomenon may be reversed whereby a change in the polarity (plus and minus) of the applied DC voltage will cause heat to be moved in the opposite direction. Consequently, a thermoelectric module may be used for both heating and cooling thereby making it highly suitable for precise temperature control applications.


























Controlling a Peltier element

Thermoelectric coolers are DC semiconductor devices. All their standard specifications (performanceparameters) are given by manufacturers for DC current and voltage.
In many applications customers prefer to use PWM control. It means simple electronics and simple logical control.
At high frequency PWM the averaged current delivered to controlled object is estimated as equivalent of DC current of the same value.
It is true for many applications, but is a great mistake in a case of TECs.
TEC controlled by PWM operates less effectively than at DC current.
The PWM control is always less effective than TEC operation at the same average DC current and power consumption.

Neither are relays suitable to control Peltiers, these will cause a reduction of the TEC’s life time and you can’t exactly control the temperature of them, it will fluctuate too much.

DC Closed loop control is the best solution for TEC operation. It provides most effective use of TECs.In practice two control methods are in use: “Proportional-Integral” (PI) Control and“Proportional-Integral-Derivative” (PID) ControlFor most applications PI Control is enough.These PI(D) controllers can be implemented in software or done by discrete components (see my previous post)

Another important design note is that Peltier elements must always be cooled on their “hot”-side.
Otherwise you run the risk that you damage the Peltier by melting the internal solder.


Sources:
http://www.tec-microsystems.com/EN/Intro_Thermoelectric_Coolers.html
http://www.memmert.com/tekhnologii/koncepcija-temperaturnogo-kontrolja/sistema-nagrevaokhlazhdenija/
http://www.rmtltd.ru/tec_app_tips.htm
http://www.silram-cor.co.il/gp.asp?gpid=56

zaterdag 22 januari 2011

TI’s ADC part II + sample requests

The past few days I have been pretty busy.
First of all, we are allowed to participate to TI’s “Analog Design Contest” AND the Evaluation Modules (2x MSP430 + some other stuff) I requested will be delivered soon =).

While I was searching on Google for some information about Peltiers I suddenly came up to an application note of MAXIM-IC.
And their I discovered that they have made some IC’s especially for controlling Peltiers, in the app note was also a PID regulation drawn and explained.
So I sent some sample requests to rebuild the PID controller of the app-note:
·       MAX4475ASA                        OpAmp, Low-Noise, Low-Distortion
·       MAX4477ASA                        OpAmp, Low-Noise, Low-Distortion
·       MAX1968EUI             Power Drivers for Peltier TEC Module up to 3A
·       MAX1969EU               Power Drivers for Peltier TEC Module up to 6A
Once I sent the sample requests I noticed that they also made Evaluation Modules exactly like in the app-note, but I wasn’t able to find the pricing/dealers.
SO I send a mail to MAXIM-IC for some more information about their Peltier-EVM’s
More info (except pricing…) can be found here:
http://www.maxim-ic.com/datasheet/index.mvp/id/3559
If we can use this, we basically only need to make a descent mechanically construction and find a good DAC, but we only need to concern ourselves about the first because at school they have a DAC of NI that can be used together with labview.

Afterwards I discovered that TI also made some IC’s for driving Peltiers. So I began to search a little more on their site and this is what I sampled at TI:
·       TMP100 - Digital Temperature Sensor with I2C Serial Interface
·       DRV592 - High-Efficiency H-Bridge (Requires External PWM)
·       TLC59108 - 8-Bit Fast Mode Plus (FM+) I2C Bus Constant-Current LED Sink Driver
·       MSP430G2231 - MSP430G2x21, MSP430G2x31 Mixed Signal Microcontroller
·       MSP430G2211 - MSP430G2x01, MSP430G2x11 Mixed Signal Microcontroller