Blinking lights MSP430 FG461x

Photo of two experimenter boards for the MSP43...

Image via Wikipedia

I have been working on MSP430 for sometime now. It is an TI (Texas Instruments ) chip. Very fun to play with. We are using a MSP430FG461x series experimental board. This little experimental board has all the bells and whistles one may need to create any application from a home automation controller to a simple step-motor driver. TI provides very good documentation for this grown up toy.

Our first lab homework for this baby was :

By using the MSP430 FG4618 Microcontroller, write a program that controls the LED #1, #2,#4.When we perpetually push the two buttons at the right bottom corner of the board, all ofthe LEDs turn on.When we push perpetually one of the buttons, only the LED #4 blinks, the others turn off.When we push no buttons, the LED #1 and #2 blinks complementarily and the LED#4 turnsoff.

My biggest problem with this exercise was to find what led was connected to what port. However in the end I figured it all out.

Below you will find the program :

 

 

#include <msp430xG46x.h>

void initPortPins(void);

void main(void)
{
	 WDTCTL=WDTPW + WDTHOLD;
	 initPortPins();
	 while(1) {
	 	if (P1IN == (0x00))
	 	{
			P2OUT |= 0x06;
			P5OUT |= 0x02;
		}
		else if (P1IN == 0x03)
		{
			P2OUT &= 0x00;
			P5OUT &= 0x00;
			P2OUT |= 0x02;
			__delay_cycles (40000);
			P2OUT &= 0x00;
			P2OUT |= 0x04;
			__delay_cycles (40000);
		}
		else
		{
			P2OUT &= 0x00;
			P5OUT &= 0x00;
			__delay_cycles (40000);
			P5OUT |= 0x02;
			__delay_cycles (40000);
		}
	 }
};

void initPortPins(void)
{
  P1DIR = 0x00;	// Set P2.2,1 as outputs
  P5DIR = 0x02; // Set P5.1 as output
  P2DIR = 0x06; // Set P2.1 to 1
};
Fork me on GitHub

From the beginning please

Hi there. Summer over and so is my work with the company RENKO ITH.  IHR. LTD. STI.. Worked for peanuts doing lots. Proud of it. Paid my school tuition with the peanuts. I think this makes my school a three ring circus :D .

Work was good and honest in RENKO. I wore three hats at all times ;

Continue reading

A pretty picture

Hi. Got to take a photo that I actually am proud of. I hope you like it.

IMG_0257.JPG

IMG_0257.JPGIf you are viewing this in a link in a other than my own site you may not able to see the bigger picture. Please view this in my own site. (http://johnroach.info/2010/05/a-pretty-picture/)

Blogger Is Closing Down FTP service… So what… I’ve got WP

A Brief Timeline of Blogging Engines
Image by whiteafrican via Flickr

It seems blogger.com is closing down it’s FTP service. Good thing I already transferred my site to WordPress before hand.

My blogging life has been quite the roamer. It seems I like my individuality. My road started with LiveJournal.com. One day I opened my LiveJournal account to find it blocked by the firewall of our school. Some people used to put their nude pictures on their LiveJournal so it was banned.  I got angry at this. Thus I transferred everything to Blogger.com. But guess what! Turkey blocked Blogger for about four to five months this got me mad. So what I did was make Blogger.com send the info to my FTP host. I even bought a domain for this host. A little coding and voila! My was site was back up and running. However this got me thinking. What if Blogger was totally banned? What would I do than? Hence I started looking for blogging scripts and that is how I met WordPress. I must say I’m very happy with it. I even integrated Zemanta with my browser to bring in even better content. In fact the picture here was found thanks to Zemanta. Anyhow…

So Blogger is closing down it’s FTP service. So what. It seems Blogger is thinking the same way. The mail they sent me states :

FTP remains a significant drain on our ability to improve Blogger: only .5% of active blogs are published via FTP — yet the percentage of our engineering resources devoted to supporting FTP vastly exceeds that.

It seems Blogger started cutting out the rotting flesh. The hoards of zombies that try to live on old tech. And this also shows Google‘s business management. If it doesn’t work, cut it out. Which I believe is one of the best ways to do management. Look at HP Labs present condition. Actually look at any big corporation. The only way you can go big is use this kind of thinking. I know… I know… It probably meant that the current FTP “engineering resources” our out of a job. But still… The show must go on.

Oh and for the people asking, the snow effect will still be here for a while. It is still snowing in Ankara, Turkey.

Setting up a CVS server for the BlackBox project

Following the previous posts in this category you will notice that I was using Sourceforge.net as the code hosting. We had to change that because we really didn’t want to share every bit of code. ( A big sorry to open source developers. I am truly a sell out. ) So had to set up CVS server. Never done that before. Should probably add it to my CV. Anyways to business.

How to set up a CVS server using SSH :

Continue reading