EasyManuals Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #217 background imageLoading...
Page #217 background image
217
#define scan_limit_reg 0x0B
#define shutdown_reg 0x0C
#define display_test_reg 0x0F
#define shutdown_cmd 0x00
#define run_cmd 0x01
#define no_test_cmd 0x00
#define test_cmd 0x01
void MAX72xx_init(void);
void MAX72xx_write(unsigned char address, unsigned char value);
MAX72xx.c
#include "MAX72xx.h"
void MAX72xx_init(void)
{
CS_DIR_OUT();
CS_HIGH();
MAX72xx_write(shutdown_reg, run_cmd);
MAX72xx_write(decode_mode_reg, 0x00);
MAX72xx_write(scan_limit_reg, 0x07);
MAX72xx_write(intensity_reg, 0x04);
MAX72xx_write(display_test_reg, test_cmd);
delay_ms(100);
MAX72xx_write(display_test_reg, no_test_cmd);
}
void MAX72xx_write(unsigned char address, unsigned char value)
{
CS_LOW();
SPI_transfer(address);
SPI_transfer(value);
CS_HIGH();
}
main.c
#include <msp430.h>
#include <string.h>
#include "delay.h"
#include "SPI.h"
#include "MAX72xx.h"
void GPIO_graceInit(void);
void BCSplus_graceInit(void);
void USI_graceInit(void);
void System_graceInit(void);
void WDTplus_graceInit(void);

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals