Announcement

Collapse
No announcement yet.

Connecting multiple Picadillos together

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connecting multiple Picadillos together

    Hi guys

    I am working on a project which requires using 3x Picadillos 35T as if it was a single continuous display.

    One way to go about this would be to just listen to them via Serial Events, which will ultimately result in very messy coding.

    I am no hardware expert but I am guessing this would be achievable via I2C. Any thoughts on good resources I could look into?

    Thanks in advance
    Antonio

  • #2
    I'd be more inclined to down the serial route, not sure why you think it would be messy, a two byte code (one byte 'address', one byte 'command') would be a relatively simple way to ensure all displays could share the same serial port.
    Mark

    Comment


    • #3
      I didn't realize I could share the same serial port between multiple displays. Is there an example of the aforementioned byte code you could indicate? Arduino-based would suffice!

      Thank you so much for the prompt reply.

      Antonio

      Comment


      • #4
        Provided only one device is transmitting (be it one of the three or a separate 'controller') and the rest are receiving (i.e. no 'acknowledge' sequence) everything will be fine

        So the master's TX is connected to all the slaves RXs.

        The master sends something like

        0xaa, 0xnn (Address is aa, use 0xff for an 'all' address, Command is nn either common to all, or different between 'all' address and individual)

        Slaves just listen, receive, decode and action.

        Sorry, no example.
        Mark

        Comment


        • #5
          Yes, serial is probably the easiest route to take at the moment. There have been a few issues around using the PIC32 as an I2C slave (as regards interrupts on stop bits or something, I'm not sure) and the main SPI library doesn't currently support slave mode.

          So stick to serial is best.

          For some inspiration you might like to take a gander at my ICSC library (inter-chip serial communication) which allows you to send small packets of data from one chip to another through RS-232, RS-485, etc: https://github.com/majenkotech/ICSC

          As mark said, if you are only sending from one to receive on many, and those many aren't sending back, you can have multiple devices on one serial connection. Also, the PICadillo has multiple serial ports available should you wish to have full two-way communication between them.

          It could be perfectly feasable, if you're adventurous enough, to craft a "remote" PICadillo virtual TFT driver which communicates with a slave PICadillo over serial. That way one PICadillo could be doing all the display work using an "Aggregator" virtual TFT device to turn the three PICadillos into one single virtual display.

          Comment


          • #6
            Thanks so much for all the valuable pointers.
            I will be tinkering with this over the weekend and keep you posted of progress and/or further questions that may arise.

            All the best
            Antonio

            Comment


            • #7
              Hi guys

              I have been trying to connect the displays via I2C but I am running into some issues which I am assuming is either proprietary language for uecide or pin layout as I tested communication on 2 UNOs and it works just fine. The displays are grounded together, I believe J2 jumpers are in the right position, and SDAs and SCLs are connected together. The reason for me to try this was because i kinda need 2way communication. i.e. if I touch the display on the left most i want the display on the right to know this occured and vice versa

              The test code I tried is below. On the master side, the debug output "1" and "0" just fine, on the slave side it always outputs "0". Any ideas what I am doing wrong? The #device is something I can set manually as per the below example I assume?

              Master:
              Code:
              #include <Wire.h>
              byte x = 0;
              
              void setup()
              {
                Wire.begin(); // Start I2C Bus as Master
                pinMode(PIN_LED1, OUTPUT);
                digitalWrite(PIN_LED1, HIGH);
                Serial.begin(9600);
              }
              void loop()
              {
                
                Wire.beginTransmission(9); // transmit to device #9
                Wire.write(x);              // sends x
                Wire.endTransmission();    // stop transmitting
                x++;
                if (x > 1) x=0;
                delay(2000);
                Serial.println(x);
              }
              Slave
              Code:
              #include <Wire.h>
              
              
              int x;
              
              void setup() {
                Wire.begin(9);                // Start I2C Bus as a Slave (Device Number 9)
                Wire.onReceive(receiveEvent); // register event
                Serial.begin(9600);
              
                pinMode(PIN_LED1, OUTPUT);
                digitalWrite(PIN_LED1, LOW);
                
                x = 0;
              }
              
              void loop() {
                //If value received is 0 blink LED 1
                if (x == 0) {
                  digitalWrite(PIN_LED1, HIGH);
                  delay(2000);
                  //digitalWrite(PIN_LED1, LOW);
                  //delay(2000);
                }
                //If value received is 1 blink LED 2
                if (x == 1) {
                  digitalWrite(PIN_LED1, LOW);
                  delay(200);
                  //digitalWrite(PIN_LED1, LOW);
                  //delay(200);
                }
                
                Serial.println(x);
              }
              
              void receiveEvent(int howMany) {
                x = Wire.read  ();    // receive byte as an integer
              }
              Thanks in advance!
              Attached Files
              Last edited by antpgomes; 22nd July 2014, 10:22 AM.

              Comment


              • #8
                You haven't provided the needed pullup resistors on SCL and SDA. You should have 3.3K (or thereabouts) resistors between those lines and +3.3V. Also, I'm not sure which LEDs you are trying to light - there aren't any user controllable LEDs on the board, other than the backlight (PIN_BACKLIGHT) of the display.
                Last edited by majenko; 22nd July 2014, 10:40 AM.

                Comment


                • #9
                  pinMode(PIN_LED1, OUTPUT); //setting this high or low actually turns the display on/off which is enough to debug

                  Thank you sir, the problem was in fact the pullup resistors (should i say absence of them )

                  Comment


                  • #10
                    Ah yes, I did alias PIN_LED1 to the backlight, so the examples would work right - that was clever of me

                    Glad it's working for you now.

                    Comment

                    Working...
                    X