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 support@ccsinfo.com

74HC595!!!!!!!PROGRAM

 
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

74HC595!!!!!!!PROGRAM
PostPosted: Fri Nov 06, 2009 12:46 pm     Reply with quote

hi...In my project, I am using the pic to control my 22 x 12 RGB led board to display the words and some animation.

I have totally no idea how to control the 74HC595. And I also don't no how to use 1 bit to control 8 bits output...Hope any know the idea or EXAMPLE of simple program can show.

Beside that, I am not sure how to transfer the serial input of first 595 to the second 595. Hope anyone know it, can share the idea with me. THANKS
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 06, 2009 1:08 pm     Reply with quote

Look at these CCS example and driver files for the 74595.
Quote:

c:\program files\picc\examples\ex_expio.c
c:\program files\picc\drivers\74595.c

Use the forum's search page to search for 74595 and also for 74HC595.
There are many posts on this topic. Examples:
http://www.ccsinfo.com/forum/viewtopic.php?t=34740
http://www.ccsinfo.com/forum/viewtopic.php?t=17368
Guest








PostPosted: Sat Nov 07, 2009 12:11 pm     Reply with quote

Code:

//------ Do 74HC595 serial chip --------------
//MSB > xxxx xxxx     xxxx xxxx < LSB
void Do_Serial_Chip(int8 Fuera1,int8 Fuera2)
   {
   int8 i;
   int16 ajuera;
   
   ajuera = Fuera1;
   ajuera = ajuera<<8;
   ajuera = ajuera | Fuera2;
   
   // Output to serial line
   for(i=0; i<16; i++)
      {
      if(ajuera & 0x8000)
         {Serial = 1;}
      else
         {Serial = 0;}
         
      ajuera = ajuera<<1;
      
      SLOK = 0;     //Shift data
      SLOK = 1;
      }

   RCK = 0;         //Output on pins
   RCK = 1;
   }
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