tlc5940

Salve a tutti, oggi mi sono arrivati i tlc5940 dalla texas instruments, ma una volta collegato e caricata la libreria, quando cerco di fare un upload (di qualsiasi esempio) mi vengono dati numerosi messaggi d'errore e l'upload non avviene. E' un problema della libreria? Uso arduino mega 1280 e l'ide 1.0.1, 022 e 015

Ciao (e grazie...), potresti postare il link alla libreria, lo sketch che usi (almeno parziale) e gli errori che ti restituisce? certamente sarà possibile avere le idee più chiare, così come lo scrivi solo un mago (o Uwe) potrebbe dirti qualcosa. La versione 015 è piuttosto vecchierella, come mai la usi ancora? credo che tra 0022 e 1.0.1 dovresti riuscire a far girare tutto l'esistente ad oggi.

no, la 015 l’ho installata sul mio fedele mac per vedere se la libreria funzionava almeno su quella! normalmente uso la 1.0.1.
cmq la libreria che uso è questa: http://code.google.com/p/tlc5940arduino/
il codice è:

/*
    Analog 0-2 (PORTC) is hooked to a 3:8 line decoder (74LS138) which pull the
    Base of a PNP darlington (MPSA63) low through a 10k resistor for each row.
    +5V is connected to the Emitter of the PNP's, and all the anodes (+) of the
    leds for each row are connected to the Collector.
    
    Currently I'm trying to fix timing issues by putting some D-type positive
    edge triggered latches between PORTC and the 3:8 line decoder, clocked on
    the rising edge of XLAT, but this doesn't seem to help.  I'm bringing the
    circuit in to the logic analyzer this weekend to see exactly when the ISR
    runs and how long it takes to shift in the GS data.
    
    Alex Leone, 2009-04-30
*/

#define  NUM_TLCS  3
#define  NUM_ROWS  8
#include "Tlc5940Mux.h"

#define SERIAL_BAUD  57600L
#include "FastSerial.h"

#define  SERIAL_VERSION 'a'

volatile uint8_t isShifting;
uint8_t shiftRow;

ISR(TIMER1_OVF_vect)
{
  if (!isShifting) {
    disable_XLAT_pulses();
    isShifting = 1;
    sei();
    TlcMux_shiftRow(shiftRow);
    PORTC = shiftRow++;
    if (shiftRow == NUM_ROWS) {
      shiftRow = 0;
    }
    enable_XLAT_pulses();
    isShifting = 0;
  }
}

void setup()
{
  DDRC |= _BV(PC0) | _BV(PC1) | _BV(PC2);
  TIMSK0 = 0; // turn off millis()
  serial_init();
  TlcMux_init();
}

void loop()
{
  if (serial_available()) {
    uint8_t c = serial_read();
    switch (c) {
      case 'm':
      {
        while (!serial_available())
          ;
        uint8_t row = serial_read();
        uint8_t *p = tlcMux_GSData[row];
        uint8_t * const end = p + NUM_TLCS * 24;
        while (p < end) {
          while (!serial_available())
            ;
          *p++ = serial_read();
        }
      }
        break;
      case 'M':
      {
        while (serial_available() < 4)
          ;
        uint8_t *p = tlcMux_GSData[0] + (uint16_t)((serial_read() << 8)
                                                   | serial_read());
        uint8_t * const end = p + (uint16_t)((serial_read() << 8)
                                                   | serial_read());
        while (p < end) {
          while (!serial_available())
            ;
          *p++ = serial_read();
        }
      }
        break;
      case 'C':
        TlcMux_clear();
        break;
      case 'c':
        while (!serial_available())
          ;
        TlcMux_clearRow(serial_read());
        break;
      case 'a':
        break;
      case 'i':
        serial_write(SERIAL_VERSION);
        serial_write(NUM_TLCS);
        serial_write(NUM_ROWS);
        serial_write(TLC_CHANNEL_TYPE_STR);
        break;
      case 's':
      {
        #if TLC_CHANNEL_TYPE_STR == '1'
        while (serial_available() < 4)
          ;
        uint8_t row = serial_read();
        uint8_t channel = serial_read();
        #else
        while (serial_available() < 5)
          ;
        uint8_t row = serial_read();
        uint16_t channel = serial_read() << 8 | serial_read();
        #endif
        uint16_t value = serial_read() << 8 | serial_read();
        TlcMux_set(row, channel, value);
      }
        break;
      case 'S':
      {
        while (!serial_available())
          ;
        uint8_t row = serial_read();
        for (TLC_CHANNEL_TYPE channel = 0; channel < NUM_TLCS * 16; channel++) {
          while (serial_available() < 2)
            ;
          uint16_t value = serial_read() << 8 | serial_read();
          TlcMux_set(row, channel, value);
        }
      }
        break;
      case 't':
      {
        while (serial_available() < 2)
          ;
        uint16_t value = serial_read() << 8 | serial_read();
        TlcMux_setAll(value);
      }
        break;
      case 'T':
      {
        while (serial_available() < 3)
          ;
        uint8_t row = serial_read();
        uint16_t value = serial_read() << 8 | serial_read();
        TlcMux_setRow(row, value);
      }
        break;
      case 'g':
      {
        #if TLC_CHANNEL_TYPE_STR == '1'
        while (serial_available() < 2)
          ;
        uint8_t row = serial_read();
        uint8_t channel = serial_read();
        #else
        while (serial_available() < 3)
          ;
        uint8_t row = serial_read();
        uint16_t channel = serial_read() << 8 | serial_read();
        #endif
        uint16_t result = TlcMux_get(row, channel);
        serial_write((uint8_t)(result >> 8));
        serial_write((uint8_t)(result));
      } 
        break;
      case 'G':
      { 
        while (!serial_available())
          ;
        uint8_t row = serial_read();
        for (TLC_CHANNEL_TYPE channel = 0; channel < NUM_TLCS * 16; channel++) {
          uint16_t result = TlcMux_get(row, channel);
          serial_write((uint8_t)(result >> 8));
          serial_write((uint8_t)(result));
        }
      } 
        break;
      default:
        serial_write('e');
        break; 
    }
    serial_write(c);
  }
}

e questi sono gli errori:

In file included from /Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_config.h:74,
                 from /Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:25,
                 from Serial.cpp:18:
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/pinouts/chip_includes.h:84:2: error: #error "Unknown Chip!"
In file included from /Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:26,
                 from Serial.cpp:18:
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h: In function 'void TlcMux_shift8_init()':
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:51: error: 'TLC_MOSI_DDR' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:51: error: 'TLC_MOSI_PIN' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:52: error: 'TLC_SCK_DDR' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:52: error: 'TLC_SCK_PIN' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:53: error: 'TLC_SS_DDR' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:53: error: 'TLC_SS_PIN' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/tlcMux_shift8.h:55: error: 'TLC_SCK_PORT' was not declared in this scope
In file included from Serial.cpp:18:
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h: In function 'void TlcMux_init(uint16_t)':
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:60: error: 'XLAT_DDR' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:60: error: 'XLAT_PIN' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:61: error: 'BLANK_DDR' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:61: error: 'BLANK_PIN' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:62: error: 'GSCLK_DDR' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:62: error: 'GSCLK_PIN' was not declared in this scope
/Users/cesare/Documents/Arduino/libraries/Tlc5940Mux/Tlc5940Mux.h:71: error: 'BLANK_PORT' was not declared in this scope

Stai usando l'ultima versione beta? perché non provi quella definitiva del 2009 con la 0022 o almeno la r014 con la 1.0.1?

si, x essere sicuro ho riscaricato dal sito l'ultima versione, al massimo poco male, erano samples 8)

Cosa stai pilotando con i TLC? Perché usi la liberia pe il multiplexing dei TLC? Ciao Uwe

sto pilotando dei led, ho sbagliato libreria? :fearful: se si, quale è quella giusta? 8)

http://code.google.com/p/tlc5940arduino/downloads/list Devi fare un unzip della cartella Tlc5940 nella cartella arduino/libraries/ (vale per windows) La libreria deve essere nella cartella di uguale nome percui arduino/libraries/Tlc5940/Tlc5940.h

Ciao Uwe

avevo scaricato questa, ma mi ha dato problemi :~

quali problemi? Ciao Uwe