New Single String P...
 
Notifications
Clear all

New Single String Pixel controller

85 Posts
15 Users
0 Reactions
32.9 K Views
Materdaddy
Posts: 2368
(@materdaddy)
Famed Member
Joined: 16 years ago

Is there a reason you used such a large µc? I'm presuming an ATMega328. Why not some form of Tiny that has similar RAM/Flash, but less pins to drop the size/cost?


Reply
komby
Posts: 871
Topic starter
(@komby)
Prominent Member
Joined: 14 years ago
folny wrote:Could you try a do code using https://code.google.com/p/fastspi/ library that would be great and it would help a lot of people I think.

I will look at fast spi again. I know supporting it will open this lib up to a lot of different pixels and its probally a good idea.

I didnt build the library originally with fast spi because I didnt want to use the spi library due to the nrf24L01 being on the spi pins.

the current code I am using is built on the adafruit library which also supports spi but is not using it in my code.

the code is located at https://github.com/komby/RFPixelControl

i am using the sketch : https://github.com/komby/RFPixelControl/tree/master/Examples/WS2801Receiver

Materdaddy wrote:Is there a reason you used such a large µc? I'm presuming an ATMega328. Why not some form of Tiny that has similar RAM/Flash, but less pins to drop the size/cost?

Yes! Its probably not the best reason though. I bought a 20 pack of them and have been building stuff based on them since. The code doesnt need the 328 it could easily run on a 168 as its Binary sketch size: 10,888 bytes (of a 32,256 byte maximum). The 328 seems well priced at ~2$ a chip.

The board may not look like it but it is breaking out quite a few of the pins on the 328.

It has headers for :


                        +---\/---+
          (RESET)  PC6  |1     28|  NO Connect          
            (RXD)  PD0  |2     27|  NO Connect          
            (TXD)  PD1  |3     26|  NO Connect          
    PixelData      PD2  |4     25|  PC2  (ADC2)
    PixelCLK       PD3  |5     24|  PC1  (ADC1)
    NO Connect          |6     23|  PC0  (ADC0)
                   VCC  |7     22|  GND
                   GND  |8     21|  AREF
          (XTAL1)  PB6  |9     20|  AVCC
          (XTAL2)  PB7  |10    19|  PB5  (SCK)    RF-SCK
    NO Connect          |11    18|  PB4  (MISO)   RF-MISO
    NO Connect          |12    17|  PB3  (MOSI )  RF-MOSI
    NO Connect          |13    16|  PB2  (SS )    RF-CSN
           (ICP1)  PB0  |14    15|  PB1  (OC1A)   RF-CE
                        +--------+

Note, The RF IRQ is not connected. I will likely connect it in future versions of the PCB, as well as either removing the reset button or using a smaller one that is further away from the chip.

So fornow its using 21 of the 28 pins . I really should have also added the Aref pin to make it a bit more versatile in other uses. I am also planning on other uses for them where analog sampling would be good. For now the extra analog pins are good to use as digital pins.

I do also have another board I am still working on which uses the attiny85 and vUsb ( based on digispark) with nRF24L01 headers on board. But The attiny85 is more for fun in this case I don't think ill be doing pixels with it.

the 85 would have the same issue I have with sharing the spi with the transceiver. I don't want the receiver to drop RF packets during the off time. Sharing the SPI would mean that while the code is writing to the string I don't think that the RF will be listening to RF packets. In my Code once the receiver is initialized it stays on. For other uses (sprinklers, weather monitoring etc. ) it would be fine to turn it on and transmit, shut it off and do other stuff. For pixels and DMX timing I was not wanting to do that.


Reply
dmcole
Posts: 2196
(@dmcole)
Noble Member
Joined: 19 years ago
komby wrote:its arduino compatible so as soon as I get the files cleaned up ill be able to publish them.
Materdaddy wrote:Is there a reason you used such a large µc? I'm presuming an ATMega328. Why not some form of Tiny that has similar RAM/Flash, but less pins to drop the size/cost?
komby wrote:Yes! Its probably not the best reason though. I bought a 20 pack of them and have been building stuff based on them since. The code doesnt need the 328 it could easily run on a 168 as its Binary sketch size: 10,888 bytes (of a 32,256 byte maximum). The 328 seems well priced at ~2$ a chip.

Also, wouldn't you lose the Arduino compatibility by switching to a smaller chip like the ATTiny?

\dmc


Reply
komby
Posts: 871
Topic starter
(@komby)
Prominent Member
Joined: 14 years ago

There is some good tutorials on using attiny with arduino. The digispark has its own version of the arduino IDE that has a lot of attiny targets. What you do loose is the library support for the arduino. With the atmega It seems people have tried just about everything with that chip.


Reply
komby
Posts: 871
Topic starter
(@komby)
Prominent Member
Joined: 14 years ago
folny wrote:Could you try a do code using https://code.google.com/p/fastspi/ library that would be great and it would help a lot of people I think.

For FastSPI I tried tonight. The FastSPI has a new version 2. I was able to use the fastspi and not use the hardware spi. I got further than I thought and was able to get it compiling and get it to control the pixels. my only issue with it is that the color are backwards 🙂 I am sure its a minor nuance between the way my other code examples handle the colors and the way that this lib is expecting.

I "should" be able to sort it out and get a working copy published using this library. That said, I will only be able to test with the WS2801 pixels.


Reply
Page 2 / 17
Share: