maigel
Posts: 1
Joined: Wed Aug 07, 2013 11:36 am

Controlling a 7 segment display

Wed Aug 07, 2013 11:44 am

Hi,

I have quite some programming experience but 0 with electronics. I bought a raspberry pi to learn the electronics side. Now I have a arduino 7 segment module lying around (with a max7218cwg chip, whatever that means). I'd like to try and control this with the GPIO pins. The display has 5 pins: VCC, GND, DN, CS, CLK. The only problem, I have no clue how to start this, is there anyone who can point me in the right direction? :)

Edit:
The display I have is this one: http://dx.com/p/8-segment-led-display-b ... =affiliate

ghp
Posts: 1317
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Controlling a 7 segment display

Sat Aug 10, 2013 5:56 pm

Hello,

think it should be possible to use this device from a raspberry.
Although arduino world is using 5V, the module uses only inputs, so the raspberry 3.3V will drive the device, but there are no 5Voutputs which would harm the pi.

I do not have a complete solution, but here is a sketch for this:
- check out the maxim data sheet for the 7218. There are all informations in on how to interface this device to a microcontroller.
- The interface is a SPI-type, so connect it to the corresponding GPIO-Pins of Pi
- prepare python environment
# sudo modprobe spi_bcm2708
# sudo apt-get install python-dev
# sudo apt-get install git
# git clone git://github.com/doceme/py-spidev
# cd py-spidev/
# sudo python setup.py install
- run some code similiar to the following sketch

Code: Select all

import spidev

os.system("modprobe spi_bcm2708")

.. the following code is copied from a class

        self.spi = spidev.SpiDev()
        self.spi.open(bus, device)
            
        self.spi.max_speed_hz = 1000000
		# use list() to clone the data, needed for the spidev.
		
        r = self.spi.xfer( list([self.GET_DATA0, self.GET_DATA1, 0]))
Hope this gives you a starting point
Gerhard

User avatar
danpeirce
Posts: 100
Joined: Thu May 10, 2012 8:32 am
Location: Richmond & Surrey BC Canada
Contact: Website

Re: Controlling a 7 segment display

Tue Sep 03, 2013 6:49 am

It would help to have datasheets. I would want one for the display board and one for the driver IC on the board. I searched the part number you gave and keep coming up with the MAX7219 rather than 7218. I am wondering if that is a typo? Datasheet on maxim site at http://www.maximintegrated.com/datashee ... vp/id/1339

You might also want to see
http://learn.adafruit.com/matrix-7-segm ... i/overview

http://embedded-lab.com/blog/?p=6862

http://tronixstuff.com/2010/07/09/revie ... driver-ic/

Return to “General discussion”