Has anyone used MAX6952, MAX6953, MAX6955 With PBP?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default Has anyone used MAX6952, MAX6953, MAX6955 With PBP?

    Hello.

    Want to use any of these chips for a school project, have them on hands, but no sample code available. Maybe someone already did something with these chips?

  2. #2
    Join Date
    Aug 2016
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Has anyone used MAX6952, MAX6953, MAX6955 With PBP?

    Here's a simple program for the Crownhill Proton compiler that scrolls a message on a MAX6952 chip, so it should be adaptable for the PIC BASIC Pro compiler.

    Code:
    '
    ' A scrolling message on a MAX6952 chip
    ' Written for the Proton compiler by Les Johnson
    '
        Device = 16F877
        Declare Xtal = 8
        
    $define CLK_Pin PORTD.2     ' Attaches to the CLK_Pin pin of the MAX6952
    $define CS_Pin PORTD.1      ' Attaches to the CS_Pin pin of the MAX6952
    $define DIN_Pin PORTD.0     ' Attaches to the DIM pin of the MAX6952
    '
    ' Create some variables
    '    
        Dim MyText[11] As Byte = "HELLO WORLD"
    
        Dim MAX6952_bIndex As Byte
        Dim MAX6952_bLoop As Byte
        Dim MAX6952_bResult As Byte
        Dim MAX6952_Address As Byte
        Dim MAX6952_Data As Byte
    
    '--------------------------------------------------------------------------    
        GoTo Main                               ' Jump to the main program loop
    
    '--------------------------------------------------------------------------
    ' Write a byte to the MAX6952
    ' Input     : pAddress holds the address to write
    '           : pData hold the value to write
    ' Output    : None
    ' Notes     : None
    '
    $define MAX6952_Write(pAddress, pData) '
        MAX6952_Address = pAddress         '
        MAX6952_Data = pData               '
        GoSub _MAX6952
    
    _MAX6952:
    '
    ' Send the address
    '
        For MAX6952_bLoop = 0 To 7
            If MAX6952_Address.7 = 0 Then
                Clear DIN_Pin
                Set CLK_Pin
                Clear CLK_Pin
            Else
                Set DIN_Pin
                Set CLK_Pin
                Clear CLK_Pin
            EndIf
            MAX6952_Address = MAX6952_Address << 1
        Next
    '
    ' Send the byte
    '    
        For MAX6952_bLoop = 0 To 7
            If MAX6952_Data.7 = 0 Then
                Clear DIN_Pin
                Set CLK_Pin
                Clear CLK_Pin
            Else
                Set DIN_Pin
                Set CLK_Pin
                Clear CLK_Pin
            EndIf
            MAX6952_Data = MAX6952_Data << 1
        Next
        Return
    
    '------------------------------------------------------------------------------------
    ' The main program loop starts here
    ' A simple scroll on the LED display
    '
    Main:
        MAX6952_bIndex = 0
    
        High CS_Pin
        Low DIN_Pin
        Low CLK_Pin
        
        Clear CS_Pin
        MAX6952_Write($04, $01)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($01, $FF)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($02, $FF)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($03, $01)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($07, $00)         ' Set display
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($20, "H")
        Set CS_Pin
    
        While
            Clear CS_Pin
            MAX6952_Write($20, MyText[MAX6952_bIndex])
    
            Set CS_Pin
            Clear CS_Pin
            MAX6952_Write($21,MyText[MAX6952_bIndex + 1])
    
            Set CS_Pin
            Clear CS_Pin
            MAX6952_Write($22,MyText[MAX6952_bIndex + 2])
    
            Set CS_Pin
            Clear CS_Pin
            MAX6952_Write($23,MyText[MAX6952_bIndex + 3])
            Set CS_Pin
            MAX6952_bIndex = MAX6952_bIndex + 1
            If MAX6952_bIndex >= SizeOf(MyText) Then MAX6952_bIndex = 0
    
            DelayMS 700
       Wend

  3. #3
    Join Date
    Aug 2016
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Has anyone used MAX6952, MAX6953, MAX6955 With PBP?

    Here's a program that is more akin to PICBASIC Pro, so it will be a lot easier to adapt from Proton. It uses the Shout command, ShiftOut in Pro, instead of bit manipulating an SPI interface:

    Code:
    '
    ' A scrolling message on a MAX6952 chip
    ' Written for the Proton compiler by Les Johnson
    '
        Device = 16F877
        Declare Xtal = 8
        
    $define CLK_Pin PORTD.2     ' Attaches to the CLK_Pin pin of the MAX6952
    $define CS_Pin PORTD.1      ' Attaches to the CS_Pin pin of the MAX6952
    $define DIN_Pin PORTD.0     ' Attaches to the DIM pin of the MAX6952
    '
    ' Create some variables
    '    
        Dim MyText[11] As Byte = "HELLO WORLD"
    
        Dim MAX6952_bIndex As Byte
    
    '--------------------------------------------------------------------------
    ' Write a byte to the MAX6952
    ' Input     : pAddress holds the address to write
    '           : pData hold the value to write
    ' Output    : None
    ' Notes     : None
    '
    $define MAX6952_Write(pAddress, pData) SHOut DIN_Pin, CLK_Pin, MsbFirst, [pAddress, pData]
    
    '------------------------------------------------------------------------------------
    ' The main program loop starts here
    ' A simple scroll on the LED display
    '
    Main:
        MAX6952_bIndex = 0
    
        High CS_Pin
        Low DIN_Pin
        Low CLK_Pin
        
        Clear CS_Pin
        MAX6952_Write($04, $01)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($01, $FF)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($02, $FF)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($03, $01)
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($07, $00)         ' Set display
        Set CS_Pin
    
        Clear CS_Pin
        MAX6952_Write($20, "H")
        Set CS_Pin
    
        While
            Clear CS_Pin
            MAX6952_Write($20, MyText[MAX6952_bIndex])
    
            Set CS_Pin
            Clear CS_Pin
            MAX6952_Write($21,MyText[MAX6952_bIndex + 1])
    
            Set CS_Pin
            Clear CS_Pin
            MAX6952_Write($22,MyText[MAX6952_bIndex + 2])
    
            Set CS_Pin
            Clear CS_Pin
            MAX6952_Write($23,MyText[MAX6952_bIndex + 3])
            Set CS_Pin
            MAX6952_bIndex = MAX6952_bIndex + 1
            If MAX6952_bIndex >= SizeOf(MyText) Then MAX6952_bIndex = 0
    
            DelayMS 700
       Wend

Similar Threads

  1. Replies: 2
    Last Post: - 12th November 2014, 07:57
  2. PBP File Extension: .BAS vs .PBP
    By nedtron in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th February 2006, 05:48
  3. max6953 led mnatrix driver
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 10th March 2005, 13:36

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts