Hardware Reference
In-Depth Information
Reset blink timing counter on the rising edge of CS
Disable blink function
Select slow blinking (“don't care”)
Select normal mode
Send the following values to the MAX6952s:
0x04, 0x11, 0x04, 0x11
Display test register
Disable display test as the start by writing the following values to the MAX6952:
0x07, 0x00, 0x07, 0x00
Digit 0 (rightmost digit) plane P0
Display space character and letter T , respectively, on display 0 of the fi rst and second MAX6952
by sending the following data:
0x20, 0x54, 0x20, 0x20
Digit 1 (second rightmost digit) plane P0
Display letter U and letter E , respectively, on display 1 of the fi rst and second MAX6952 by
sending the following data:
0x21, 0x45, 0x21, 0x55
Digit 2 (second leftmost digit) plane P0
Display letter S and letter C , respectively, on display 2 of the fi rst and second MAX6952 by
sending the following data:
0x22, 0x43, 0x22, 0x53
Digit 3 (leftmost digit) plane P0
Display letter M and letter E , respectively, on the display 3 of the fi rst and second MAX6952 by
sending the following data:
0x23, 0x45, 0x23, 0x4D
The following C program confi gures the SPI and MAX6952 properly:
#include “c:\cwHCS12\include\hcs12.h”
#include “c:\cwHCS12\include\spi0util.c”
void sendtomax(char x1, char x2, char x3, char x4);
void openspi0(void);
void main (void)
{
openspi0();
DDRM | 5 BIT5; // configure PM5 pin for output
sendtomax(0x01, 0xFF, 0x01, 0xFF);
// set intensity for digits 0 and 1
sendtomax(0x02, 0xFF, 0x02, 0xFF);
// set intensity for digits 2 and 3
sendtomax(0x03, 0x01, 0x03, 0x01);
// set scan limit to drive four digits
sendtomax(0x04, 0x11, 0x04, 0x11);
// set configuration register
sendtomax(0x07, 0x00, 0x07, 0x00);
// disable test
sendtomax(0x20, 0x54, 0x20, 0x20);
// value for digit 0
sendtomax(0x21, 0x45, 0x21, 0x55);
// value for digit 1
sendtomax(0x22, 0x43, 0x22, 0x53);
// value for digit 2
sendtomax(0x23, 0x45, 0x23, 0x4D);
// value for digit 3
}
Search WWH ::




Custom Search