Cannot get DotStar working with ItsyBitsyM4

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

I have an https://www.adafruit.com/product/3800and a

Code: Select all

https://www.adafruit.com/product/2437
connected. I have tested the dotstar on my Uno w/ Neopixel library and it works correctly. I have also installed all the libraries for the IstsyBitsy M4 and have run blink to verify that it works correctly. (BTW, yes I have a 5V 5A power supply connected separately to the Dotstar with common ground between it and my IstsyBitsyM4.)

I'm now trying to get the sketch for the IstsyBitsy and Dotstar "ItsybitsyM4Onboard" to work and I cannot. I have it hooked up with all the defaults with the exception "NUMPIXELS 144" and have my Data hooked up to A2 and the clk hooked up to A5 as shown here in this https://app.box.com/s/svid2y97lnu7n3pzzeef7wvltvop6pdi.

this is the default example sketch from the library:

Code: Select all

// An example demonstrating how to control the Adafruit Dot Star RGB LED
// included on board the ItsyBitsy M4 board.

#include <Adafruit_DotStar.h>

// There is only one pixel on the board
#define NUMPIXELS 144

//Use these pin definitions for the ItsyBitsy M4
#define DATAPIN    8
#define CLOCKPIN   6

Adafruit_DotStar strip(NUMPIXELS, PIN_DOTSTAR_DATA, PIN_DOTSTAR_CLK, DOTSTAR_BRG);

void setup() {
  strip.begin(); // Initialize pins for output
  strip.setBrightness(80);
  strip.show();  // Turn all LEDs off ASAP
}

void loop() {
  rainbow(10);             // Flowing rainbow cycle along the whole strip
}



// Rainbow cycle along whole strip. Pass delay time (in ms) between frames.
void rainbow(int wait) {
  // Hue of first pixel runs 5 complete loops through the color wheel.
  // Color wheel has a range of 65536 but it's OK if we roll over, so
  // just count from 0 to 5*65536. Adding 256 to firstPixelHue each time
  // means we'll make 5*65536/256 = 1280 passes through this outer loop:
  for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {
    for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
      // Offset pixel hue by an amount to make one full revolution of the
      // color wheel (range of 65536) along the length of the strip
      // (strip.numPixels() steps):
      int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
      // strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or
      // optionally add saturation and value (brightness) (each 0 to 255).
      // Here we're using just the single-argument hue variant. The result
      // is passed through strip.gamma32() to provide 'truer' colors
      // before assigning to each pixel:
      strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
    }
    strip.show(); // Update strip with new contents
    delay(wait);  // Pause for a moment
  }
}
When I compile and upload, nothing happens. I have read other posts on this forum that the Clock and Data pins might be confused? Any help would be appreciated

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Cannot get DotStar working with ItsyBitsyM4

Post by adafruit_support_bill »

have my Data hooked up to A2 and the clk hooked up to A5
These are not the same as the pins defined in your code:

Code: Select all

//Use these pin definitions for the ItsyBitsy M4
#define DATAPIN    8
#define CLOCKPIN   6
And since you are using a 3.3v processor, you will probably need a level-shifter as described in the guide:
https://learn.adafruit.com/adafruit-dot ... ep-3004674

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Hi Bill,

First off that is not my code but Adafruit's default example for the two pieces of hardware that I'm using (ItsyBitsyM4 and the dotstars) so wondering why it shouldn't just work? Second, the link you referred me to send me to the page on hooking up dotstars to different boards. If you are referring to https://www.adafruit.com/product/1787 you are saying that in order to use my itsybitsy I need to have additional hardware to do this?

Also, If I have my data and Clk pins incorrect, what do pin 8 and pin 6 map to on the actual pins of the Itsy M4?

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Data hooked up to A2 and the clk hooked up to A5

I made this assumption based on the Pinout of the IstyBitsyM4 which has PB08 as A2 for my data pin and PB06 as A5 for my clock. I'm a newbie to this board and Pin mapping to these boards has always confused me, please be patient with me.

Thanks in advanced

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Is this the way that I should be hooking up my Itsy Bitsy M4 for Data as pin 8 (SDA) and Clock as pin 6 (SCL)

https://app.box.com/s/pxoe4a9qdmkc2yagt6wht1ugv8ad50l6

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Cannot get DotStar working with ItsyBitsyM4

Post by adafruit_support_bill »

The ItsyBitsy is a compact board and does not have room to bring out all of the processor's pins. So you need to work with the ones that are there. For Arduino IDE programming, the pin names are as labeled. You need to make your code match your wiring.

SDA and SCL are special purpose pins for use with i2c devices. However, they can also be used as general purpose I/O (GPIO) pins.

Since the M4 is a 3.3v device, all of its I/O pins operate at 3.3v logic levels. For Dotstars, Neopixels and many other devices that expect 5v signals, this requires some level shifting.

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Hi Bill,

Does both the clock and data pins need to be level shifted to 5V or just the data pin? Also, the Itsybitsy M4 adafruit document states that pin 5 is a special pin that is level shifted and can be used for the Dotstar Data pin?:
#5 - GPIO #5. This is a special OUTPUT-only pin that can PWM. It is level-shifted up to Vhi voltage, so its perfect for driving NeoPixels that want a ~5V logic level input. You can use this with our NeoPixel DMA control library to automatically write NeoPixel data without needing any processor time.

I do plan on eventually using the Neopixel DMA control, but first just want to get my dotstar strip working.

As far as my pinout confusion, what's difficult is that there is no labeled pin 6 or 8 (for the reasons you've stated on the ItsyBitsy M4 so its difficult to know what is the actual GPIO pin on the board map to those definitions for the dedicated Dotstar clock (pin 6 - PB02 - D6) and the data (pin 8 - PB03 - D8). I'm assuming that the following image below from the Adafruit guide identifies these pins as "A0" as the data pin 8 and "SCK" as the clock pin 6 - could you verify?
https://app.box.com/s/ww5lg3ysx615lj1ff7lvgaimr3zz4e3k

BTW, a neopixel strip that I have works just fine with my Itsybitsy, just not the Dotstar - perhaps for the level shift issue?

Thanks for your time

Mark

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

As far as the ItsyBitsy M4 pinout diagram, what is not clear to me is how do you find pin 8 and pin 6 in the following diagram when it is not shown:
https://app.box.com/s/beahxri01sc5g5qwbil3qfkhnl9cpopl

Forgive my ignorance but I've only worked with Uno and Metro boards and am not familiar with pin remapping of some of these smaller boards. I also have a question about the upper right top of the diagram as I highlighted here with a red box:
https://app.box.com/s/5p18a02vo2ortyi6lc92r2ts39so47ys
what is this indicating where these pins are on the board?

thanks in advance

Mark

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Cannot get DotStar working with ItsyBitsyM4

Post by adafruit_support_bill »

Does both the clock and data pins need to be level shifted to 5V or just the data pin? Also, the Itsybitsy M4 adafruit document states that pin 5 is a special pin that is level shifted and can be used for the Dotstar Data pin?:
#5 - GPIO #5. This is a special OUTPUT-only pin that can PWM. It is level-shifted up to Vhi voltage, so its perfect for driving NeoPixels that want a ~5V logic level input. You can use this with our NeoPixel DMA control library to automatically write NeoPixel data without needing any processor time.
Neopixels and Dotstars are not the same thing. Neopixels require only one pin for data. There is no clock. Dotstars require both a clock and data pin. You can use the 'special' pin for either clock or data on the Dotstars. But you will need another pin with level shifting applied.
As far as the ItsyBitsy M4 pinout diagram, what is not clear to me is how do you find pin 8 and pin 6 in the following diagram when it is not shown:
They are not shown because they are not brought out to the edge. They are connected locally to the on-board pixel.

For Arduino usage, use the "Arduino names". These are the dark green labels as indicated in the legend.
Image
I also have a question about the upper right top of the diagram as I highlighted here with a red box:
These are the "QSPI pins. These are connected to the flash chip and, as described on the pinout page, are not brought out to the edge.

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Thank you Bill - this explains a lot. I have a SN74AHCT125N on order.

As far as my second question about pin identification, If I am to use the dark green as arduino identifcation, the arduino pin "8" and "6" in the upper right of the diagram - where are these pins actually on the M4 board? Are these shared/mapped with MOSI pin 25 and SCK pin 24 respectively?

Mark

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Cannot get DotStar working with ItsyBitsyM4

Post by adafruit_support_bill »

These are connected directly to the mini Dotstar pixel on the board. They are not brought out to the edge. The on-board DotStar is powered at 3.3v, so level shifting is not required.

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Oh, okay - that makes sense now…

Thanks

Mark

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Okay, I've installed the level shifter for my clock and I can now successfully operate my Dotstar strip.

New question, I'm now trying to use the DMA example and I have my data on pin 5 but the Adafruit_NeoPixel_ZeroDMA strip(NUM_PIXELS, PIN, NEO_GRB); does not take a clock pin argument. What pin do I hook my clock in (from the dotstar strip) up to on the ItsyBitsy M4 when using DMA?

thanks

Mark

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Cannot get DotStar working with ItsyBitsyM4

Post by adafruit_support_bill »

Neopixels and Dotstars are not the same thing. They have a completely different interface and communication protocol. Adafruit_NeoPixel_ZeroDMA works for Neopixels only.

User avatar
mbiasotti
 
Posts: 74
Joined: Sun Jul 17, 2016 6:27 pm

Re: Cannot get DotStar working with ItsyBitsyM4

Post by mbiasotti »

Okay, thanks for informing me of this. Was hoping that DMA would work with Dotstars also. I may not need the speed of DMA but won't know until I get my sketch completed and working. I went to the itsybitsy for the speed because I'm using a 144 dotstar strip.

thanks

Mark

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”