TI MSP430 Dice( and other experiments)

7 Segmented Displays are pretty low tech and have been around for quite a while.They have a lot of wiring clutter with them..But still they are by far the most easiest(and cheapest) way to give out a (alpha)numerical output..I had interfaced 7segs with MSP430 a while back directly but owing to the low current capabilities of MSP430 the display wasn`t very good and clear . We were recently ‘taught’ about the BCD-7 segmented display in our semester..So i thought about interfacing the 7 segmented with the CD4511..This will save some precious pins and plus drive the 7 seg directly. The CD4511 IC can run from 3V Supply..So no power supply issues and the logic high(input) is about 2V which is also apt as on MSP430 we have this about 3.3V.

The datasheet is available  here

The only thing that was bad was the wiring clutter  has increased and there were (as always) a few loose connections.After a few minutes,I was up and running with the display.

The Fritzing Schematic is given below:

cd4511

Do everything according to the picture above for the code to run. If the Schematic is not clear..then refer to datasheet linked above.Everything has been done according to it..The LT(bar) and BI(bar) have been connected to +VCC and LE to ground.The display is powered from the ‘board’.

The connections (from the MSP430 end to CD4511) are:

P1.4 -D

P1.5-C

P1.6-B

P1.7-A

#define D BIT4
#define S BIT5
#define B BIT6
#define A BIT7

The code to drive the CD4511 “According” to the above config is:

void CD4511(int numb)
{
switch(numb){
				case 0:P1OUT&=~(B+A+S+D);
				break;
				case 1:P1OUT|=(A);
				       P1OUT&=~(B+S+D);
                break;
				case 2:P1OUT|=(B);
				       P1OUT&=~(A+S+D);
                break;
				case 3:P1OUT|=(A+B);
				       P1OUT&=~(S+D);
                break;
				case 4:P1OUT|=(S);
				       P1OUT&=~(A+D+B);
                break;
				case 5:P1OUT|=(A+S);
				       P1OUT&=~(B+D);
                break;
				case 6:P1OUT|=(S+B);
				       P1OUT&=~(A+D);
                break;
				case 7:P1OUT|=(S+B+A);
				       P1OUT&=~(D);
                break;
				case 8:P1OUT|=(D);
				       P1OUT&=~(B+S+A);
                break;
				case 9:P1OUT|=(A+D);
				       P1OUT&=~(B+S);
                break;
				default:P1OUT&=~(B+A+S+D);
				break;
}
}

Just to clarify :The code uses ‘S’ instead of ‘C’ because C was being used as an internal macro in the header file!

The video is down here..It first shows the simple counter..then the push to change count and then the Dice.
To get the complete source code..you can comment below..The comments are moderated so you email will not be leaked.
Thanks for passing by!
🙂
#Sorry for the bad cam! 😛

Advertisements

Trying some paint(ing)

I was free the whole day..so i decided to try some scribbling..but unfortunately all the old crayons i had..were no longer with me.My younger bro uses them..and because of an on-going duel..he never gave them to me..So i tried something with paint..ya.MS Paint.

 

Trying Some Graphic Etching

Copper PCBs amazing..Toner Transfer Etching Great! Graphic Etching Superb!

This weekend i had to print(rather etch) a few circuits..i have been making for the past few weeks..When i was cutting the PCB(Bare Copper PCB)..I got an idea Of making cool key-chains with this technique.I printed my details on a tiny little piece of copper PCB and Etched it,Drilled a hole and attached a small ring and chain from a broken Key-Chain.It turned out to be great! Although,we can improve the design..This is still my first..I also printed a Bag-Tag ..with a Hack-a-day logo ( their Fb cover page pic) as a tribute to this great site

(PS:The logo is the property of Hack-a-day..I don`t possess any Rights!)

If anybody in India,Wants a key-chain like this,can mail me at : rohit7gupta[at]gmail[dot]com