Show Posts
Pages: 1 ... 404 405 [406] 407 408 ... 586
6076  Community / Bar Sport / Re: Ardnano, world's smallest Arduino? Just for fun. on: August 24, 2011, 12:12:00 am
Sorry, it's a 1206 SMD LED.

_____
Rob
6077  Community / Bar Sport / Re: Ardnano, world's smallest Arduino? Just for fun. on: August 23, 2011, 09:19:25 pm
Collecting some of the above ideas...change to a tiny85 so it's even smaller, then how about a tri-colour LED and a presence sensor (IR?), configured to plug together in an XY matrix.

As you wave your hand around the display the LEDs follow, maybe nodes that are just seeing the hand for the first time are red with a fast fade-in time, they turn to yellow or green while the hand is being detected then as the hand passes the LEDs change colour to blue and fade slowly.


______
Rob
6078  General Category / General Discussion / Re: Dual Core 168 Arduino on: August 23, 2011, 08:19:20 am
Jeez Bob, you've got way too much time on your hands smiley

______
Rob
6079  Community / Bar Sport / Re: Ardnano, world's smallest Arduino? Just for fun. on: August 23, 2011, 08:17:25 am
Quote
It hasn't any real uses..
Of course it does, it can flash a LED at different rates according to an as-yet undefined serial protocol smiley

______
Rob
6080  Topics / Product Design / Re: How long should a project take? on: August 23, 2011, 07:57:25 am
We used to have a "two, two and a half" rule.

Everything would...

Take twice as long as you thought
Cost twice as much as you thought
Earn half as much as you thought

Take this and use it well grasshopper smiley

______
Rob
6081  Community / Bar Sport / Ardnano, world's smallest Arduino? Just for fun. on: August 23, 2011, 07:47:57 am
There have been a lot of threads lately about the smallest Arduino so I though I'd knock up a simple design to see how small I could get.

Now bear in mind this is not a serious design (that's why I've posted in Bar Sport) but it should work and to keep it slightly real I decided the design should be programmable (using an FTDI cable) and perform at least one useful function, and that is talk to a serial line and flash a LED.

Here are two pics of the board





Doesn't look that small eh? How about a life size pic of the layout



It's .45" or 11.4mm square, and breadboard friendly to boot smiley

As you can see the limiting factor is the 328 chip itself...oooo hang on, they do it in an MLF package.

______
Rob

6082  Using Arduino / Project Guidance / Re: Arduino production and assembly company on: August 22, 2011, 07:26:30 pm
You can get pro-quality boards done very cheaply from all manner of people. For example at PCBcart a Mega-sized board will cost you a $56 setup cost and $32 for 1 board, but only $2 each for 50 off.  So that's $156 all up for 50 boards.

That sort of price is well in the range of most people, and you get a pro board with 8/8mil geometries, solder resist, screen printing and SMDs on both sides etc.

______
Rob
6083  Using Arduino / Project Guidance / Re: help with measure speed of object. photo-interrupter on: August 22, 2011, 10:57:04 am
Yep, it depends on what else is going on, the approach used in any one application depends on a lot of things. I guess that's why we get the big bucks smiley

SBIS/SBIC, I'd forgotten about them.

______
Rob
6084  Using Arduino / Project Guidance / Re: help with measure speed of object. photo-interrupter on: August 22, 2011, 08:13:21 am
Quote
Polling requires that you happen to look at the pin just after (nanoseconds after) the signal change occurs.
Only if you do it like the OP was, as part of a massive function that twiddled everything else and it's brother.

If you do nothing else but look at a pin the code would look something like this (appolgies if it's not right, I haven't done much assembly lately)

Code:
loop:
in     r16,PINB   // 1 cycle
        andi  r16,1       // 1 cycle
        breq  loop        // 1 cycle if false, 2 if true
// pin has gone high, we can do useful stuff here
 

so the worst case is when the pin goes high just on the "in" instruction, in this case the latency is 4 cycles or ~262nS. Now lets look at an interrupt,

Code:
// pin goes high
// indeterminate delay because we don't know what instructions were in progress
// then save context
push PC      // each push is 2 cycles
push r0
in   r0,SREG
push r0
push r1
push r2
push r3
push r4
push r5
push r6
push r7
push r9
push r10
push r11
push r12
push r13
push r14
push r15
push r16
push r17
push r18
push r19
push r20
push r21
push r22
push r23
push r24
push r25
push r26
push r27
push r28
push r29
push r30
push r31
jmp isr_func
// now we can do some useful work

The AVR has bugger-all hardware support for context switching so it has to push a lot of registers, in this case about 70 cycles or 4.5uS. OK I'm stretching it a bit here I suppose, the compiler probably doesn't push all the regs, but it's going to push a few and you have no idea how many.

I think you can reduce the latency (and certainly help the determinism) by having a do-almost-nothing loop

Code:
do {} while (myFlag);


ISR  xx () {
   myFlag = false;
}

And maybe add ISR_NAKED to the ISR definition and handle the regs yourself and probably other things that make sure there aren't too many registers being used.

I still don't think you'll get as fast as a tight polling loop.

Also I qualified my comment with

Quote
at least if interrupts are used with Arduino functions

If you use attachInterrupt() you add a whole new layer of code to the latency.

______
Rob
6085  General Category / General Discussion / Re: Dual Core 168 Arduino on: August 22, 2011, 12:35:54 am
I admit there's no design integration challenge, but you still use C/C++ and the high speed stuff is all internal.

I've been studying the LPCs for a project, a huge amount of grunt for a chip that's just as easy (even easier in some respects) than the typical AVR we talk about here. Frankly as far as I can see it's just the Arduino/AVRfreaks communities that make it worth using 8-bit AVRs at all.

______
Rob
6086  General Category / General Discussion / Re: Dual Core 168 Arduino on: August 22, 2011, 12:13:23 am
Yeah Cypress make some really nice (and expensive) gear in this area, I'm always loved this sort of setup and used to work with a Z8000/bit-slice processor dual board, but the truth is I can see absolutely no reason to do this sort of thing these days at most levels when you can buy a 50MHz LPC 32-bit processor for $1.50. Lash out and spend $2.50 and you get 100MHz and every peripheral known to modern man smiley

______
Rob
6087  Using Arduino / Project Guidance / Re: help with measure speed of object. photo-interrupter on: August 22, 2011, 12:01:33 am
You have about 3mS between pulses then, not bad but not a lot of time either.

As the code stands though you haven't got a chance, at the very least those Serial.prints will block the program forever.

You should separate the acquiring of data from the processing of it. Don't Serial.print or play with LEDs, just get data, Then you can muck around.

Personally I think you'll need the external comparators (or maybe just schmitt triggers), I doubt the analogRead() is fast enough (but maybe). Anyway do something like this.

Code:
#define N_OBJECTS 10
unsigned long times1 [N_OBJECTS];
unsigned long times2 [N_OBJECTS];
unsigned long * ptr1;
unsigned long * ptr2;
byte count;
byte  last_input1, last_input2;


ptr1 = times1;
ptr2 = times2;
count = 0;

do {
   if (input1 != last_input1 && input1 = HIGH) {
      // leading edge on 1
      *ptr1++ = micros();
      count++;
      last_input1 = input1;
   }

   if (input2 != last_input2 && input2 = HIGH) {
      // leading edge on 2
      *ptr2++ = micros();
      count++;
      last_input2 = input3;
   }
} while (count < N_OBJECTS * 2);

// now process time array

NOTE: Far from working code, just the idea.
_____
Rob
6088  Using Arduino / Project Guidance / Re: help with measure speed of object. photo-interrupter on: August 21, 2011, 10:35:44 pm
Polling is faster and more deterministic than interrupts (well at least if interrupts are used with Arduino functions).

However we're still waiting for the design brief smiley

______
Rob
6089  Using Arduino / Programming Questions / Re: Here's a very simple way of randomly seeding rand() on: August 21, 2011, 10:18:16 pm
We've all been there smiley, have a look at this thread.

http://arduino.cc/forum/index.php/topic,66206.msg502878.html#msg502878

______
Rob
6090  Using Arduino / Project Guidance / Re: help with measure speed of object. photo-interrupter on: August 21, 2011, 09:34:24 pm
As Grumpy says though, without knowing the speed and resolution required all ideas are moot.

______
Rob
Pages: 1 ... 404 405 [406] 407 408 ... 586