Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Jaded Burnout
Jul 10, 2004


ante posted:

The 28byj-48 is dirt cheap and internally geared down to 64 steps per revolution I think. e: 64*8 = 512 steps

On Aliexpress there are also a lot of micro-stepper motors designed for the internals of lenses. That seems pretty likely, too.

Nice, thanks.

Adbot
ADBOT LOVES YOU

Spatial
Nov 15, 2007

Not having an inc instruction: :negative:

carticket
Jun 28, 2005

white and gold.

Spatial posted:

Not having an inc instruction: :negative:

What's wrong with adding one? Are you concerned about atomicity?

No Gravitas
Jun 12, 2013

by FactsAreUseless

Spatial posted:

Not having an inc instruction: :negative:

add whatever, 1 ?

Spatial
Nov 15, 2007

Sorry, was half asleep when I posted that. The instruction I was yearning for was inc on a memory location. No such luck on the Cortex M0 though. Load-store all the way, baby.

carticket
Jun 28, 2005

white and gold.

Spatial posted:

Sorry, was half asleep when I posted that. The instruction I was yearning for was inc on a memory location. No such luck on the Cortex M0 though. Load-store all the way, baby.

I doubt the M0 has it but if you need atomicity, you can get it with a LDREX/STREX loop without disabling interrupts. It becomes totally non deterministic if you're going for real time, though.

sailormoon
Jun 28, 2014

fighting evil by moonlight
winning love by daylight


I'm looking for a device to learn embedded programming on and the OP seems to be out of date. Would the Beaglebone Black be the best place to start? It seems like it would be great to do bigger projects on given its specs too.

Slanderer
May 6, 2007

sailormoon posted:

I'm looking for a device to learn embedded programming on and the OP seems to be out of date. Would the Beaglebone Black be the best place to start? It seems like it would be great to do bigger projects on given its specs too.

The Beaglebone Black is great for learning embedded linux systems, but any knowledge learned there wouldn't really carry over to an arduino, for instance. Smaller embedded processors are programmed without the aid of an operating system (usually), and have direct i/o access to all of the hardware. You also generally have a lot less memory, and programs are written differently as a result. So, depending on what you want to do, a Beaglebone Black may or may not be right for you, even if it is much more powerful.

No Gravitas
Jun 12, 2013

by FactsAreUseless

Slanderer posted:

The Beaglebone Black is great for learning embedded linux systems, but any knowledge learned there wouldn't really carry over to an arduino, for instance. Smaller embedded processors are programmed without the aid of an operating system (usually), and have direct i/o access to all of the hardware. You also generally have a lot less memory, and programs are written differently as a result. So, depending on what you want to do, a Beaglebone Black may or may not be right for you, even if it is much more powerful.

Is there something more powerful that the Beaglebone that is still pretty cheap?

The MSP430 kit was good for basic stuff if you don't want too much trouble. Not sure if they still have it, and for sure it isn't 4.30$ + free shipping anymore.

I personally like PIC and anything that Microchip makes, but it isn't exactly newbie friendly. Keep in mind, I build MCU programmer devices for fun.

Slanderer
May 6, 2007

No Gravitas posted:

Is there something more powerful that the Beaglebone that is still pretty cheap?

The MSP430 kit was good for basic stuff if you don't want too much trouble. Not sure if they still have it, and for sure it isn't 4.30$ + free shipping anymore.

I personally like PIC and anything that Microchip makes, but it isn't exactly newbie friendly. Keep in mind, I build MCU programmer devices for fun.

There are probably dev boards with faster ARM processors on them, but I haven't worked with any in the same price range as the Beaglebone. This list is a year outdated, but it may have some options:
http://www.linux.com/news/embedded-mobile/mobile-linux/732197-top-10-open-source-linux-boards-under-200

For smaller stuff, I still really like the Attiny series. They are dead-simple to work with, their peripherals are really easy to get setup, and they are cheap.

One Eye Open
Sep 19, 2006
Am I awake?

Slanderer posted:

There are probably dev boards with faster ARM processors on them, but I haven't worked with any in the same price range as the Beaglebone. This list is a year outdated, but it may have some options:
http://www.linux.com/news/embedded-mobile/mobile-linux/732197-top-10-open-source-linux-boards-under-200

For smaller stuff, I still really like the Attiny series. They are dead-simple to work with, their peripherals are really easy to get setup, and they are cheap.

Somewhere in the middle, you could play with a STM32 F4 Discovery. A 180MHz ARM Cortex-M4 with 8M SDRAM, 2M flash, a 2.4" touchscreen, gyroscope, USB otg for ~£15(from Farnell). That and if you feel like it, you can program it with the .NET micro framework. It's quite fun to play with.

reading
Jul 27, 2013

Slanderer posted:

There are probably dev boards with faster ARM processors on them, but I haven't worked with any in the same price range as the Beaglebone. This list is a year outdated, but it may have some options:
http://www.linux.com/news/embedded-mobile/mobile-linux/732197-top-10-open-source-linux-boards-under-200

For smaller stuff, I still really like the Attiny series. They are dead-simple to work with, their peripherals are really easy to get setup, and they are cheap.

What kind of programmer/debugger do you use to load code and debug on the ATTiny? And I assume you have to use AVRStudio?

Slanderer
May 6, 2007

reading posted:

What kind of programmer/debugger do you use to load code and debug on the ATTiny? And I assume you have to use AVRStudio?

Any sort of AVR programmer--the standard official one is like $30, but there are a ton of clones which are cheaper. In some ways the clones are better, since they were easier to use with AVRDUDE (the open source programming utility). WinAVR used to be the go-to package for programming AVRs without AVRStudio, but that might be abandoned now? Regardless, AVRStudio still works fine if you're on Windows, and it might support clone programmers via AVRDUDE now.

If you can't tell, it's been a few years since I've worked with them.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Purely out of curiosity, have any of you folks ever worked with the RCA 1802?

JawnV6
Jul 4, 2004

So hot ...
I like the idea of a high reliability chip that lets me redefine which register has the PC in software.

Jerry Bindle
May 16, 2003

Slanderer posted:

The Beaglebone Black is great for learning embedded linux systems, but any knowledge learned there wouldn't really carry over to an arduino, for instance. Smaller embedded processors are programmed without the aid of an operating system (usually), and have direct i/o access to all of the hardware. You also generally have a lot less memory, and programs are written differently as a result. So, depending on what you want to do, a Beaglebone Black may or may not be right for you, even if it is much more powerful.

I agree completely with this post. You mentioned you want to learn about embedded programming, so some kind of SBC like the beaglebone would be a good fit. The problem with starting on a smaller platform, like with the MSP430 launchpad, is that you'll wind up spending a lot of time dicking around with hardware to do something interesting. If you don't have a scope or logic analyzer you will have a very difficult time getting things going. The upside with 8 and 16-bit micros is that you can oftentimes just download the vendor-supplied IDE and do a lot of development and simulation without buying any hardware at all.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

JawnV6 posted:

I like the idea of a high reliability chip that lets me redefine which register has the PC in software.

Structuring programs as a series of coroutines that swap out the PC register to interleave tasks appears to be pretty common. The 8-bit ALU/accumulator contrasted with the 16-bit general purpose registers is sort of a pain, though.

carticket
Jun 28, 2005

white and gold.

Internet Janitor posted:

Structuring programs as a series of coroutines that swap out the PC register to interleave tasks appears to be pretty common. The 8-bit ALU/accumulator contrasted with the 16-bit general purpose registers is sort of a pain, though.

Is that in lieu of context frames? You just switch which reg is the PC in your scheduling interrupt (or on a yield I suppose) instead of saving and restoring a context? I haven't done much with coroutines, but they don't have a typical context with their own stack, right?

Hadlock
Nov 9, 2004

Copenhagen Suborbitals had a failed rocket test this week, here's a photo from the tear down that might be of interest to this thread

https://plus.google.com/photos/114657365514543526210/albums/6050839335905890753?banner=pwa

My Rhythmic Crotch
Jan 13, 2011

Hard to take away much from that. If anything, some of the photos show what look to be pitting in welds, or other welding flaws that could make things get explodey.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
I thought the joke was that the PCB label "CSduino" implies that the board is based on Arduino tech, and while the Copenhagen Suborbitals seem to generally know what they hell they're doing, Arduinos have developed a reputation as being "microcontrollers for babies/idiots".

Hadlock
Nov 9, 2004

The 7-30v DC input would generally rule out genuine arduino hardware, I would think.

I wouldn't be surprised if back of the napkin, initial prototypes began life as arduino sketches.

Dylan16807
May 12, 2010
http://copsub.com/technology-2/communication/

CSduino – an Arduino variation adapted for Copenhagen Suborbitals.

evensevenone
May 12, 2001
Glass is a solid.
Arduinos are just normal atmega processors with a bootloader, and a bunch of (lovely) C libraries and a terrible IDE. But you don't have to use the libraries or the IDE. avrdude supports the arduino bootloader even.

My Rhythmic Crotch
Jan 13, 2011

The just announced Intel Edison platform looks interesting, but I will probably hold off. The price for the bare module is okay, but by the time you start adding on the boards to do stuff, I don't feel like it's worth it. Plus who knows how good or bad the Linux support for all the peripherals will be. I've heard the support for the Galileo (a predecessor to this IIRC) was pretty terrible.

Tiger.Bomb
Jan 22, 2012

My Rhythmic Crotch posted:

The just announced Intel Edison platform looks interesting, but I will probably hold off. The price for the bare module is okay, but by the time you start adding on the boards to do stuff, I don't feel like it's worth it. Plus who knows how good or bad the Linux support for all the peripherals will be. I've heard the support for the Galileo (a predecessor to this IIRC) was pretty terrible.

anyone know how bootup is done? I am curious how it would work without BIOS/UEFI.

Zuph
Jul 24, 2003
Zupht0r 6000 Turbo Type-R

Tiger.Bomb posted:

anyone know how bootup is done? I am curious how it would work without BIOS/UEFI.

Per the HackADay comments, it's running UBoot.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
Atmel Studio 6.2 (set up for an ATtiny24) is taking this ISR handler code

code:
int ISR(TIM1_COMPA_vect)
{
    return 0;
}
and returning this warning message: "type of 'TIM1_COMPA_vect' defaults to 'int' [enabled by default]".

It spits up even more warnings if I remove the initial int or the return 0 which I don't think I've ever needed to include in an ISR declaration before. Any idea what is causing this issue?

carticket
Jun 28, 2005

white and gold.

Do you need to do ISR(int Name)? Normally your function attributes come before return type, but I don't know if that is required. I guess it depends on what the ISR macro expands to.

armorer
Aug 6, 2012

I like metal.

PDP-1 posted:

Atmel Studio 6.2 (set up for an ATtiny24) is taking this ISR handler code

code:
int ISR(TIM1_COMPA_vect)
{
    return 0;
}
and returning this warning message: "type of 'TIM1_COMPA_vect' defaults to 'int' [enabled by default]".

It spits up even more warnings if I remove the initial int or the return 0 which I don't think I've ever needed to include in an ISR declaration before. Any idea what is causing this issue?

I am pretty sure you should just do
code:
ISR(TIM1_COMPA_vect)
{ ... }
What warnings does it spit out in that case?

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.
^^^ That's the version of ISR I've always used and expected to work this time. It looks like the ISR macro isn't defined now though (see below).

Mr. Powers posted:

Do you need to do ISR(int Name)? Normally your function attributes come before return type, but I don't know if that is required. I guess it depends on what the ISR macro expands to.

That seems to work! And it led to another realization which is that the ISR macro doesn't seem to be defined anywhere. The compiler thinks I'm just declaring a new function named ISR which is why it wants me to be specific about argument and return types.

Now I just need to figure out why TIM1_COMPA_vect (and other common things like PORTA or DDRB) are properly defined in the AVR libraries for this chip but ISR is not. I'll dig into that tomorrow.

Thanks for the replies, both of you.

EpicCodeMonkey
Feb 19, 2011
It's definitely always:
code:
ISR(TIM1_COMPA_vect)
Which expands out to form a normal function prototype with a "void vector_[n](void)" signature. That's how it was before I re-wrote <avr/interrupt.h>, and that's how it's been since.

Include <avr/interrupt.h> to get rid of the undefined macro warning.

JawnV6
Jul 4, 2004

So hot ...

PDP-1 posted:

Atmel Studio 6.2 (set up for an ATtiny24) is taking this ISR handler code

code:
int ISR(TIM1_COMPA_vect)
{
    return 0;
}
and returning this warning message: "type of 'TIM1_COMPA_vect' defaults to 'int' [enabled by default]".

It spits up even more warnings if I remove the initial int or the return 0 which I don't think I've ever needed to include in an ISR declaration before. Any idea what is causing this issue?

This warning happened because TIM1_COMPA_vect wasn't defined. It thought you were declaring a new function, the warning was just a head's up that it thought TIM1_COMPA_vect was a variable declaration in the function header that it was inferring to be of type int. As EpicCodeMonkey mentioned, ISR's always have the signature of void func(void).

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

EpicCodeMonkey posted:

Include <avr/interrupt.h> to get rid of the undefined macro warning.

This seems to be the key thing I was missing. Previously I've always used ATMega chips and the Atmel Studio setup for those includes an asf.h file that then includes interrupt.h for you. It seems that the ATTiny setup doesn't have an asf.h analogue so I have to include things manually. Not a big deal once you know about it.

Thanks again for all the helpful comments.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
My wife was thinking of making a googly-eyed wreath for Halloween. I was wondering if there was something I could to make the eyes move and track something. This would be a lot of eyes on a wreath, so I don't think I could really control each one individually--unless we're talking like 10 servos for a buck or something. Can anybody think of any tricks?

JawnV6
Jul 4, 2004

So hot ...
Vibration motors won't give you positioning or tracking, but they might turn a static gravity-dominated thing into a quivering mass of eyeballs? Or look into making magnetic googly eyes.

You've got enough lead time to looks at really cheap motors. Last time I was in Shenzhen I picked up 10 motors for less than a dollar.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Rocko Bonaparte posted:

My wife was thinking of making a googly-eyed wreath for Halloween. I was wondering if there was something I could to make the eyes move and track something. This would be a lot of eyes on a wreath, so I don't think I could really control each one individually--unless we're talking like 10 servos for a buck or something. Can anybody think of any tricks?

Use a ferrous material for the pupils, have a ring of high powered electromagnets around the perimeter to control their gaze

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
You might be able to get a decent effect by having just a handful of eyes actually track and letting the others remain still or jiggle randomly.

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

peepsalot posted:

Use a ferrous material for the pupils, have a ring of high powered electromagnets around the perimeter to control their gaze

That doesn't really sound trick-or-treat safe, and a magnet strong enough to do that might interfere with home electronics.

A used LCD monitor might be able to make images you could build a Halloween wreath around.

Adbot
ADBOT LOVES YOU

TheresaJayne
Jul 1, 2011
You should only need 2 servos, one for X one for Y

and have a solid ring inside the wreath attached to them all so you can move them all in the same direction, and you can get software on a Raspi or Arduino to detect movement and move in that direction....

  • Locked thread