İyi günler arkadaşlar, bu blog ile ilk tanışma projem olduğu için yanlışlarım eksiklerim olabilir bu konuda sizden özür dileyerek başlamak istiyorum.

Bu projemde 1 tane 74HC4017 (CD4017 de kullanabilirsiniz) entegresi bir adet 5×7 Dot Matrix display (ortak katot) ve MSP430 kullandım.  Direnç kullanmadım çünkü direnç hem displayin parlaklığını azaltacak hem de devre üzerinde gerksiz elemana sebep olacaktır. Ledler sürekli yakıp söndürülerek gerekli olan tasarruf sağlanabilir ve ledlerin patlaması ortadan kaldırılabilir. 5×7 matrix display sürerken işlemi aşağıdan yukarıya taramalı yaptığım için (yönünü siz ayarlayabilirsiniz) dirence ihtiyaç duymadım. MSP430 un çıkış gücü yeterli olduğundan ledleri yakarken transistörle kuvvetlendirmeye de ihtiyaç duyulmamıştır.

 

Program arasında sürekli bekleme cycle’ı kullanmamın nedeni ise bekleme eklenmediğinde bazı ledlerin yanmaması.  Çünkü port çıkışı lojik 1 olamadan 0 olma şartı geldiğinde port lojik 1

üretememektedir.

Her harf oluştuğunda 4017 nin reset ucu aktif edilmelidir.

harflerin geçiş süresi for döngüsünden ayarlanabilir.

Harf Oluşturma:

Oluşturulan harf alttan başlanarak oluşturulmalıdır. Bu sadece benim oluşturduğumda geçerli üstten alta tarama yaptırırsanız aynı sırada hex kodlarını girmelisiniz.

E Harfi

0000001
0111101
0111101
0000101
0111101
0111101
0000001


E harfi   
for(i=0; i<110 ;i++)
 {
 P1OUT = 0x01;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x3D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x3D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x05;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x3D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x3D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x01;
 _delay_cycles(100);
 P1OUT = 0xFF;
 _delay_cycles(550);
 }

D Harfi

0000101
0111001
0111001
0111001
0111001
0111001
0000101

D harfi   
for(i=0; i<110; i++)
 {
 P1OUT = 0x05;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x05;
 _delay_cycles(100);
 P1OUT = 0xFF;
 _delay_cycles(550);
 }

K Harfi

0111001
0110101
0101101
0011101
0101101
0110001
0111001

K harfi   
for(i=0; i<110; i++)
 {
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x35;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x2D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x1D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x2D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x35;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0xFF;
 _delay_cycles(550);
 }

R Harfi
0000101
0111001
0111001
0000101
0101101
0110101
0111001

R harfi   
for(i=0; i<110; i++)
 {
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x35;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x2D;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x05;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x39;
 _delay_cycles(100);
 P1OUT = 0x7c;
 _delay_cycles(550);
 P1OUT = 0x05;
 _delay_cycles(100);
 P1OUT = 0xFF;
 _delay_cycles(550);
 }

Resim:

Video:

Şema:

Kaynak kodu:

//***********************************************************
//	Ekrem Kursad DAL
// 	5x7 Dot matrix degisen harfle yazi yazma
//
//***********************************************************
 
#include <msp430g2231.h>
int i;
 
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR = 0xFF;
 
ab: 
 
//1=clk 2=reset
//E harfi
	for(i=0; i<150 ;i++)
	{
		P1OUT = 0x01;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x05;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x01;
		_delay_cycles(100);
		P1OUT = 0xFF;
		_delay_cycles(550);
	}
 
//K harfi
	for(i=0; i<150; i++)
	{
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x35;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x2D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x1D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x2D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x35;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0xFF;
		_delay_cycles(550);
	}
 
//R harfi
	for(i=0; i<150; i++)
	{
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x35;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x2D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x05;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x05;
		_delay_cycles(100);
		P1OUT = 0xFF;
		_delay_cycles(550);
	}
 
//E harfi
	for(i=0; i<150 ;i++)
	{
		P1OUT = 0x01;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x05;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x3D;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x01;
		_delay_cycles(100);
		P1OUT = 0xFF;
		_delay_cycles(550);
	}
 
//M harfi
	for(i=0; i<150 ;i++)
	{
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x29;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x11;
		_delay_cycles(100);
		P1OUT = 0x7c;
		_delay_cycles(550);
		P1OUT = 0x39;
		_delay_cycles(100);
		P1OUT = 0xFF;
		_delay_cycles(550);
	}
 
_delay_cycles(2000000);
 
goto ab;
 
}