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
Sir_Substance
Dec 13, 2013
Right. I've picked up one of those, I guess I'd better get reading up on things for the next 5-15 days while it's delivered.

Adbot
ADBOT LOVES YOU

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Cool, keep us updated.


I wish I still had my code for my final year PIC project that included an SD card for extra space. It was pretty clever (read: hackish and loving stupid)

Tres Burritos
Sep 3, 2009

What's the best choice device for learning / playing with? I've been working on a pcb design and I'm about ready to get it made by OSH Park. In the short term I just need to be able to write to a couple of pins every couple milliseconds. In the long term I'd like to be able to take the code that I've written and port it to a standalone device/microcontroller without too much work. Linux + Open source is good.

I've been thinking about a Beaglebone black, but would I be able to say write a program on it and then port it to a smaller avr? Or should I be looking at an arduino or something like that?

poo poo, is buying a cheap rear end DIP avr and a breadboard/Jtag just as good? I'm not looking to do anything too complicated in the near or far future.

carticket
Jun 28, 2005

white and gold.

Tres Burritos posted:

What's the best choice device for learning / playing with? I've been working on a pcb design and I'm about ready to get it made by OSH Park. In the short term I just need to be able to write to a couple of pins every couple milliseconds. In the long term I'd like to be able to take the code that I've written and port it to a standalone device/microcontroller without too much work. Linux + Open source is good.

I've been thinking about a Beaglebone black, but would I be able to say write a program on it and then port it to a smaller avr? Or should I be looking at an arduino or something like that?

poo poo, is buying a cheap rear end DIP avr and a breadboard/Jtag just as good? I'm not looking to do anything too complicated in the near or far future.

I'm a fan of the STM32 discovery boards. Some of them are as cheap as $15, and they have an STLink V2 debugger on board which is nice. They also have a header and can be used to program other boards with STM32s as well.

reading
Jul 27, 2013

Aurium posted:

What kinds of things are you doing with the piccolo?

Implementing a PID control loop to keep something at a constant temperature.

Unfortunately my attempts to implement the P, I, and D parts of the PID loop made it way worse than when I was simply telling the PWM's duty cycle "Increase duty cycle a bit if the value is too low. If the value is too high lower the duty cycle a bit".

The Piccolo has a "Control Law Accelerator", a specially designed CPU with FPU that is custom made for control loops, according to the docs. However, there's no compiler so as TI optimistically says in their sales brochures "It is fully programmable in assembly!" :suicide:

I think I can implement what I need on the main CPU though and have it work well enough, even without an FPU.

Aurium
Oct 10, 2010

reading posted:

The Piccolo has a "Control Law Accelerator", a specially designed CPU with FPU that is custom made for control loops, according to the docs. However, there's no compiler so as TI optimistically says in their sales brochures "It is fully programmable in assembly!" :suicide:

That's hilarious.

I read some of the marketing stuff that came out with the piccolo launchpad and waited a while to see if anyone would be able to take advantage of it's second core. TI put out some interesting demos that made it look really capable. So I've kind of wondered why there are basically no projects that have done anything with it.

Tres Burritos posted:

What's the best choice device for learning / playing with? I've been working on a pcb design and I'm about ready to get it made by OSH Park. In the short term I just need to be able to write to a couple of pins every couple milliseconds. In the long term I'd like to be able to take the code that I've written and port it to a standalone device/microcontroller without too much work. Linux + Open source is good.

I've been thinking about a Beaglebone black, but would I be able to say write a program on it and then port it to a smaller avr? Or should I be looking at an arduino or something like that?

poo poo, is buying a cheap rear end DIP avr and a breadboard/Jtag just as good? I'm not looking to do anything too complicated in the near or far future.

For something that simple you could use just about anything, but the approaches between a uC like an avr vs a beaglebone would make the resulting program pretty different. For non trivial things it isn't really a situation you'd really be be porting between. The scale between having a full os and a single thread with no os is really quite large. It can be done, Things like program flow are universal. You just look at it from a different angle. Also when you need some kind of multithreading in a uC you usually find a RTOS you like or a state machine, which can further remove it from larger computers.

So really where do you see your projects going? Do they need lots of CPU, like computer vision? Are your projects describable as computer and a thing? Do you really like programming linux? All of those are reasons to go with the beaglebone. An avr (or pic or stm32 or msp430) would usually be something that's more standalone, a bunch of lights. Sensor monitoring. Some machinery controller. A little robot.

If you've never done anything like it before, it's hard to call an arduino a bad choice. It's exceptionally fast to get running. It simplifies some things, and when you out grow those simplifications you can use it just like any other avr.

Tres Burritos
Sep 3, 2009

Aurium posted:

So really where do you see your projects going? Do they need lots of CPU, like computer vision? Are your projects describable as computer and a thing? Do you really like programming linux? All of those are reasons to go with the beaglebone. An avr (or pic or stm32 or msp430) would usually be something that's more standalone, a bunch of lights. Sensor monitoring. Some machinery controller. A little robot.

If you've never done anything like it before, it's hard to call an arduino a bad choice. It's exceptionally fast to get running. It simplifies some things, and when you out grow those simplifications you can use it just like any other avr.

Definetly the latter. The more I think about it what I'm really looking for is a microcontroller that has dev tools that are free and worth a drat. Does Atmel studio stack up? It looks like it has an okay debugger.

So with atmel studio I could use a JTAG cable to flash and debug, and I wouldn't have to worry about compilers?
I messed around with PIC for a while and I vaguely recall that you had to like purchase compilers, is that not the case for AVR?

yippee cahier
Mar 28, 2005

Tres Burritos posted:

Definetly the latter. The more I think about it what I'm really looking for is a microcontroller that has dev tools that are free and worth a drat. Does Atmel studio stack up? It looks like it has an okay debugger.

So with atmel studio I could use a JTAG cable to flash and debug, and I wouldn't have to worry about compilers?
I messed around with PIC for a while and I vaguely recall that you had to like purchase compilers, is that not the case for AVR?

I'm pretty happy using Atmel Studio. I used it with external makefiles which probably caused my debugger annoyances by not compiling with the settings it expected. Never tried with a native project, but I imagine it's pretty slick.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Atmel Studio is basically a customized version of Visual Studio which is great as far as IDEs go. AVR uses a custom version of GCC and has flash utilities and all that.

reading
Jul 27, 2013

Aurium posted:

That's hilarious.

I read some of the marketing stuff that came out with the piccolo launchpad and waited a while to see if anyone would be able to take advantage of it's second core. TI put out some interesting demos that made it look really capable. So I've kind of wondered why there are basically no projects that have done anything with it.



The math library they include with it only has trig functions, which as far as I can see have almost no relation to Control Laws which is what you'd expect for a Control Law Accelerator. The math libs make it a Trigonometry Accelerator.

The main CPU operates at 80MHz which I expect will be just fine for my 100kHz PWM controller, even without an FPU. If I were going to code an extra core in assembly then I may as well use the PRU (the two hidden cores) in the beaglebone.

EDIT: After working on this thing for a few minutes this morning, I got the code which previously wouldn't work or run to work just by adding a breakpoint. CCS is a weird beast, and I notice that sometimes in the debug/"run" mode I have to hit play, pause, play, and then it works. Other times I have to reset the thing a few times before the chip runs. It's like CCS isn't always able to start the chip after flashing it with the new program, it has to be manually jump-started like an old lawnmower.

I do really like CCS' built in graphing ability though. Being able to come back from lunch and see a great graph of a watched expression is useful. I haven't yet tried out the scripting ability to run a sequence of tests.

reading fucked around with this message at 17:44 on Feb 7, 2014

Luigi Thirty
Apr 30, 2006

Emergency confection port.

What do I need to buy to be able to do on-chip debugging with my Arduino? I'm using Atmel Studio, not the Arduino software.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

Luigi Thirty posted:

What do I need to buy to be able to do on-chip debugging with my Arduino? I'm using Atmel Studio, not the Arduino software.

AVR Dragon

Rescue Toaster
Mar 13, 2003
Atmel Studio & Dragon is great. I think there was some touchy-ness with the debugwire mode, there's some guides on how to do it without getting the control stuck in no-ISP mode. And you have to watch what circuitry you have on the reset pin.

People bitched like crazy over on the avrfreaks forums about the new VS-based studio. But VS2010 is freaking fantastic compared to most embedded software IDEs.

Tres Burritos
Sep 3, 2009

Rescue Toaster posted:

Atmel Studio & Dragon is great. I think there was some touchy-ness with the debugwire mode, there's some guides on how to do it without getting the control stuck in no-ISP mode. And you have to watch what circuitry you have on the reset pin.

People bitched like crazy over on the avrfreaks forums about the new VS-based studio. But VS2010 is freaking fantastic compared to most embedded software IDEs.

Yeah I briefly tried out PIC and their IDE and that thing was loving awful.

JawnV6
Jul 4, 2004

So hot ...
Is there a way to get TI's CCS to show me the assembly output without a target present?

This is a stupid question but searches either end up on the Disassembly pane, which appears to require a target present to populate, or in Assembler-only project directions, which don't apply since I'm working in C. I have some questions about how things are getting laid out in memory that would be trivial to check if I had the assembly listing easily available.

Tiger.Bomb
Jan 22, 2012

ImDifferent posted:

Little microcontroller-based CTF hacking competition:

http://www.matasano.com/matasano-square-microcontroller-ctf/

MSP430-based, no less.

This is a ton of fun. Just got to the 100-point levels.

movax
Aug 30, 2008

JawnV6 posted:

My hardware guy didn't even give me LED's on the last board. :argh:

Why do you need LEDs, you have a debugger and a scope to probe a test-point / some other pin of you need it? :angel:

- hw guy

Slanderer
May 6, 2007

movax posted:

Why do you need LEDs, you have a debugger and a scope to probe a test-point / some other pin of you need it? :angel:

- hw guy

Our hardware guys think actual testpoints are a luxury that we do not deserve (or if they do, they hide them underneath daughterboards / on the underside of boards mounted to test fixtures)

carticket
Jun 28, 2005

white and gold.

Slanderer posted:

Our hardware guys think actual testpoints are a luxury that we do not deserve (or if they do, they hide them underneath daughterboards / on the underside of boards mounted to test fixtures)

Blame the layout guy. He saw that big area with a low clearance and that's the perfect place to put all those zero height test points.

movax
Aug 30, 2008

Slanderer posted:

Our hardware guys think actual testpoints are a luxury that we do not deserve (or if they do, they hide them underneath daughterboards / on the underside of boards mounted to test fixtures)

I do a lot of my own layout these days, and I usually layout things in a way that will make my life easier in ~two weeks when I'm in the lab doing bring-up on the drat thing. No reason to make myself suffer, so it's usually win-win-win!

Except I'm fighting an up-hill battle at my new job in terms of making readable schematics...we've got guys treating it like software and making these ridiculously over-abstracted hierarchical abortions where you can't even use Ctrl+F to follow net names around the schematic :nms:

FSMC
Apr 27, 2003
I love to live this lie

Tiger.Bomb posted:

This is a ton of fun. Just got to the 100-point levels.

I managed to get 115 points, but now am completely stuck. I don't know if I'm suppose to use the techniques already used in creative ways or if there are new techniques I should be using but I have a knowledge gap.

carticket
Jun 28, 2005

white and gold.

Tiger.Bomb posted:

This is a ton of fun. Just got to the 100-point levels.

This is pretty rad. The lovely browser at work is making it slow and some solutions just don't work (enter the same password twice and it works the second time...). I'll play with this more when I get home.

Scaevolus
Apr 16, 2007

FSMC posted:

I managed to get 115 points, but now am completely stuck. I don't know if I'm suppose to use the techniques already used in creative ways or if there are new techniques I should be using but I have a knowledge gap.

You can drop by freenode/#uctf for hints if you get stuck.

Tiger.Bomb
Jan 22, 2012

FSMC posted:

I managed to get 115 points, but now am completely stuck. I don't know if I'm suppose to use the techniques already used in creative ways or if there are new techniques I should be using but I have a knowledge gap.

The first ten levels are _very_ basic. You're pretty much always doing some kind of overflow. Figuring out what you need to overflow it with is the trick.

carticket
Jun 28, 2005

white and gold.

Tiger.Bomb posted:

The first ten levels are _very_ basic. You're pretty much always doing some kind of overflow. Figuring out what you need to overflow it with is the trick.

I just got to the first overflow level. I need to remember to look at the conditions for unlock before digging into the login/password function. Hanoi would have been much faster if I had approached it that way.

ImDifferent
Sep 20, 2001
I'm up to about 665 points, but haven't touched it in a while. It started to exceed the amount of time I'm willing to put into it :(

Favourite so far: Alphanumeric-only shellcode

reading
Jul 27, 2013
What exactly is shellcode? It's not bash scripting? I've heard it has something to do with virus shells? what?

BobaFett
Jun 4, 2004

ImDifferent posted:

I'm up to about 665 points, but haven't touched it in a while. It started to exceed the amount of time I'm willing to put into it :(

Favourite so far: Alphanumeric-only shellcode

I'm curious how you completed that one, Lagos right? I completed it without the alphanumeric code since I gave up trying to work with only a few usable op codes, so it'd be interesting to see what one would look like. How many bytes? Could you pm me your input for it if you feel like sharing?

I've gotten to Chernobyl but it's to that point as well, too much time I'm willing to put into it at the moment.

Tiger.Bomb
Jan 22, 2012

reading posted:

What exactly is shellcode? It's not bash scripting? I've heard it has something to do with virus shells? what?

It's basically [text] input that will later be interpreted as code. The name comes from the fact that typically the code does not a lot more than spawn a shell (at the permission level of the application you exploited)

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Tiger.Bomb posted:

The first ten levels are _very_ basic. You're pretty much always doing some kind of overflow. Figuring out what you need to overflow it with is the trick.

Thanks for ruining the sense of accomplishment I got from doing the first eight levels :smith:

carticket
Jun 28, 2005

white and gold.

Speaking of things that aren't basic. Has anyone used ChibiOS? I'm getting a crash at startup and it looks like it is switching to a corrupted context. It started out frequently happening at startup, but now it's maybe a 1/50 sort of thing. I had a similar problem when I first set the project up and it was related to interrupt stacks, and it being intermittent is driving me crazy.

some kinda jackal
Feb 25, 2003

 
 
Have to give some props to MAKE: AVR Programming:

http://shop.oreilly.com/product/0636920028161.do

Pretty good book for idiots like me. Explains a lot of things in detail. If you're new to embedded development and want to learn AVR stuff, this one seems pretty solid from my initial readthough.

ImDifferent
Sep 20, 2001

BobaFett posted:

Could you pm me your input for it if you feel like sharing?

PM'd. hosed if I can remember how it worked. Took me a good while to figure out, that's all I can remember.

Tiger.Bomb
Jan 22, 2012

ante posted:

Thanks for ruining the sense of accomplishment I got from doing the first eight levels :smith:

haha every level I pass makes the others feel super easy. Still an accomplishment, they just seem so obvious after.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Finally got my Dragon, got my shift register, 4-digit LED, thermal sensor, big box of resistors, plugged a wire one hole off on the breadboard, plugged it in, and promptly blew up the ATMega. :suicide: Time to shell out for that clone with fuses on every pin I guess.

EpicCodeMonkey
Feb 19, 2011
Sure you killed it? The ATMEGAs are actually quite hardy, unless you drive it with a high amperage over a long period of time. Usually you end up killing the I/O driver for the GPIO pin you connected to incorrectly, but the core and other I/Os survive. Of course once done the chip is suspect and should be replaced as possible, but it might limp on for testing in the meantime.

Delta-Wye
Sep 29, 2005
Vcc/gnd swap? :smith:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

EpicCodeMonkey posted:

Sure you killed it? The ATMEGAs are actually quite hardy, unless you drive it with a high amperage over a long period of time. Usually you end up killing the I/O driver for the GPIO pin you connected to incorrectly, but the core and other I/Os survive. Of course once done the chip is suspect and should be replaced as possible, but it might limp on for testing in the meantime.

The board connects and shows up on my computer but I get a flash memory error when I try to write a test program to it. I just ordered a new chip since they're $4 and I have the programming board to write a bootloader.

No Gravitas
Jun 12, 2013

by FactsAreUseless

Delta-Wye posted:

Vcc/gnd swap? :smith:

Ah the memories. I have done this or other similar mistakes. Thankfully, I use the PIC. I can always order more free samples. Both sides have vastly profited from this arrangement.

Adbot
ADBOT LOVES YOU

Rescue Toaster
Mar 13, 2003
Well, the arm-none-eabi toolchain has come a long way in ease of use. I was able to setup Eclipse 4.3, the arm plugin, the toolchain, openocd, and run hello world on my old stm32f4discovery in about 30 minutes (on windows, even). Pretty nice!

I wonder if the best way to get the various headers and cpu-specific stuff is to install atollic and rip it out of there.

Rescue Toaster fucked around with this message at 19:38 on Feb 16, 2014

  • Locked thread