Raspberry PIxel dri...
 
Notifications
Clear all

Raspberry PIxel driver.

128 Posts
25 Users
0 Reactions
46.5 K Views
Barnabybear
Posts: 1583
Topic starter
(@barnabybear)
Noble Member
Joined: 15 years ago
ronp5683 wrote:Barnabybear,

It is clear that Sunn is taking care of 4 wire (2801 type) LED outputs.

You are trying to get the PI working with the 3 wire strings. I find it interesting what you are doing with your shift register. Can you explain a little better what you are doing?

Hi, no problem.

In a very simplistic form (that’s how my head likes it) and this just relates to SPI output, Shift registers and Pixels.

4 Wire Pixels 2801 (example 1 string of pixels).
The first shift register output is DATA the second is CLOCK:
To send a ‘0’ to the pixels - SPI set to twice the pixel clock speed.
SPI Data -> SR (shift register) Data = 0 Clock =0 then Data =0 Clock = 1
To send a ‘1’ to the pixels - SPI set to twice the pixel clock speed.
SPI Data -> SR (shift register) Data = 1 Clock =0 then Data =1 Clock = 1
So it takes 2 shift register outputs to send 1 pixel bit.
SPI running at 16MHz / 2 (clock cycles per bit) / (2 outputs per string) / 8 (strings) = 500 KHz.
So you could clock 8 strings of 2801’s at 500 KHz.
(Which would be fast enough to run strings of about 500 pixels long @ a refresh rate of 50 ms – If I got my maths right ).

3 Wire Pixels 3001 (The ones I have).
Easy – you set the transmission speed 100KHz to 2MHz.
Then a ‘0’ is a 0 and a ‘1’ is a 1.
SPI running at 16 MHz / 1 (data bit) / 32 (strings) = 500MHz
So you could clock 32 strings of 3001’s at 500KHz (or 160 strings @ 100KHz).

3 Wire Pixels 2811 (again just 1 string).
A bit more tricky these. Each pixel data bit consists of 3 parts:
The first is always high. The last is always low. The middle varies High = 1 and low = 0.
Then there is the tricky bit to get the timing right as ‘first, middle and last’ parts are not the same length. So we need to set the SPI speed to the shortest time period (probably the last).
First part: SPI Data -> SR always a ‘1’ then a pause (to lengthen the time period).
Second part: SPI Data -> SR ‘0’ or ‘1’ (dependant on bit to be sent) then a pause (to lengthen the time period).
Last part: SPI Data -> SR always a ‘0’ maybe a pause.
The data transmission speed is fixed with these pixels @ 800KHz so if the last pixel data part is a ¼ of the total data period, 800KHz x 4 = 3.2MHz (the nearest useable speed being 4MHz).
So with a SPI running at 16MHz we would only be able to run 4 strings of 2811 (but @ 32MHz we could run 8 strings).

That (if it works) gets data out of the SPI to the Pixels. But has limitations similar to the E68x series controllers, in that each shift register can only control one type of Pixels.

To get round this, the Pi’s SPI has 2 x CE outputs (CE0 and CE1 intended to enable 2 devices). Now we are in theory, as I’ve not found an example of this being done.
Let’s say we want to run 8 different types of pixel (8 types would have such a long refresh rate as to be of no real use for a sequenced show). To do that we will need 8 different shift registers (one for each different type of Pixel) and we need to be able to send Data to each independently.

So we use CE0 and a logic ‘AND’ ic to enable the 8 output shift registers. We then use CE1 to enable a single shift register, whose output is going to select which of the 8 output shift registers we will write data to next. Which works abit like this:

SPI Data -> SR (with CE1) 0000 0001. This enables the output shift register 1 (with our first pixel type) to receive data.
SPI Data -> SR (with CE0) we write the Pixel data and update the first set of pixels.
We now need to enable the next shift register that we want to update – let’s do 6.
SPI Data -> SR (with CE1) 0010 0000. This enables the output shift register 6 to receive data.
SPI Data -> SR (with CE0) we write the Pixel data and update the next set of pixels.

You get the idea – it’s clunky and slow but is possible (we could manage 2 or 3 different Pixel types, depending on type at a useable speed).
I’ve personally set myself a limit on SPI speed at 32MHz and if possible would like have 16MHz as a maximum. The Pi’s SPI clock runs at about 250MHz and the 74HC595’s are good for 100MHz but once you get above 32MHz speeds, I think we are moving out of DIY territory, and there are too many variables with regards to board design and component selection.

As a side note - if you didn't mind only driving half the number of pixel stings you could use 2 shift register outputs for each string and have a differental output to use with MPH and timon's differential signal receiver / power supply without needing aditional components.

So those are my thoughts – off to do the next bit of my Python tutorial so I can figure out how to get the SPI to send the data to all this stuff (in the way that I want it to).


Reply
Barnabybear
Posts: 1583
Topic starter
(@barnabybear)
Noble Member
Joined: 15 years ago
Reply
Posts: 35
(@snunn)
Eminent Member
Joined: 17 years ago

I got the ADG726 chip working to route the SPI. I also can get the PI up to 5 mhz on the SPI, after that speed the lights didn't all change as expected. I am also trying to use a rs232 board to drive a renard ss24, but I am running in to issues. It almost seems like the rs-232 is not getting its speed set correctly.


Reply
Barnabybear
Posts: 1583
Topic starter
(@barnabybear)
Noble Member
Joined: 15 years ago
snunn wrote:I got the ADG726 chip working to route the SPI. I also can get the PI up to 5 mhz on the SPI, after that speed the lights didn't all change as expected. I am also trying to use a rs232 board to drive a renard ss24, but I am running in to issues. It almost seems like the rs-232 is not getting its speed set correctly.

Cool. As I understand the SPI clock runs at 250MHz (maybe 256) and can only be divided by 2, so the only attainable speeds are: 250, 125, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25 MHz etc. When you set the speed you are setting max speed, and the SPI will run at the next lowest.
If you are asking the SPI to run at 5MHz it will be running at 4MHz. I dont know if that makes any difference.

I'm having fun trying to get CE0 to work as I want - Normaly high, low during transmit then high between bytes to clock the output enable on the shift register. But only started on that last night.

Keep up the good work.


Reply
Posts: 35
(@snunn)
Eminent Member
Joined: 17 years ago

I finally have my Renard SS24 being driven by the PI using a java program. Turns out that the rs232 adapters I bought for the PI each had pins 2 & 3 reversed since they used female plugs. A null modem cable fixed it all up.

See

http://www.savagehomeautomation.com/projects/raspberry-pi-rs232-serial-interface-options-revisit.html

and search for "cheap" to see what I ran in to.


Reply
Page 20 / 26
Share: