Show Posts
Pages: 1 [2] 3 4
16  Using Arduino / LEDs and Multiplexing / DMX512 questions on: November 26, 2012, 10:49:22 am
Hi All, i am looking at using a matrix of 30 x 30 RGB led's using WS2801's

My question is weather each DMX channel is assigned to an individual colour of each LED, or if it is each WS2801 that is addressed?

as the SPI to DMX interface i am looking at using has a max number of channels of 1024, so a 900 LED array would need either 900 channels if each WS2801 is addressed, or 2700 channels if each colour of each RGB is addressed,

Many thanks for the information

Rich
17  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 23, 2012, 10:40:11 am
PERFECT!!

Thanks so much for the help, just what i needed

Rich
18  Using Arduino / LEDs and Multiplexing / Re: TLC5940 Changine to Bit Banging and Move Blank Pin???? on: November 23, 2012, 10:17:42 am
So if i do a

digitalWrite(5,HIGH);
digitalWrite(5,LOW);

(5 being the new BLANK Pin i want to use)

after the line of code which does the 4096 GSCLK pulses, this should give me the same result?

I just need to find the line of code that does the 4096 GSCLK pulses then? is that done in one of the libraries?

Then i should just grey out the line of code that does the original blank Pulse?

Thanks for the advice so far

Rich
19  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 23, 2012, 10:12:06 am
Yes i changed the code and the compliler brings up an error so it is deffinitely using that header file,

Im wondering if it is something to to with the fact that the hearer files include the SPI library,

And in the SPI library it defines the SS pin back through the Base Arduino Pin setup library as pin 10

Whcih makes me thing that it uses part of the SPI and Arduino.H library to carry out all of the CS functions?

I am soo confused lol

Rich
20  Using Arduino / LEDs and Multiplexing / Re: TLC5940 Changine to Bit Banging and Move Blank Pin???? on: November 23, 2012, 09:15:39 am
LOL, i am really trying to understand what the library does,

I have downloaded both the data sheet for the TLC5940, the MCP2515, and the Atmel processor
But i seem to be going in loops and loops,

I have tried changing the MCP library where it defines the CS pin as 10, and changed it to 5, but the CAN chip no longer works,

I have searched other posts about moving the CS pin but i think the MCP calls the SPI library, and the SPI library references the SS pin back to the pins Arduino header, and i DONT want to go changing things in there lol

What do you think?

Thanks
RIch
21  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 23, 2012, 06:20:22 am
Well what i have done as a test, is to use just the MCP wired to the Arduino, using its standard pins on the SPI except the CS pin which as you instructed, i changed that line in the code to pin 5, then i have wired the CS pin from the MCP to D5 on the Arduino and ran some code that i know works,

It doesnt seem to function with this change made,

Maybe i need to change that pin elsewhere in the Code?

sorry for all of the questions

Thansk so much for the assistance

Rich
22  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 23, 2012, 05:10:28 am
Right,

I am not using that shield, i am using the Sparkfun /SKpang shield with the library i sent the link too,

So all i have to do is solder a wire from the CS pin on the CAN shield to say D5 instead, and change

#define SPICS 10
to
#define SPICS 5

The TLC library can remain the same?

Thanks

Rich
23  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 23, 2012, 03:25:18 am
HI, thanks for all of your help,

The link to the CAN library is below, but i dont think the link works very well,

http://www.seeedstudio.com/wiki/CAN-BUS_Shield


I can post the library code into here if that helps,

Do you have an email address i can send the .txt file to you to help speed things up?

I hope we are able to conquor this smiley

Rich
24  Using Arduino / LEDs and Multiplexing / Re: TLC5940 Changine to Bit Banging and Move Blank Pin???? on: November 22, 2012, 04:34:33 pm
I'm sorry but I'm not quite knowledgeable enough on this to understand how to make the changes,
Are you willing to give me step by step instructions?

Many thanks

Rich
25  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 22, 2012, 04:30:34 pm
This is the issue that I found,
I very much appreciate your efforts on this , as a breakthrough would mean very much.

The MCP library is the one from the Seeduino wiki site.
I will post a link tomorrow morning,

It looks like it uses the standard SPIN library supplied with the Arduino IDE,
Which is why I thought it would be easier to chance the TLC library,

I really appreciate your help so far,

Rich
26  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 22, 2012, 10:55:31 am
Oh and the MCP CAN chip also uses D13 smiley sorry

Rich
27  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 22, 2012, 10:51:03 am
this is the link to the library,

http://code.google.com/p/tlc5940arduino/

The MCP CAN chip uses

D2
D10
D11
D12

for the SPI interface

We have changed the operation of the TLC to BIT_BANG as mentioned in the TLC_config file so as it wont slow down the SPI bus for the CAN Chip,

So What i want to do is move the BLANK pin function to D5 which is PWM capable,

I am a relatively novice code writer and i ended up lost and confused when it got to library level changes,

I really appreciate this help

Rich
28  Using Arduino / Networking, Protocols, and Devices / Re: Running 2 serial devices from an Arduino? CAN chip and TLC5940 on: November 22, 2012, 10:30:42 am
Ah i see,

The issue i have, is that D10 on the UNO board is being used as a CS pin from the SPI library on the CAN chip, whereas d10 is being used as a BLANK signal on the TLC chip, would this not interfere with eachother?

The TLC doesnt seem to require an SS signal?? or am i being silly?

Thanks for the advice

Rich
29  Using Arduino / LEDs and Multiplexing / Re: TLC5940 Changine to Bit Banging and Move Blank Pin???? on: November 22, 2012, 09:40:26 am
ok, so i have greyed out the

/**#define set_XLAT_interrupt()    TIFR1 |= _BV(TOV1); TIMSK1 = _BV(TOIE1)

and

/**#define enable_XLAT_pulses()    TCCR1A = _BV(COM1A1) | _BV(COM1B1)

in the Header File , correct?

i have placed the new XLAT setup in the void setup after TLC.init90 as shown below??

Code:


#include "mcp_can.h"
#include <SPI.h>
#include <stdio.h>
#define INT8U unsigned char

INT8U Flag_Recv = 0;
INT8U len = 0;
INT8U buf[8];
char str[20];

#include "Tlc5940.h"  // LED DRiver chip Library

int i = 0;

int redArray[] = {0,3,6,9,12,15,18,21};  // Red LED Array
int greenArray[] = {1,4,7,10,13,16,19,22};  // Green LED Array
int blueArray[] = {2,5,8,11,14,17,20,23};  // Blue LED Array
int maskBit = 1;





void setup()

{
    Tlc.init();                              // Initialise TLC LED Driver Chip
     TIFR1 |= _BV(TOV1);
     TIMSK1 = _BV(TOIE1);

   
    CAN.begin(CAN_500KBPS);                   // init can bus : baudrate = 500k
  attachInterrupt(0, MCP2515_ISR, FALLING); // start interrupt
       
}


void MCP2515_ISR()
{
     Flag_Recv = 1;
}


void loop()

{
 
   Flag_Recv = 0;                // clear flag
      CAN.readMsgBuf(&len, buf);  // Recieve CAN Message
     
     
maskBit = 1;  // Start with Bit 00000001


for (i=0; i<8; i=i+1){
 
  if ((255 & maskBit) > 0) {
   
     Tlc.set(redArray [i], 1000);  // Write Red LED Bit ON
     Tlc.set(greenArray [i],0 );  // Write Green LED Bit ON
     Tlc.set(blueArray [i],0 );  // Write Blue LED Bit ON
      Tlc.update();            // Update the LED Driver Chip
     
  }
 
  else{
   
      Tlc.set(redArray [i], 0);     // Write Red LED Bit OFF
       Tlc.set(greenArray [i], 0);  //  Write Green LED Bit OFF
        Tlc.set(blueArray [i], 0);  // Write Blue LED Bit OFF
        Tlc.update();               // Upadte the LED Driver Chip
     
  }
  maskBit = maskBit << 1; // Next Bit to check
}



}





and do i need to change anything on the interupt?

Thankyou soo much for all of your help so far smiley

Rich
30  Using Arduino / LEDs and Multiplexing / Re: TLC5940 Changine to Bit Banging and Move Blank Pin???? on: November 22, 2012, 09:24:34 am
OK, so i will stick

#define set_XLAT_interrupt()    TIFR1 |= _BV(TOV1); TIMSK1 = _BV(TOIE1)

into the void setup() part of my main code where i do the

TLC.init()

, then Gray out what i have mentioned in my code example?

and what about the last item you mentioned, (TIMER1_OVF_vect)").

Really appreciating the help,

Rich
Pages: 1 [2] 3 4