Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 105
61  Using Arduino / Microcontrollers / Programming a 3.3V device via ISP on: July 22, 2013, 06:07:15 pm
Whenever I program another device through Arduino ISP, I connect the VCC wire to the 5V line and feed that to the target.  But, if the target is a 3.3V device, can I connect VCC to the 3.3V pin on my Arduino, or do I need 5V specifically to program the target?  And if I specifically need 5V, how do I go about programming the target when it has 3.3V components that will go up in smoke when fed 5V?
62  Using Arduino / Programming Questions / SD Card Detect issues ... on: July 21, 2013, 07:06:29 pm
I'm discovering that the 'card detect' switch on my Adafruit breakout board is flaky at best.  It used to work when I first got it but it quickly started to fail.  I'm assuming normal wear takes over after several plug ins and outs, so now I can't rely on it.  Some times it stays engaged when I pull the card out, other times it triggers as soon as I slide a card in the slot, but haven't pushed it all the way in yet.  Some times it just doesn't work unless I wiggle the card a bit.  So, I can't rely on it.  I honestly don't know if it broke inside, or if a pad came loose, it's just hard to look at the internals.

The other thing I also discovered is that the switch engages as I'm pushing the card in.  I was hoping it only triggered when the card is actually locked in place.  So rather than instantly reacting to the switch, I need to somehow build a delay and check it again.  Sort of like a debounce.

So, I have two questions:
a) is it normal for that (internal) switch to fail over time?
b) how else can I do a card detect, maybe through software?
63  Using Arduino / LEDs and Multiplexing / Re: Super Low Price LPD8806 RGB LED Strips - Want? on: July 21, 2013, 05:56:53 pm
I spent yesterday making one of the four strips I need for the final unit.  I forgot what it pain it is to solder SMD by hand.  I did the ICs and capacitor on one side, and all the LEDs on the other side using a skillet reflow method.  That meant hand soldering 48 5050 sized LEDs on the other side.  Oy vey.  Not impossible, but trying to align them while soldering just wasn't happening.  But I've also discovered another issue with the lower voltages that I'm using so I'm probably going to get some new boards made for the next revision, as well as using thicker ones.  I went for 0.8mm but they warp a little when I reflowed the ICs on.  So the next revision will have slightly thicker PCB and slightly larger pads on the LEDs side to make soldering just a tad easier ... maybe.  Still trying to figure out how to get the LEDs aligned neatly prior to soldering.  I could do it if I was reflowing the LEDs, but then I'll have to hand solder the 12 ICs on the other side.  Not sure what's easier ...

Anyway, with a actual size strip built, I'm able to pretend I'm spinning it (in reality it's on the ground and the camera's spinning, same effect though):



64  Using Arduino / LEDs and Multiplexing / Re: Super Low Price LPD8806 RGB LED Strips - Want? on: July 18, 2013, 04:46:50 pm
Yep.  I have the PCBs and ICs already in hand.  The LEDs were delivered today.  Waiting for the stencils and caps to arrive on Friday and then I'll whip up a custom "string" that has 48 pixels packed together 29cm long.
65  Using Arduino / Microcontrollers / Re: Test environment ... without the hardware? on: July 17, 2013, 04:08:06 pm
Yeah, I've made several application specific clones (with only a few pins broken out), but what I'm doing, which is quite literally writing a test sketch that spits out results to the serial console, I don't need anything broken out to begin with, just the regular FTDI ...
66  Using Arduino / Microcontrollers / Re: Test environment ... without the hardware? on: July 17, 2013, 03:40:28 pm
These things are so inexpensive that it will only set you back the price of a couple of hamburger meals.

If that ...  I'll probably grab one of my custom clones and use that seeing as there doesn't seem to be a software option.
67  Using Arduino / LEDs and Multiplexing / Re: Super Low Price LPD8806 RGB LED Strips - Want? on: July 17, 2013, 03:07:58 pm
I forgot!  I'm driving the strips off of a single 3.7V Li+ battery!  Even though they are, technically, 5V strips, running them at 3.7V (nominal) works just fine.  The battery charges up to 4.2V and discharges down to 3.0V ... though I haven't reached that yet.  After about an hour of running a constant cycle of about 14 images, each being displayed for 5-10 seconds, the battery went from 3.72V to 3.66V.
68  Using Arduino / Microcontrollers / Re: Test environment ... without the hardware? on: July 17, 2013, 03:05:20 pm
That's no different than me grabbing any of my hardware and carrying it with me.  Thing is, we all forget things, and some times I leave things connected to whatever working setup I have.  Sure I can spent a few bucks and get another one (and I will probably just do that and leave it at the office.)  I was just curious if there was a way to set up an environment for testing.

I know that AS6 has a simulator built in which shows what the pins are doing but I haven't played with it much nor do I know if it allows me to do serial outputs like a normal AVR would.
69  Using Arduino / General Electronics / Re: Options for inexpensive PCB assembly on: July 17, 2013, 02:23:39 pm
Single or double sided?

I've helped other forum members with single sided designs.  They provide all the materials and I'll reflow the boards.
70  Using Arduino / Microcontrollers / Test environment ... without the hardware? on: July 17, 2013, 02:18:21 pm
Sorry if the subject line is a bit ... fuzzy.  But, today's a perfect example of this issue.  All of my hardware is at home, and I have an idea that I need to code up and test.  However, there's no way to run a simple test sketch without having an actual board connected.  So my question is: is there a way to write a sketch that just does simple serial prints, compile and run it on the local machine without needing to upload it to a board?  Sort of a test environment for the AVR?

It probably seems silly to run something that would, technically, require the board to work, but other than having multiple boards, both at home as well as at the office, I can't think of any other way of doing this.  All I need is a way to output serial .print()s to the console for testing.  Don't need any of the AVR hardware to do anything.
71  Using Arduino / LEDs and Multiplexing / Re: Super Low Price LPD8806 RGB LED Strips - Want? on: July 17, 2013, 01:51:39 pm
Do we get an extra reel by posting a review?  LOL!  j/k Ryan!

I did not pay (much) attention to the actual specs on the strips.  They're not coated!  Nor do they have a sleeve (this was mentioned in the original post, I just read right over it.)  So they are what I would call 'bare' strips.  This is important if you plan on using these outdoors or without any kind of enclosure.  Other than that, they're 48 pixels per meter (which worked out perfect for my R&D process).  Detaching them at the solder joints is a tad tricky.  You can cut where indicated, but if you want to cut an actual solder joint, you're not left with a whole lot to solder onto afterwards, so I always detach the joints themselves.  This one is a bit tricky because the solder pads are tiny circles and they stack them on top of each other at the ends.  So the best way I could do that was to insert a thin set of fine tipped straight tweezers in between the layers right around the solder joint and as I heated it up, gently push the tweezers in and separate the layers.  This leaves both the top and bottom pads intact and ready to have wires soldered back on them.  Some strips have larger pads and they're soldered side-by-side making it easier to simply cut the joint.  This one has the edges on top of each other.  But once separated, it's easy to get wires back on.  Another thing to keep in mind, especially for those who have dealt with WS28x strips before, VCC and GND are next to each other on these.  The WS2801 strips I have are different in that VCC and GND are on the outside with CLK and DATA in the middle.  I actually prefer that as there's a much smaller chance of accidentally creating a solder bridge between VCC and GND.  On the plus side, it has two GND pads which makes for a stronger, more secure connection.  I wish they did the same for the VCC pad but alas.  That's it, strips work beautifully.

So my reason for getting one was two fold.  On the one hand, I wanted to make sure I wasn't doing something wrong versus the WS2801 strips I have being just too slow for what I am wanting to do.  On the other hand, I just wanted another IC to play with.  I've always only worked with the WS28xx series ICs and strips so why not.  I already had a sneaking suspicion that it was the WS2801 strip (note, 2801, not 2812, although their speed is the same) but I needed to make sure.  And rather than waiting 2 weeks for my vendors in Shenzhen to send a test reel to me, Ryan, you were a savior here.

So, I'm working on a custom, full color POV system, like a poi baton.  Most, if not all of the stuff I see have static patterns and are limited in color, mainly because everyone stores it in memory of which there isn't a whole lot to begin with.  So my system stores images on a uSD card.  The program then reads each individual column of the image and pushes the data out to the string, constantly.  At 48 pixels tall, I just need three bytes, r, g, and b.  So I read in a total of 144 bytes (48 pixels) each time and push it to the string, then read the next 144 bytes, etc., etc.  The only delay is with the uSD itself.  On average, it takes 108 usecs to read 144 bytes (out of cache) and about 1250usecs every 4th read to refill the cache.  Plenty of time to goof around with.

Turns out, I was right, the WS2801 is simply too damn slow.  Here's what the WS2801 strip would do when I tried to push data to it at full blast:


And this is what it's supposed to look like.  This is running on the LPD8806 IC:


Now, I could've just as easily slowed the process down on the WS2801.  It would take almost a full 2.5ms to get it to work right.  Add the 1.2ms from the uSD and I was looking at close to 4ms for each update on the string.  That was way too long.

I've now switched to an LPD8806 design and thanks to the strip that Ryan sent, I was able to both confirm my suspicion as well as continue development.  Here are some other images taken using the LPD8806 strip:







72  Using Arduino / Storage / Re: Error feedback on: July 16, 2013, 11:32:16 pm
You should never have a card or volume object in a sketch that has a SdFat object.

This code:
Code:
if (!card.init(SPI_FULL_SPEED, SdChipSelect)) {
    myError = 3;
  }

  if (!volume.init(&card)) {
    myError = 4;
  }

Should not be in a sketch that has this call:
Code:
 if (!sd.begin(SdChipSelect, SPI_FULL_SPEED)) {
    myError = 5;
  }

The sd.begin() call initializes its own internal card and volume object.
Ok, that, I did not know.  Thanks for the lesson.


The best way to diagnose sd.begin() problems is to use this form:
Code:
 if (!sd.begin(chipSelect, SPI_HALF_SPEED)) sd.initErrorHalt();
... snip ...

sd.initErrorHalt() will attempt to print a detailed message about the error.  sd.initErrorHalt() calls sd.initErrorPrint() shown below.
Right, but the final unit will not have any way to print anything to a serial line.  This is why I'm using an LED as indicator.  Without the other two catches, it makes things simpler.  Either it initializes or not, and the next two catches will be for actual file access.

Thanks!
73  Using Arduino / Storage / Error feedback on: July 16, 2013, 04:47:41 pm
In an attempt to give the user feedback on possible failures, I have tagged each possible point of failure with an error code which I then use later on:
Code:
void setup() {
  if (!card.init(SPI_FULL_SPEED, SdChipSelect)) {
    myError = 3;
  }

  if (!volume.init(&card)) {
    myError = 4;
  }

  if (!sd.begin(SdChipSelect, SPI_FULL_SPEED)) {
    myError = 5;
  }
}

Problem is, I don't know when any of them would actually trigger.  In the sketch loop, I have this:
Code:
  while (myError) {
    if (millis() - lastRun > pause) {
      if (!digitalRead(errorLED)) {
        digitalWrite(errorLED, HIGH);
        pause = 150;
      } else {
        digitalWrite(errorLED, LOW);
        if (myError > 1) {
          cntr++;
          if (cntr >= myError) {
            cntr = 0;
            pause = 750;
          }
        }
      }
      lastRun = millis();
    }
  }

That works.  If I manually set the error code, the LED flashes accordingly, continuous or 2 up to 5 times depending on what I set it to.  However, in real life, when would any of the codes 3, 4, or 5 trigger?

First test, I didn't insert the card: it errored out with code 5.
Second test I completely removed the uSD from the circuit.  It errored out with code 5.
Third test, I only removed the SS connection: it errored out with code 5.
Fourth test, I only removed MOSI: it errored out with code 5.
Fifth test, I only removed the SCK line: it errored out with code 5.

Sooo at what point would it trigger code 3?  And would code 4 trigger if the card was formatted in something other than FAT16/32?
74  Using Arduino / Storage / Re: Open file read from a list on: July 16, 2013, 04:15:58 pm
Quote
I'm assuming I then pass 'line' directly to .open() ?
Yes, if each line contains only the file name.

They will be, I'm the one creating that file.  Though I'm still trying to decide if I want to add other parameters to that file (in which case each line will have markers separating the parameters), or do something else.  Still playing with it ...

I'm still pondering moving away from pre-processing image files and using 24-bit BMP files.  That would be the only reason to add parameters to the control file as the BMP file contains the other necessary information I need such as width and height.  Meh, we'll see.
75  Using Arduino / Storage / Re: Can't do subsequent reads from SD card on: July 16, 2013, 04:06:44 pm
Only thing I can think of is that you're lopping through it so fast that SD itself can't keep up and fails.  Try adding a delay so it only runs every 1/4 second for example, or every second, or however long between when you close the file and when you re-open it again.
Code:
volatile long lastRun;

void setup() { ... }

void loop() {
  if (millis() - lastRun > 250) {   // run every 1/4 second
    myFile = SD.open(...);
    if (myFile) {
       ...
    } else {
       ...
    }
    lastRun = millis();
  }
}
   
Pages: 1 ... 3 4 [5] 6 7 ... 105