Freetronics DMD Library Porting Struggles


#2

archimag0, I am at the Maker Faire with the Spark Team but when I get back home Monday I will port the library for you if you don’t mind waiting. :smile:


#3

That’s so kind of you to offer peekay - thank you so much. I can of course wait as long as you need!


#4

archimag​0, I am reviewing the code and I need to know if you wish to use hardware SPI instead of the software SPI? Are you trying to run a specific example that I can look at?


#5

Hi peekay123; at this point I’m just trying to get the examples ( https://github.com/freetronics/DMD2/tree/master/examples ) to run to see that it actually works - once I have those going I plan to start developing my own project. What would the advantages/disadvantages be to hardware vs software?


#6

Ok, so it seems all the examples use “SoftDMD” which is the software SPI. I will switch the examples to hardware SPI and port the library to the Spark so you can test. Stay tuned! :smile:


#7

You rock! Thank you.


#8

@archimag0, I have the library ported and compiling. I find parts to be “sloppy” but I believe we can get it working. I have to go over a couple of items and I will post it on my github later so you can test it. :smile:

UPDATE: I posted the (untested) library on my github. I used the Spark CLI to compile it as a single folder. Easy Peasy.

Things to know: I setup the example to use hadware SPI. The pins connect as follows:

Spark     DMD
 A5        R   (MOSI)
 A3       CLK  (SCK)
 A0       nOE  (A0 supports PWM for brightness other than 255)
 D4        A
 D3        B
 D2       SCK

The SPI clock is set to 4.5MHz. Let me know how it goes!


#9

Thanks peekay!! I’ll try and test it tonight or tomorrow. Fingers crossed!


#10

@peekay123 I just tested it and… I get a handful of LEDs turning on, but definitely not what was expected: http://imgur.com/7zSrbkV. Ahhhh!


#11

It’s a start! The library is setup to NOT use the hardware timer. Perhaps this is the problem. I may need to put a logic analyzer on the outputs to see what it’s doing. It just means more work :wink:


#12

Yay, work! Well let me know what you need from me…


#13

Just a quick thought–the old software SPI is going to be a lot slower than 4.5MHz. Maybe you should try SPI_CLOCK_DIV64 for 1.125 MHz.

Good luck!


#14

@bko I just tried that - no change unfortunately.

I also just realized that this DMD library is version 2 of the original library here, https://github.com/freetronics/DMD - perhaps the older version will provide some clues?


#15

DMD2 is in beta so that may be an issue. @archimag0 did you check your wiring against the pins I set the defaults to? I will look at porting the older library and perhaps we can go from there. Stand by :wink:

UPDATE: I have the DMD library ported (using the IntervalTimer library to boot!). I will have it on github in the morning… I need sleep!


#16

Wow, you work fast! I’ll test it tonight. I did check my wiring several times.

Thanks again!!


#17

@archimag0, the [DMD library][1] is on my github.

!!! NOTE: DMD reads the default SPI CS pin (A2) to see if another device is using the SPI bus. If the value read is not HIGH, the DMD will NOT refresh. This may need to be modified or the CS pin pulled HIGH for the code to function correctly. Keep me posted! :smile:


#18

I just tested the DMD1 library and I get the same result. Hmm…

EDIT: Not sure if this is relevant, but I was playing with the wiring to see if that had anything to do with it, and if I pull the A and B wires and start playing with them it makes different LEDs light up. Something is happening…


#19

@archimag0, I just realized that these are 5V displays! You will need to use level shifters (3.3v to 5V) between the Spark and the Freetronics unit. Are you using level shifters?


#20

Oh shoot! How did I miss that. Good catch! I hope that’s it…


#21

@archimag0, its a start! That tiny little issue needs to be resolved before anything can be expected to work! After that… debugging :wink: