This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F5529: MAX6952

Part Number: MSP430F5529


Tool/software: Code Composer Studio

I have a project that needs to display a predefined message on a 5x7 LED matrix using the msp430f5529. I am also using a driver called the MAX6952 to drive the matrix. I have some coded written up, but sadly the LED matrix is not responding to what I have coded. I was wondering if someone could help me out to see where I went wrong. 

Thank you for your time for looking at this and helping out. 

// Ali Louangrath
// Main Project - LED Display
// Version 1.1
//
//
//
// MSP430F552x
// -----------------
// /|\| |
// | | |
// --|RST |
// | |
// | P3.3|-> Data Out (UCA0SIMO)
// | |
// | P3.4|<- Data In (UCA0SOMI)
// | |
// Slave reset <-|P1.1 P2.7|-> Serial Clock Out (UCA0CLK)
//
// ACLK = ~32.768kHz, MCLK = SMCLK = DCO ~ 1048kHz. BRCLK = SMCLK/2
//

#include <msp430f5529.h>

#define BLINK BIT3 //2.3
#define CS BIT4 //2.4

#define DOUT BIT3 //3.3 SIMO
#define DIN BIT4 //3.4 SOMI

#define CLK BIT7 //2.7 UCAOCLK not using USCI clock

//unsigned char init_max6952[12] = {0x04,0x01, 0x03,0x01, 0x01,0x0f,
// 0x02,0x0f, 0x01,0xf0, 0x02,0xf0};
//unsigned char letter_A[2] ={0x60,0x41};

//ASCII of characters in Hex//
char A=0x41;
char E=0x45;


//MSP430F5529//
void ConfigWDT(void);
//void ConfigTimerA(void);
void ConfigSPI(void);
void init_max6952(void);
void send(unsigned char value);
void send_addr_data(unsigned char addr,unsigned char data);


void ConfigWDT(void)
{
WDTCTL = WDTPW + WDTHOLD;
}


void ConfigSPI(void)
{
volatile unsigned int i;

P2OUT |= BLINK + CS;

P2DIR |= BLINK + CS; //Set P2.3,P2.4 to output direction
P3SEL |= DIN+DOUT; //P3.3- DATAOUT P3.4- DATAIN
P2SEL |= CLK; //P2.7- Serial Clock Out SMCLK

UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL0 |= UCMST+UCSYNC+UCCKPH+UCMSB; // 3-pin, 8-bit SPI master
// Clock polarity high, MSB
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 0x01; // 1
UCA0BR1 = 0; //
UCA0MCTL = 0; // No modulation
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCTXIE; // Enable USCI_A0 TX interrupt

__bis_SR_register(LPM0_bits + GIE); // CPU off, enable interrupts
}


void init_max6952(void)
{
send_addr_data(0x04,0x01); //configuration register normal mode + blink disabled
send_addr_data(0x03,0x01); //scan limit to 0-3

send_addr_data(0x01,0x0f); //maximum intensity for digit-0
send_addr_data(0x02,0x0f); //maximum intensity for digit-1
send_addr_data(0x01,0xf0); //maximum intensity for digit-2
send_addr_data(0x02,0xf0); //maximum intensity for digit-3
}


void led_data()
{
send_addr_data(0x60,A);
__delay_cycles(2);
send_addr_data(0x60,E);
__delay_cycles(2);
}


void send(unsigned char value)
{
//unsigned char i;


UCA0CTL0 |= ~UCCKPL; //Clock pin low

while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?

UCA0TXBUF = value & 0x80;
value = value<<1;

__delay_cycles(2);

while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?

UCA0CTL0 |= UCCKPL; //Clock pin high


}


void send_addr_data(unsigned char addr,unsigned char data)
{
P2OUT &= ~CS; //CS low
send(addr);
send(data);
P2OUT |= CS; //CS high

}


void main()
{
void ConfigWDT();
void ConfigSPI();
void init_max6952();
//void ConfigTimerA();

while(1)
{
led_data();
__delay_cycles(2);
}

}

**Attention** This is a public forum