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

MAX7219 LED Driver Help needed...
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 01, 2005 8:22 am     Reply with quote

Well if you register, then you can delete or at least edit them. Almost always when posting a large amount of code you will get an error like that. I always copy the text before I submit. If I get an error then I check the post to see if it was posted. Sometimes it might take a minute. If it doesn't get posted, then I might try posting again but I don't recall having to do this ever.

As for your problem, it has already been answered! Say your minutes = 45. If you take the modulus 10 of the number you will get 5. What does that mean, the remainder. If you divide the integer by an integer of 10 you will get 4. Those are your two values.

Code:

ones = mins % 10;
tens = mins/10;

or
Code:
tens = mins/10;
ones = mins - tens*10;
Guest








PostPosted: Thu Sep 01, 2005 8:51 am     Reply with quote

How about the initialization problem?

1. I can not initialize both of the ds1307 and max7219, they are
conflict when I run the init_7219(); and the init_ds1307();
function because both use the RC3, RC4 pins.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 01, 2005 8:55 am     Reply with quote

Well I don't have a schematic and haven't looked at the Max7219's datasheet so the easiest answer would be to move the DS1307 to 2 other pins and use software I2C routines
Guest








PostPosted: Thu Sep 01, 2005 9:03 am     Reply with quote

Thank very much..

I will try..
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Sat Sep 03, 2005 4:47 am     Reply with quote

Hi,

Here is my code for MAX 7219 driver IC, it doesn't use the standard SPI routines

Code:

void write_MAX7219_byte(int reg,int data)
{
      BYTE i;

      output_low(MAX7219_CS);

    for (i=0;i<4;i++)                     //DONT CARE BITS
    {
      output_low(MAX7219_DIN);

      output_high(MAX7219_CLK);
      delay_us(700);
      output_low(MAX7219_CLK);
      delay_us(700);

       
    }

   for(i=4; i>0; i--)                      //ADDRESS REGISTERS
   {
         output_low(MAX7219_CLK);
    
       if(bit_test(reg,i-1)==0)
         output_low(MAX7219_DIN);
         else
         output_high(MAX7219_DIN);
   
   
        delay_us(700);
        output_high(MAX7219_CLK);
       delay_us(700);
   }

   for(i=8; i>0; i--)                      //DATA BITS ARE LOADED HERE
   {
         output_low(MAX7219_CLK);
    
       if(bit_test(data,i-1)==0)
         output_low(MAX7219_DIN);
         else
         output_high(MAX7219_DIN);
   
   
        delay_us(700);
        output_high(MAX7219_CLK);
       delay_us(700);
   }

   output_high(MAX7219_CS);

}


To initialise use this..

Code:

void initialise_MAX7219()
{

   write_MAX7219_byte(0x0B,7);      //Scan limit set to 5 digits
   write_MAX7219_byte(0x0C,1);      //Normal operation
   write_MAX7219_byte(0x09,0xFF);   // Decode mode on all digits
   write_MAX7219_byte(0x0A,0x02);      // Set Intensity level

}


Thanks
arunb
Guest








add decimal point to any digit ?
PostPosted: Sat Jan 26, 2008 12:37 pm     Reply with quote

How can we add decimal point to any digit ?

as shown on datasheet of MAX7219 , if add 32 to output value it should light up decimal point , but no success..

while(1){
for(i=1;i<=8;i++){
for(j=0;j<=9;j++){
send_16bit(i,j+32); // DIGITO , VALOR+32
delay_ms(200);
}
}
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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