Show Posts
Pages: [1] 2 3 ... 12
1  Using Arduino / Project Guidance / Re: Help with controlling an RGB Led Strip WS2812 on: Today at 03:10:12 am
when I got my strip, I googled and found this....

http://funkboxing.com/wordpress/?p=1366

the video is cool, but looks much better in real life !

I downloaded the library and code and it worked straight away, this may be a perfect start for you

smiley
2  Using Arduino / Microcontrollers / Re: What's this I found on eBay? on: September 15, 2014, 08:44:48 am
lighting effects that go through smoke, for DJs & bands etc
3  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 14, 2014, 06:33:22 am
Ok I see sir, I might give your code a go when my chips arrive too..

I am really up against flash limits with my code as I ALSO have a 250kbps (n,8,2) data receiver in there as well as 2 button up/down control and EEPROM read/write... all in less than 1k of code !!

so far need to save 90 bytes for it to fit on the t13
4  Using Arduino / Microcontrollers / Re: What's this I found on eBay? on: September 14, 2014, 03:19:12 am
I also had a problem with speed on the 328, I adapted the TVout library (which is mono) so that it multiplexed with 3 channels of PWM to create a 24bit TVout library ! well sort of only one colour at a time. I had to up the processor speed as I was also receiving DMX (250kbps) through the UART constantly AND trying to do heaps of math to create shapes and patterns from the DMX data.

See here -> https://www.youtube.com/watch?v=RV49tQ6Lilc

16mhz just wouldnt cut the mustard as there is a lot of processor time used on creating the video without any visual glitches !
5  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 14, 2014, 03:12:49 am
Thanks Hiduino, I shall bear that in mind when I get my t13's in the post !!
Perhaps a few "nop\n\t" should be added in strategic lines of the assembly, if you know how Ws work then it might be straight forward smiley

Cheers SmeezeKitty, I dont think the 50us is the issue, I am trying to create a pulse-width data stream for the ws2812 which needs to be near 800khz, I dont think my code is near that, but the ws device has allowances and works on an t85, but as Hiduino says the timing needs adjustment for the t13, I cant imagine is very far out

smiley
6  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 13, 2014, 04:06:12 pm
I think I am using the attiny-master core, I found it ages ago on here, cant say exactly where I found it though, but everything works fine for me
7  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 13, 2014, 04:04:26 pm
I must admit this was an excerpt from something I am writing, so I did put the whole sketch
Well it works perfectly for me, perhaps I will make a standalone sketch with just the code the works and post that.. tomorrow maybe smiley
8  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 13, 2014, 01:30:34 pm
Great news...

just downloaded, installed core13 etc...

my sketch compiles to 950 bytes with the ATTiny85, and only 774 bytes with the ATTiny13 cores

*cracks open bottle of wine* smiley
9  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 13, 2014, 01:14:26 pm
dammit !! you could be right there, I havent installed the cores yet... I should do that and compile and see for myself !

Thanks smiley
10  Using Arduino / Microcontrollers / Re: What's this I found on eBay? on: September 13, 2014, 01:13:11 pm
crikey !!!

exponential-o-rama !!!
11  Using Arduino / Microcontrollers / Re: What's this I found on eBay? on: September 13, 2014, 11:14:51 am
Hi Paul,
I have been using a 32mhz TTL clock generator on a atmega328 for some time now without any problems, I think the 20mhz limit maybe for using crystals, I used 20mhz xtal and it was fine, but a 24mhz xtal just didnt start, so I decided to try the ttl clocks

not noticeably hot by the way smiley-wink
12  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 13, 2014, 10:53:36 am
I forgot to mention, I am just writing to a single WS2812 at the moment, but i guess the code can be adjusted to write to more
13  Using Arduino / Microcontrollers / Re: core13: An Arduino core for the Attiny13 *testers wanted* on: September 13, 2014, 10:52:15 am
Its a bit knife and fork, but it works, I intend to use it on the ATTiny13 (1k flash / 60 bytes ram)
just need a few defines, and set your port, and DDR... WS2812 routine is left for you to include/adjust how you like

code modified from here -> http://www.instructables.com/id/Bitbanging-step-by-step-Arduino-control-of-WS2811-/#step0

Code:
#define DIGITAL_PIN   (2)         // Digital port number
#define PORT          (PORTB)     // Digital pin's port
#define PORT_PIN      (PORTB2)    // Digital pin's bit position

unsigned long  latch50us;

void setup(void) {
// setups and DDR
}

void loop(void) {
WS2812();
delay(10);
}

void WS2812(void) {
    while((micros() - latch50us) < 50L);  // 50us data latch
    cli();
    volatile uint8_t green = 50; // choose your values for RGB
    volatile uint8_t red = 191;
    volatile uint8_t blue = 45;
    asm volatile(
      "rcall dobits\n\t"    // do green
      "mov %5, %6\n\t"
      "rcall dobits\n\t"    // do red
      "mov %5, %7\n\t"
      "rcall dobits\n\t"    // do bloo
      "rjmp out\n\t"
    "dobits:\n\t"           // label
      "ldi  %4, 8\n\t"      // reset number of bits
    "nextbit:\n\t"          // label                       
      "sbi  %0, %1\n\t"     // SET OUTPUT HIGH
      "sbrc %5, 7\n\t"      // Skip if HiBit in value is clear 
      "rjmp bitset\n\t"     // jump if HiBit is set
      "cbi %0, %1\n\t"      // SET OUTPUT LOW
      "rol  %5\n\t"         // shift value left to get to next bit
      "dec  %4\n\t"         // decrement nBits
      "brne nextbit\n\t"    // branch if bits not finished
      "ret\n\t"
    "bitset:\n\t"           // label
      "rol  %5\n\t"         // shift value left to get to next bit
      "cbi %0, %1\n\t"      // SET OUTPUT LOW
      "dec  %4\n\t"         // decrement nBits
      "brne nextbit\n\t"    // branch back if bits not finished
    "ret\n\t"               // return from sub
    "out:\n\t"              // exit
      ::
      // Input operands         Operand Id (w/ constraint)
      "I" (_SFR_IO_ADDR(PORT)), // %0
      "I" (PORT_PIN),           // %1
      "e" (&PORT),              // %a2
      "w" (NULL),              // %3
      "r" (8),                // %4
      "r" (green),              // %5
      "r" (red),                // %6
      "r" (blue)                // %7
    );
  sei();                       
  latch50us = micros();                 
}
14  Using Arduino / LEDs and Multiplexing / Re: WS2812 driver for 8mhz micro's on: September 13, 2014, 07:53:25 am
Since I was having problems with using ASM with arrays in a volatile manner (not knowing enough about all this), plus as I didnt want to use memset/malloc to remove dynamic memory addressing, I ended up with this sub which works perfectly...

Code:
void WS2812(void) {
    while((micros() - latch50us) < 50L);  // 50us data latch
    cli();
    volatile uint8_t green = dmxData[1];
    volatile uint8_t red = dmxData[2];
    volatile uint8_t blue = dmxData[3];
    asm volatile(
      "rcall dobits\n\t"    // do green
      "mov %5, %6\n\t"
      "rcall dobits\n\t"    // do red
      "mov %5, %7\n\t"
      "rcall dobits\n\t"    // do bloo
      "rjmp out\n\t"
    "dobits:\n\t"           // label
      "ldi  %4, 8\n\t"      // reset number of bits
    "nextbit:\n\t"          // label                       
      "sbi  %0, %1\n\t"     // SET OUTPUT HIGH
      "sbrc %5, 7\n\t"      // Skip if HiBit in value is clear 
      "rjmp bitset\n\t"     // jump if HiBit is set
      "cbi %0, %1\n\t"      // SET OUTPUT LOW
      "rol  %5\n\t"         // shift value left to get to next bit
      "dec  %4\n\t"         // decrement nBits
      "brne nextbit\n\t"    // branch if bits not finished
      "ret\n\t"
    "bitset:\n\t"           // label
      "rol  %5\n\t"         // shift value left to get to next bit
      "cbi %0, %1\n\t"      // SET OUTPUT LOW
      "dec  %4\n\t"         // decrement nBits
      "brne nextbit\n\t"    // branch back if bits not finished
    "ret\n\t"               // return from sub
    "out:\n\t"              // exit
      ::
      // Input operands         Operand Id (w/ constraint)
      "I" (_SFR_IO_ADDR(PORT)), // %0
      "I" (PORT_PIN),           // %1
      "e" (&PORT),              // %a2
      "w" (NULL),              // %3
      "r" (8),                // %4
      "r" (green),              // %5
      "r" (red),                // %6
      "r" (blue)                // %7
    );
  sei();                       
  latch50us = micros();                 
}
 
15  Using Arduino / LEDs and Multiplexing / Re: WS2812 driver for 8mhz micro's on: September 13, 2014, 07:48:23 am
Fungus, I tried your code, I couldnt get it to work at all, so I have stuck with mine, thanks
Pages: [1] 2 3 ... 12