Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MAX7219: 7-segment and 8-digit display control (Oshonsoft).

DogFlu66

Member

Introduction​


This library is designed to control the MAX7219 chip using a PIC18 microcontroller with the Pic18 Basic language in Oshonsoft. It enables managing LED 7-segment displays, simplifying the configuration, data transfer, and brightness control of up to 8 digits. The library includes functions to initialize the device, send data, clear the display, adjust brightness, and display text strings.
This library does not use the MMSP module.

Functions and their descriptions​


  1. MAX7219_Init
    Configures communication pins, initializes the MAX7219, and sets it up for basic operation.
  2. MAX7219_Send(reg As Byte, data As Byte)
    Sends data to a specific register on the MAX7219.
  3. MAX7219_Clear
    Turns off all segments of the 8 connected digits.
  4. MAX7219_Full
    Lights up all segments of the 8 connected digits.
  5. MAX7219_SetIntensity(intensity As Byte)
    Adjusts the display brightness within a range of 0 (minimum) to 15 (maximum).
  6. MAX7219_DisplayString(_string[16] As String)
    Displays a formatted text string on the display, handling characters and decimal points.
  7. MAX7219_Digits(index As Byte) As Byte
    Returns the bitmask corresponding to the requested character.
  8. MAX7219_GetSegmentIndex(char As Byte) As Byte
    Returns the segment index for a character (numbers, letters, spaces, or symbols).

MAX7219 7SegDisplay.jpg
 

Attachments

  • Main Test.bas
    3.3 KB · Views: 6
  • MAX7219_DisplayLib.bas
    6.4 KB · Views: 6
  • _Pic18F46K22Lib.bas
    43.7 KB · Views: 6
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top