CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LED driver(mm5450YN)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Sparta



Joined: 22 Oct 2009
Posts: 6

View user's profile Send private message

LED driver(mm5450YN)
PostPosted: Thu Oct 22, 2009 5:34 am     Reply with quote

hi, anyone know how to write the program to control the led driver (mm5450YN)? really need the help for eugent. thanks...
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Oct 22, 2009 6:56 am     Reply with quote

Why don't you try it yourself?

Looking at the datasheet, controlling the chip is pretty straightforward. It requires three pins, CLOCK DATA and ENABLE.

Set CLOCK and DATA low, then set ENABLE low. Set DATA high, delay 500ns (300ns min) then take the CLOCK high and back low. Leave ENABLE low from this point on. This is the START bit.

For the second CLOCK (first DATA bit) set the DATA line high or low depending on what you want to appear on Pin 18, delay 500ns then take the CLOCK high and back low.

For the third CLOCK (second DATA bit) set the DATA line high or low depending on what you want to appear on Pin 17, delay 500ns then take the clock high and back low.

The fourth DATA bit will appear on pin 16.
The fifth DATA bit will appear on pin 15 etc.

Generate 30 more CLOCKs with DATA bits for a total of 35.

When you clock the 35th DATA bit into the chip it will automatically perform a LOAD to transfer the bits to the outputs. Set ENABLE back high after completing the 35th bit transfer.

That's it! The biggest part will be keeping track of the bits
_________________
Google and Forum Search are some of your best tools!!!!
Sparta



Joined: 22 Oct 2009
Posts: 6

View user's profile Send private message

LED driver(mm5450YN)
PostPosted: Sun Oct 25, 2009 4:38 am     Reply with quote

Is that correct program to control the LED driver? Anyone can help me?
Code:

#include<pic.h>
__CONFIG(0x3f3a); 

void delay();
void init();
void led();

void main()

{
 init();
 led();
}

//..........................
//delay function
void delay()
{
 int i;
 for(i=5000;i>0;i--)
 {
  NOP();
  NOP();
 }
}

//..........................
//initialize function
void init()
{
 TRISB=0x00;
 PORTB=0x00;
}

//..........................
//light lamp function
void led()
{
char index,index2;
while(1)
 {
   RB0=0;
   delay();
   RB1=1,RB1=0;
   delay();

   RB0=1;
   delay();
   RB1=1,RB1=0;
   delay();

   for(index=0;index<34;index++)
   {
      RB0=1;
      delay();
      RB1=1,RB1=0;
      delay(); 
   }
 }
}
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Sun Oct 25, 2009 5:45 am     Reply with quote

Sparta, you're not using CCS...
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Oct 25, 2009 1:00 pm     Reply with quote

Sparta,
It appears you are using Hi-Tech C and you need to go to the Hi-Tech forum for help.

http://forum.htsoft.com/all/categories.php

CCS and Hi-Tech code are not compatible. Hi-Tech code will not compile in CCS.
_________________
Google and Forum Search are some of your best tools!!!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group