This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Showing posts with label MAX7219. Show all posts
Showing posts with label MAX7219. Show all posts

Saturday, November 14, 2015

MAX7219 7-Segment Display

Do you like the 7-segment displays?
This board has a MAX7219, the board has eight digits connected in cascade. The board works at 5V and has SPI interface.
 
Video.

Description of library.

Initializes the MAX7219.

MAX7219_Init(void)
Example:
MAX7219_Init();

Writes a single digit.
MAX7219_WriteDigit(c, digit)

  • c: Sets the 7-segment character.
  • digit: Sets the digit.
Example:
MAX7219_WriteDigit('2', 5);

Writes constant numbers.
MAX7219_ConstDigit(buffer);

  • buffer: Sets the numbers.
Example:
MAX7219_ConstDigit("00001234");

Writes numbers.
MAX7219_Digit(buffer);

  • buffer: Sets the numbers.
Example:
unsigned int i;
char buffer2[20];

i = 25;
sprintf(buffer2, "%8d", i);
MAX7219_Digit(buffer2);

Clears the 8 digits.

MAX7219_Clear(void);
Example:
MAX7219_Clear();

Schematic.


Tuesday, July 21, 2015

Led matrix, MAX7219 board.

In this post we will evaluate the MAX7219 board. This board was designed to control an 8x8 led matrix. I bought four boards in ebay, I like this model.
How to assemble the boards.
  • We solder two headers in each board.
  • We will solder the led matrix, be sure to put the led matrix in correct position.

How to connect the boards.
We will connect the boards in the following way.
Video.


Request.
Email contact: armicrocontroller@gmail.com


Description of library.
This library support 1, 2, 3, 4 ...n boards, so we will need define the quantity of boards at max7219.h file.

Initializes the modules.

MAX7219_Init() 

Example:
MAX7219_Init();


Sets font.
MAX7219_SetFont(_font,_width,_min,_max)

  • _font: font to be set.
  • _width: char width (pixels)
  • _min: range minimum
  • _max: range maximum
Example:
MAX7219_SetFont(Font_6x8, 6, 32, 127);

Writes a char.
MAX7219_WriteChar(c,col)

  • c: char to be written
  • col: set column. Valid values: 0...
Example:
MAX7219_WriteChar('A', 0);

Prints text constant.
MAX7219_ConstText(buffer,col)

  • buffer: text to be written
  • col: set column. Valid values: 0...
Example:
MAX7219_ConstText("Hello",1);

Prints text variable.
MAX7219_Text(buffer,col)

  • buffer: text to be written
  • col: set column. Valid values: 0...
Example:
unsigned char i;
char buffer2[20];
i = 12;
sprintf(buffer2,"%03d",i);
MAX7219_Text(buffer2, 10);

This function does motion of scroll.
MAX7219_ConstTextScroll(buffer)
MAX7219_TextScroll(buffer)

MAX7219_ResetScroll(void)
  • buffer: text to be written
Example:
MAX7219_ResetScroll();
while(1){
MAX7219_ConstTextScroll("Hello.");
Delay_ms(300);
}

Displays Symbol.
MAX7219_Symbol8x8(buffer,col)

  • buffer: byte of array
  • col: set column. Valid values: 0...
Example:
MAX7219_Symbol8x8(8x8Symbol);

Fills RAM memory.
MAX7219_FillScreen(pattern)

  • pattern: byte to fill RAM memory
Example:
MAX7219_FillScreen(255);

Inverts the RAM memory.
MAX7219_InvertScreen()

Example:
MAX7219_InvertScreen();


Draws a Pixel on LED Matrix.
MAX7219_Pixel(x,y,color)
  • x: x position. Valid values: 0..
  • y: y position. Valid values: 0..7
  • color: color parameter. Valid values: 1, 2, 3
Example:
MAX7219_Pixel(1,1,1);