Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Using a 8*7Seg Display with MAX7219


  • Please log in to reply
5 replies to this topic

#1 gfcwfzkm

gfcwfzkm

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts
  • LocationBrig-Glis, Switzerland

Posted 26 September 2012 - 01:33 PM

Hi Community,

I buyed a display, with 8 * 7segments. (Display-Link Now i try to use it in VisualBasic, but the Sample, that they have, is in Arduino-C. I just tried with a other SampleCode, but it is for a 8x8 LED Matrix :(

My biggest problem is, that i dont have the know-how to use the Matrix-Sample for a normal Display-Code. My target is, to Write "Netduino" on the Display ;)

Can someone help me with that? I just have a little Code:

Imports Microsoft.SPOT.Hardware

Public Class max7219
    ' Command reference
    Public max7219_reg_noop As Byte = &H0
    Public max7219_reg_digit0 As Byte = &H1
    Public max7219_reg_digit1 As Byte = &H2
    Public max7219_reg_digit2 As Byte = &H3
    Public max7219_reg_digit3 As Byte = &H4
    Public max7219_reg_digit4 As Byte = &H5
    Public max7219_reg_digit5 As Byte = &H6
    Public max7219_reg_digit6 As Byte = &H7
    Public max7219_reg_digit7 As Byte = &H8
    Public max7219_reg_decodeMode As Byte = &H9
    Public max7219_reg_intensity As Byte = &HA
    Public max7219_reg_scanLimit As Byte = &HB
    Public max7219_reg_shutdown As Byte = &HC
    Public max7219_reg_displayTest As Byte = &HF

    ' Pin ports for spi
    Private loadPin As OutputPort
    Private dataPin As OutputPort
    Private clkPin As OutputPort

    ' Constructor, pass pin definitions
    Public Sub New(ByVal in_dataPin As OutputPort, ByVal in_clockPin As OutputPort, ByVal in_loadPin As OutputPort)
        ' Assign local port pins to ports passed from constructor
        dataPin = in_dataPin
        clkPin = in_clockPin
        loadPin = in_loadPin
    End Sub

    ' Transmits 1 byte over SPI, bitbang method
    Public Sub putByte(ByVal data As Byte)
        Dim i As Byte = 8
        Dim mask As Integer

        While i > 0
            mask = (1 << i - 1)
            clkPin.Write(False)
            If (CInt(data) And mask) = 0 Then
                dataPin.Write(False)
            Else
                dataPin.Write(True)
            End If
            clkPin.Write(True)
            i -= 1
        End While
    End Sub

    ' Sends 1 Command / Data pair to a single driver chip
    Public Sub maxSingle(ByVal reg As Byte, ByVal col As Byte)
        ' LOAD low
        loadPin.Write(False)

        ' Transmit Register
        putByte(reg)
        ' Transmit Column
        putByte(col)

        ' LOAD high latches data sent
        loadPin.Write(True)
    End Sub
End Class

Connection MAX7219 - Netduino (Plus)
LOAD - D10
DataIN - D11
CLK - D13
mfg

gfcwfzkm =)

Datasheet MAX7219 LED Display
Attached File  MAX7219 mit 8 7seg. Anzeigen.pdf   49.82KB   4 downloads

#2 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 26 September 2012 - 02:57 PM

I was going to do this weekend. But i have NGo and shield base. Reasoning is y I was upgraded yesterday. That took 3 mnths.

I don't know what board do u gave N, N+ or NGO.Posted Image

Right now i'm doing 8x32 dotmatrix (bi-color red/green) either 74hc154 or 74hc595 and no other components. U do not needed driver
JUST 74HC154 and 74HC595 and that all.Posted Image

I was looking @ ur sample. But u r using 74hc595 i assumed that. And u don't know how to write code for dotmatrix.

Here is sample code for dotmatrix. But don't try this. It is written in mikroBasic. I will try to convert to Dot Net Framework.

const supra as byte[30]  = (
          $00, $46, $49, $49, $49, $31,' // S
          $00, $3F, $40, $40, $40, $3F,' // U
          $00, $7F, $09, $09, $09, $06,' // P
          $00, $7F, $09, $19, $29, $46,' // R
          $00, $7E, $11, $11, $11, $7E)' // A

If u want to c my youtube. I'm using 74hc154. Its easier to write
dotmatrix 8x32


I have 9 samples for 74hc154. Also i have small code for 74hc595( u can enter string).I do not have youtube for 74hc595.

#3 gfcwfzkm

gfcwfzkm

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts
  • LocationBrig-Glis, Switzerland

Posted 26 September 2012 - 10:14 PM

looks nice

I have / use a Netduino Plus.

Your sample looks cool (LED-Matrix) but i have only 8 * 7Seg Display.
And thats a problem too, because i dont want to write allways the hex-address to turn a line on.
i Want to Turn the 7Seg_display with a string, or a integer on, like (lc.write("9", true), not lc.write(&H11, true).

öhm, understand? ^^

mfg

gfc

Link, from site, where i buyed my display
Note: Thats is only a Sample-Picture from play-zone.ch
Posted Image

#4 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 27 September 2012 - 12:57 PM

Do u have VS2010? I have Library written in C

I am not sure if ur 7 segment is Common Cathode or Common Anode and not sure if it is serial or parallel.

Here is tutorial for code and table written in C.
Mylink


Also I do not have max7219. But i do have 74HC595 with 4 and 6 digits

#5 gfcwfzkm

gfcwfzkm

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts
  • LocationBrig-Glis, Switzerland

Posted 27 September 2012 - 09:53 PM

looks nice.

I will try it, thanks =)

:/

C-Code and Libary's too.

Can i code a Libary myself? i Have the Schematic of the LED-Board: Schematic

#6 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 28 September 2012 - 03:38 AM

looks nice.

I will try it, thanks =)

:/

C-Code and Libary's too.

Can i code a Libary myself? i Have the Schematic of the LED-Board: Schematic


The above link is written in mikroC. U can convert to visual basic or visual C#.
U can build DLL frm vs2010

Also in main procedure event, u can leave out.
TRISIO=0b00001000;        // GP3 is input only  CMCON0 = 0x07; 
  ANSEL = 0x00;

Email me for ledcontrol.h library. written in C. If u can't, i can post in here.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.