go_away

Author Topic: moving to stand alone microcontrolers. any suggestions?  (Read 926 times)

0 Members and 1 Guest are viewing this topic.

Offline blackbeardTopic starter

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
moving to stand alone microcontrolers. any suggestions?
« on: July 28, 2010, 05:14:17 AM »
For most of electronics projects i have used either a basic stamp 2 (back in the day) or an arduino. These have worked wonders for most projects but i hate scavinging projects simply so i can get my microcontroller back. so i'm thinking it's time to switch over to standalone microcontrolers where i can spend $5 on a chip and get a working project out of it that i wont need to break appart later. my question is this. should i go pic, atmel, or texis insturments? or should i get all the programmers and use a combination there of? is it harder to program on an atmel or pic chip then on an arduino? i'd think that C is C no matter the hardware but i've never really used them so i wouldn't know.
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: moving to stand alone microcontrolers. any suggestions?
« Reply #1 on: July 28, 2010, 05:29:25 AM »
Arduino is a easy version of C, easier than C with AVR or PIC or TI stuff, which makes heavy use of registers that can get very confusing. You can run Arduino on a standalone chip also, so that may be the best way

Offline blackbeardTopic starter

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: moving to stand alone microcontrolers. any suggestions?
« Reply #2 on: July 28, 2010, 07:05:56 AM »
Arduino is a easy version of C, easier than C with AVR or PIC or TI stuff, which makes heavy use of registers that can get very confusing. You can run Arduino on a standalone chip also, so that may be the best way

i've thought of that too but i'd really like to advance rather then stick with the same thing. i say this at the risk of sounding very noobish but are registers as you are refering to the same as logic gate registers that one might learn about in a digital electronics class? how do they work? i'll have to do a lot of research into how these things work but i'm verry keen on getting into it.
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: moving to stand alone microcontrolers. any suggestions?
« Reply #3 on: July 28, 2010, 08:05:08 AM »
Hmm if you want to advance, I'd say most microcontroller C is fairly similar, I started with AVR, and when I went to PIC and MSP430 I realized how its all basically the same thing, but register names are different (which can get annoying when I'm constantly switching between the 3  :P). I think AVR might be the best, because in Arduino you can actually use that kind of advanced low level code mixed in with the Arduino functions.

Registers are like the things you set to control the CPU... for example, in arduino, to set a pin high you would do digitalWrite(3,HIGH). In normal C, it would be PORT_ = 0x08;. The PORT_ register determines whether the pin is high or low. pinMode controls output or input, the actual register is DDR_.

Heres a little instructable I made about using these register manipulations in Arduino, it should get you started on using them: http://www.instructables.com/id/Arduino-is-Slow-and-how-to-fix-it/  Thats just for port switching, basically everything that goes on in the microcontroller is determined by the registers (so doing serial, doing ADCs, etc etc) The hard part isn't actually coding it, its just reading the datasheets and figuring out what all the registers are named and what they do
« Last Edit: July 28, 2010, 08:07:00 AM by Razor Concepts »

Offline vinito

  • Full Member
  • ***
  • Posts: 101
  • Helpful? 6
Re: moving to stand alone microcontrolers. any suggestions?
« Reply #4 on: July 28, 2010, 09:07:29 AM »
For standalone programming, you'll need an ISP programmer. Since you've already been using AVR with the Arduino, might as well (in my mind) stay with AVR and find a programmer to work with those. There are many offerings depending on what you want to do and what OS you want to do it on. Google "AVR ISP programmer" and see what you can find for price ranges and stuff. You should be able to find one for $20 - $40. Some folks are actually using an Arduino and made ISP programmers with them too.

If you are on Windows, it's hard to beat AVR Studio which is a free download from Atmel. You can edit, debug, simulate (same thing?) and program your chip directly from the one package, but you need a programmer which is compatible with it and many aren't, so make sure you get one that will work with it if you want to go this route (something like this). I use Linux most of the time, but I like AVR Studio so I've set up a Windows partition pretty much just for my microcontroller work. So yea, this is the route I have chosen to do just what you're considering.


If you are on Linux and want to stay that way, you can use AVRDUDE, AVRGCC, some kind of text editor and most any programmer to do it. Many do it this way and like it, but for me it was a little more tricky to put together so I got lazy and went the other route. There are also Linux applications made for working with AVR chips which work similar to AVR Studio, but they take more knowledge than I possess to set up and work (it doesn't take much for me to get above my raisin).

For Mac, I don't know what it takes, but seems like whatever works for Linux often works for Mac too. I can't offer much help with this due to ignorance.

Quick & easy:
1) Start with getting an AVR ISP programmer and download AVR Studio (and WinAVR, which works hand-in-hand with it).
2) "translate" some of your Arduino projects from the Arduino code into regular C to learn the language. It's similar, but different enough to be tricky at first. Maybe I'm warped, but I like learning this stuff.
3) use your programmer and program your chip with AVR Studio via the 6-pin ISP header on the Arduino rather than using the Arduino software and USB cord. This will be good practice and dead easy since you've already got an Arduino.

Once you've done this a few times, you're there! From here, you can pretty much buy any AVR chip you want *, use the datasheet to find out which pins are for the ISP programming, and use the exact same hardware and software to program them - maybe by just hooking it up with a breadboard if you want.

This advice comes from a rank newbie myself. I decided to learn how to do just this same thing a year or so ago. I have a local "guru" friend who has helped guide me through it and I recommend finding local help too if you can, but it's pretty simple so shouldn't be a problem to get to it yourself.

*Of course DIP packages are still easiest to deal with and some of the really powerful chips have 64 or 100 pins and do not have a dip package offering. But even with those, you can solder them to one of the various breakout boards made for that and be back in the saddle with header pins. All that power in the palm of your hand. Oh the humanity!
« Last Edit: July 28, 2010, 09:24:40 AM by vinito »

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: moving to stand alone microcontrolers. any suggestions?
« Reply #5 on: July 28, 2010, 01:12:47 PM »
have a read through the $50 robot tutorial to see what's involved in AVR development:
http://www.societyofrobots.com/step_by_step_robot.shtml

the PIC range also have similar development tools available.


dunk.

Offline blackbeardTopic starter

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: moving to stand alone microcontrolers. any suggestions?
« Reply #6 on: July 29, 2010, 05:34:38 AM »
thanks guys. both the instructable and the $50 robot guide seem to have allot of good info i'm going to absorb.
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

 


Get Your Ad Here