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 Code Help

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



Joined: 26 Mar 2013
Posts: 8
Location: Russia

View user's profile Send private message

MAX6955 Code Help
PostPosted: Fri May 17, 2013 3:37 am     Reply with quote

I saw the below code in Code Library. I hope it is a working code. In this function what should be the value of driver?

Code:

initMAX6955(unsigned char driver)


and in this function what are the values of driver, command, and data?

Code:

writeMAX6955(unsigned char driver, unsigned char command, unsigned char data)


Should I create an array containing display data for values 0...9, A...Z, and a...z?

Can somebody show me how to display HELLO using the below code?

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);
}

_________________
Regards
Branko
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Fri May 17, 2013 4:34 am     Reply with quote

Depends how you have your chip wired....

If you look at the data sheet, the chip supports 16 different driver addresses. This value selects which one to use. So '0' drives a chip connected with AD0 and AD1 both held low, then '1' drives one with AD0 pulled high etc..

Then read the data sheet.
The commands are the commands supported by the chip. Same for the data. If you look at the init code, it shows zero being sent to the decode mode register, then 7 to the scan limit register etc.. The latter implies it is setting up for 8 digits.
You need to sit down with the data sheet, and work out how you want to program the chip for your needs, and then send these values. There is no universal solution for a chip like this, since the values will depend on how many digits you are using etc..
The driver does the 'donkey work' of interfacing to the chip(s).

Best Wishes
branko



Joined: 26 Mar 2013
Posts: 8
Location: Russia

View user's profile Send private message

PostPosted: Fri May 17, 2013 6:05 am     Reply with quote

Thank you Ttelmah. I have connected A0 and A1 to ground. I need to display HI on 16 segment(s).

Quote:
The latter implies it is setting up for 8 digits.


I didn't get this.

I am using 8 X 16-Segments. I want to display something like "230.23456 V"

I need to display the above string. So, I will be using alphanumeric thing.
_________________
Regards
Branko
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