015 - Brickcell 8x8 Dot Matrix Display | MakeCode Microbit
Introduction
The MAX7219 is a serially interfaced, common-cathode LED display driver. It is often used to control dot matrix displays or seven-segment displays. The MAX7219 is designed to drive up to 64 individual LEDs, and it uses a 16-bit shift register and constant-current LED drive to minimize the number of required external components.
When it comes to dot matrix displays, the MAX7219 is commonly used to control 8x8 LED matrices. In the context of an 8x8 dot matrix display, it means there are 8 rows and 8 columns of LEDs, resulting in a total of 64 LEDs. The MAX7219 simplifies the process of controlling and multiplexing these LEDs.
Some key features of the MAX7219 include:
SPI Interface: It communicates using a simple serial interface that allows you to daisy-chain multiple MAX7219s together, reducing the number of pins required to control multiple displays.
Multiplexing: The MAX7219 uses multiplexing to control multiple LEDs with a relatively small number of pins. It cycles through the rows of the display quickly, creating the illusion that all LEDs are on simultaneously.
Brightness Control: It provides a way to control the brightness of the LEDs through digital means, allowing you to adjust the intensity of the display.
Cascading: Multiple MAX7219s can be connected in series to control larger displays or multiple displays.
When building projects with LED matrices, such as scrolling text displays, clocks, or other visualizations, the MAX7219 is a popular choice due to its ease of use and efficient design. Programming it usually involves sending the appropriate data to the device through the serial interface to control the desired patterns on the LED matrix.
Hardware Instruction
Let's explore how to connect the Dot Matrix Display module with SPI interface (MAX7219) to a micro:bit microcontroller and utilize MakeCode for programming.
- Connect the MAX7219 Dot Matrix display GND pin to microbit GND pin.
- Connect the MAX7219 Dot Matrix display VCC pin to microbit 3V3 pin.
- Connect the MAX7219 Dot Matrix display serial data input pin (DIN) to microbit pin 15.
- Connect the MAX7219 Dot Matrix display serial clock pin (CLK) to microbit pin 14.
- Connect the MAX7219 Dot Matrix display chip select pin (CS) to microbit pin 13.
Software Instruction
Now, let's start into programming the micro:bit to utilize the 8x8 MAX7219 Dot Matrix display module.
- Login to https://makecode.microbit.org/ using your Microsoft account.
- Create a new project by clicking the "New Project" button. You may name it anything you want, I suggest to name it with descriptive name such as "dotmatrix-8x8-max7219-test".
- Click the "Extensions" block just under the "Math" block.
- Type https://github.com/gbantique/brickcell-dotmatrix-max7219/ on the search bar.
- Select the "brickcell-dotmatrix-max7219" from the search results. The "dotmatrix max7219" block should appear under the "Brickcell" block.
- Copy the code provided below.
1let max7219 = Brickcell.create()
2max7219.setup(
3 1,
4 DigitalPin.P15,
5 DigitalPin.P14,
6 DigitalPin.P13,
7 DigitalPin.P16,
8 max7219_rotation_direction.clockwise,
9 true
10)
11basic.forever(function () {
12 max7219.scrollText(
13 "Brickcell 8x8 Dot Matrix Display",
14 150,
15 300
16 )
17})
Or you make a copy of my created project in your MakeCode workspace.
https://makecode.microbit.org/S88323-04917-57323-26509/
Expected Result
If you carefully follow the provided instruction above, you should be able to see a scrolling text "Brickcell 8x8 Dot Matrix Display".
Posts in this series
- 016 - Brickcell 8x16 Dot Matrix Display | MakeCode Microbit
- 014 - Brickcell CO2 SGP30 | MakeCode Microbit
- 013 - Brickcell Gesture APDS9960 | MakeCode Microbit
- 012 - Brickcell Rotary Encoder | MakeCode Microbit
- 011 - Brickcell RTC DS3231 | MakeCode Microbit
- 010 - Brickcell Gyro MPU6050 | MakeCode Microbit
- 009 - Brickcell TOF VL53L0X | MakeCode Microbit
- 008 - Brickcell Color TCS34725 | MakeCode Microbit
- 007 - Brickcell Pressure BMP280 | MakeCode Microbit
- 006 - Brickcell Weight HX711 | MakeCode Microbit
- 005 - Brickcell Fine Dust | MakeCode Microbit
- 004 - Brickcell Ultrasonic HCSR04 | MakeCode Microbit
- 003 - Brickcell NTC Temperature | MakeCode Microbit
- 002 - Brickcell DHT11 | MakeCode Microbit
- 001 - Brickcell LCD I2C | MakeCode Microbit
No comments yet!