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

Controlling a 7 segment display

Wed Aug 07, 2013 11:44 am


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? :)

The display I have is this one: ... =affiliate

Posts: 1456
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


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://
# cd py-spidev/
# sudo python 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(), 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

User avatar
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 ... vp/id/1339

You might also want to see ... i/overview ... driver-ic/

Return to “General discussion”