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

MAX6955 LED Driver Functions

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
UFAnders



Joined: 13 Apr 2005
Posts: 36
Location: Michigan

View user's profile Send private message Send e-mail Visit poster's website AIM Address

MAX6955 LED Driver Functions
PostPosted: Sat Jun 25, 2005 9:59 am     Reply with quote

Maxim's MAX6955 LED Driver can drive up to 128 discrete LEDs with each group of 8 having 4-bit intensity control. It's really slick, and here is a header file to get it up and running ASAP. Very Happy

Code:
#define MAX6955BaseAddress 0b11000000

#define reg_noOp 0x00
#define reg_decodeMode 0x01
#define reg_globalIntensity 0x02
#define reg_scanLimit 0x03
#define reg_configuration 0x04
#define reg_displayTest 0x07
#define reg_digitType 0x0C

#define reg_intensity10 0x10
#define reg_intensity32 0x11
#define reg_intensity54 0x12
#define reg_intensity76 0x13
#define reg_intensity10a 0x14
#define reg_intensity32a 0x15
#define reg_intensity54a 0x16
#define reg_intensity76a 0x17

#define USE_GLOBAL 0x00
#define USE_DISCRETE 0x40
#define RUN 0x01
#define SHUTDOWN 0x00

#define reg_digit0 0x60
#define reg_digit1 0x61
#define reg_digit2 0x62
#define reg_digit3 0x63
#define reg_digit4 0x64
#define reg_digit5 0x65
#define reg_digit6 0x66
#define reg_digit7 0x67
#define reg_digit0a 0x68
#define reg_digit1a 0x69
#define reg_digit2a 0x6A
#define reg_digit3a 0x6B
#define reg_digit4a 0x6C
#define reg_digit5a 0x6D
#define reg_digit6a 0x6E
#define reg_digit7a 0x6F

void writeMAX6955(unsigned char, unsigned char, unsigned char);
void initMAX6955(unsigned char);

void writeMAX6955(unsigned char driver, unsigned char command, unsigned char data)
{
   i2c_start();
   i2c_write(MAX6955BaseAddress + (driver<<1));
   i2c_write(command);
   i2c_write(data);
   i2c_stop();
}

void initMAX6955(unsigned char driver)
{
   writeMAX6955(driver, reg_decodeMode, 0x00);
   writeMAX6955(driver, reg_scanLimit, 0x07);
   writeMAX6955(driver, reg_configuration, (RUN|USE_DISCRETE));
   writeMAX6955(driver, reg_globalIntensity, 0x0F);
   writeMAX6955(driver, reg_digitType, 0x00);
   writeMAX6955(driver, reg_displayTest, 0x01);
   delay_ms(1000);
   writeMAX6955(driver, reg_displayTest, 0x00);
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library 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