lukekb
Posts: 17
Joined: Mon Dec 03, 2012 8:51 pm

Use SPI to drive HT1632C LED Matrix

Mon Dec 03, 2012 9:17 pm

Hi, I am interested in trying to control an LED Matrix using the RPI so I can build an Info Board. I have 4 ht1632c based board from Sure Electronics that are 8x32 LEDs.

I have unblacklisted the SPI module and downloaded and installed wiringPI.

I got a logic level converter to convert from 3.3v to 5v. I am powering the display off a separate 5v power supply.

I have made the following connections:
RPI <---> LED
MOSI = DATA Pin 7
CLK = WR Clock Pin 5
CE0 = Chip Select 1 Pin 3

I have tried passing simple commands and writing data using wiringPiSPIRW, but can't make anything happen.

It looks like the Chip Select pin must be set high prior write, then to low during writes and then set high after. Does that happen if I use CE0 or should I be using a GPIO and doing that manually?

Any help or pointers would be great appreciated!

The manual for the LED Boards is here:
http://www.sure-electronics.net/downloa ... 1.0_EN.pdf

There are number of Adruino tutorials, so it seems like this should be doable. I am just not sure if I need a custom SPI driver though.
https://github.com/andykarpov/ht1632c
http://scuola.arduino.cc/en/content/con ... rduino-uno
http://123led.wordpress.com/about/
http://scuola.arduino.cc/en/content/int ... controller
http://www.lucadentella.it/en/2012/10/0 ... ht1632c-2/

lukekb
Posts: 17
Joined: Mon Dec 03, 2012 8:51 pm

Re: Use SPI to drive HT1632C LED Matrix

Tue Dec 04, 2012 6:04 pm

Well, I got it working. It turns out you need to send some initialization commands first. The HT1632 has no problem if you send the 12bits as 16bits with the last 4 bits zeroed.

haemaker
Posts: 2
Joined: Mon Dec 03, 2012 10:31 pm

Re: Use SPI to drive HT1632C LED Matrix

Tue Dec 04, 2012 6:18 pm

Hello,

I am trying a similar project, but my hardware has not arrived yet. If you solve some of these problems, please post your experiences. After looking at some of these sites, I am getting the feeling that not many people have this working and it is going to be a lot of work.

I bought the 32x16 board which is even more complicated as the CS pins are not individually wired, you have to code chip selection onto the CS pin with the CSCLK pin and it is not well documented...

rguifa
Posts: 2
Joined: Thu Feb 14, 2013 10:51 pm

Re: Use SPI to drive HT1632C LED Matrix

Thu Feb 14, 2013 11:05 pm

Hello there,

I have 2 of those boards, and have done the sign with the arduino. I recently got myself a Raspberry PI so it would be great to drive those displays. Any chance of sharing your project?

lukekb
Posts: 17
Joined: Mon Dec 03, 2012 8:51 pm

Re: Use SPI to drive HT1632C LED Matrix

Fri Feb 15, 2013 12:15 am

You are in luck, I just got everything written last night:
http://lukeberndt.com/2013/raspberry-pi ... d-via-spi/

rguifa
Posts: 2
Joined: Thu Feb 14, 2013 10:51 pm

Re: Use SPI to drive HT1632C LED Matrix

Fri Feb 15, 2013 12:27 am

I guess I am! Thank you very much for sharing it.
Since you did this project, I can only guess you have some interest on led matrices.
I have been playing around with P10 led modules, I just got 6 of them from China. I have not done anything with the PI and those yet, but I do have info for the arduino.

I have also played quite a bit with the boards you have and the arduino, so in case I can do something for you I'd be glad to pay the favor back (not that I think you need it though).

knocker
Posts: 5
Joined: Thu Jun 20, 2013 9:06 am

Re: Use SPI to drive HT1632C LED Matrix

Sun Jun 08, 2014 11:26 am

Being very new at programming, and trying my hand at Python (no previous knowlege in C or anything else for that matter) i'm trying to learn from Luca's script to run the displays natively under python. I've had some basic success, but mainly through bit banging, as opposed to some nice clean code. I've heard of using 'wrappers' to use C code in Python, but it is something i am greatly struggling with. Does any one have any advice on how to get these displays running under Python using SPI? (i am using three GPIO pins and not SPI code) any help appreciated.

ArendJan
Posts: 2
Joined: Wed Nov 12, 2014 2:03 pm

Re: Use SPI to drive HT1632C LED Matrix

Wed Nov 12, 2014 2:09 pm

You are in luck, again. I ported this Arduino library to the raspberry pi:
https://github.com/gauravmm/HT1632-for-Arduino

I'll upload the code soon on Github.

knocker
Posts: 5
Joined: Thu Jun 20, 2013 9:06 am

Re: Use SPI to drive HT1632C LED Matrix

Wed Jul 15, 2015 4:39 pm

did you ever get around to uploading the code?

Return to “Interfacing (DSI, CSI, I2C, etc.)”