What do you guys think of the ATmega168 as a next step from the bs2? Not that theres nething wrong with my bs2 I just want to learn different languages and mcu's for a better understanding of it all.
It depends on what you plan to do with the ATmega168. If you're just going to use the Arduino software or even just the C/C++ toolchain, you're not going to learn that much about the microcontroller itself. Frankly, I would suggest using the Propeller, perhaps getting one of the new QuickStart boards. You can use Catalina for a C compiler, plus there's Spin, Assembly, PropBasic, and Forth. You should look at 12Blocks too for an example of a graphical programming system. ViewPort is a good debugging and development tool.
The ATmega168 is a nice chip to program in assembler and C, with good free tools and low-cost hardware. Plenty of support is available on the AVR Freaks forum. Get an AVR Dragon ($50) for programming and debugging.
From what ive gathered the atmega's can use multiply languages as long as you use the correct compiler? My main goal i guess is to learn C. Ive got a solid background in electronics now and want to program more.
If you can find a source the ATmega328P might be a better choice, simply as it has more memory. Otherwise, it's the same chip. The 328 is the one used in the latest Arduino Uno, so it's not quite as easy to find in stock. The two are more or less the same price.
Atmel offers their free coding tools, and there's the gcc toolchain, of course. There are some people that use the Arduino IDE (which extends gcc), but code in straight C. The IDE will create the hex files, which you then download via a programmer. For programmers there are a bunch in the $20 or $30 range. I have one from Pololu that's not bad.
It can be, er, um, a learning experience setting all this up. After doing it you get to appreciating the ease of getting started with something like the BS2.
The Propeller is a great chip for robots. I'm often frustrated reading Robot, Servo or Nuts & Nuts articles as the author struggles with keeping jitters out of their servos or they have some other timing problem that could have been easily solved with a Propeller.
I confess, I also plan to learn to use AVR's chips.
@Leon, Is "AVR Dragon" really needed for occasional programming? I'm willing to pay for programming tools if needed but I'd prefer free software if it's good enough.
I found a great kit here http://www.nerdkits.com/kits/ at 75 bucks with the programming guide ill prob be able to jump right in. Plus ive got loads of c, c+ ,c# books just begging to be used!
The prop is a good bridge between some of the micro's that use C. It is so easy to run a program that a beginner doesn't have to fight it. Once you get the hang of it, the concepts are there enough to move on if needed. Just try configuring the oscillator for usb on a pic32, for example of diffcult, or the dspic33 series.
If your goal is to learn C, then use your PC (or Mac or GNU/Linux powered machine, or whatever you have). I'd suggest you learn C first and then apply it to a uC. The ATMegas (any of them) are as easy to setup as the propeller and are very capable, have loads of peripherals and plenty of documentation.
I haven't used Catalina (for propeller programming) as I program the propeller only in assembler: the REAL only language that provides an alternative to a penitential robe ;-) . BTW, the propeller offers many advantages over an ATMega but they are really different beasts!
The AVR Dragon is an useful programming/debugging board, at some point you may need such capabilities.
As you want to learn C and this a Parallax forum, why not start with the Propeller and the Catalina C compiler?
Mind you with a Prop on the bench and the simplicity of programming in Spin/PASM with the Prop Tool or BST or PZST IDE's you may forget all about moving to C.
As for the AVRs I would get the biggest ones you can find and use the free avr-gcc C compiler. I have had good luck using a simple home made programming circuit and the free PonyProg download software.
You can even make a USB avr programmer out of a few resistors connected to a small avr and the avr-usb software.
wow i didn't know the prop was capable of soo many languages! Maybe I should go with a prop first and then move on to the more hardcore mcu's like atmega and straight pic's. From what I understand theyre alot more in depth to set up and configure. Not so "plug and play" like i'm used to with the bs2.
The ATmega168 is great! So is the propeller!
I suggest using them both. Sometimes they work well together as
well as separately. You might get more bang from the very similar
328p though...more flash.
I'd use WinAVR/GCC for the atmegas and Catalina for the Prop.
That way you will be learning C for both chips :-)
There are some very inexpensive USB programmers for the Atmel
chips available on ebay. We are talking 7-15 USD delivered.
I like combining the ATmega1284p and the Prop.
The 1284p has 128K of flash, 16K ram 4K eprom.
And runs at 20MIPS at 5v down to 4MIPS at 1.8v
costs 5.00 USD ea
O lol its an mcu that runs on C. I have a nice stack of books on C#....is that similar to C? Can C# be used on the prop? What are the advantages of one language over another on an mcu? Sorry for all the questions Im just rly excited to dive into programming.
Really? Why is that? Maybe i'm missing somthing but it seems like going from PBASIC-C-Assembly makes sense more than PBASIC-Assembly-C. Kinda like going from changing oil to making custom cam shafts. Maybe i'm missing somthing though.
You can't use C effectively unless you know something about the architecture of the chip you are using. Programming in assembler is the best way to learn about the chip.
O so each chip uses a slightly different version of Assembly? Like amd, intel, motorola (tablets), or pic, etc... Then C will build upon that speicific version of assembly based on the chip?
Leon is correct, there is a lot to be gained from knowing asm for
the particular uC you are working with. It is not an absolute must
though. Much good work can be done without low-level knowledge
of the uC. However, if you need to work near the limits of the uC a
working knowledge of asm can make the difference. C is very very
good but once in a while you must use asm to squeeze out that
last bit of goodness. I use C for probably 95%+ of my coding and
asm for the interrupt code that needs to do its job very quickly.
Once you know one flavor of asm then the skills quickly transfer
to any other uC. I learned asm on the 8 bit PIC uC. When I moved
to the Atmel chips it only took a few days to pick up that dialect
of asm. Asm on the Prop is really fun! there is a lot of power in each
32bit instruction...it's so versatile that you have to pay close attention
or you overlook ways to optimize your code.
For a beginner I have come to the conclusion that the best way to instruct
is to have a primer that starts from the very elementary steps of binary
math and logic and proceeds by giving simple and very detailed examples
of code and hardware using both C and asm to do the exact same tasks.
Learning C and asm side-by-side just makes sense to me. And if you already
know C or asm then the side-by-side examples make learning the other
language much easier.
The Prop1 and 2 could benefit from a primer that had examples of C, SPIN and
PASM for every exercise. For these uC's you really need a knowledge of all
three languages to do the best work possible.
Comments
Atmel offers their free coding tools, and there's the gcc toolchain, of course. There are some people that use the Arduino IDE (which extends gcc), but code in straight C. The IDE will create the hex files, which you then download via a programmer. For programmers there are a bunch in the $20 or $30 range. I have one from Pololu that's not bad.
It can be, er, um, a learning experience setting all this up. After doing it you get to appreciating the ease of getting started with something like the BS2.
-- Gordon
The Propeller is a great chip for robots. I'm often frustrated reading Robot, Servo or Nuts & Nuts articles as the author struggles with keeping jitters out of their servos or they have some other timing problem that could have been easily solved with a Propeller.
I confess, I also plan to learn to use AVR's chips.
@Leon, Is "AVR Dragon" really needed for occasional programming? I'm willing to pay for programming tools if needed but I'd prefer free software if it's good enough.
Duane
http://forums.parallax.com/showthread.php?113091-ULTIMATE-List-of-Propeller-Languages&highlight=ultimate
You can learn one language and move on to 174 others.
I haven't used Catalina (for propeller programming) as I program the propeller only in assembler: the REAL only language that provides an alternative to a penitential robe ;-)
The AVR Dragon is an useful programming/debugging board, at some point you may need such capabilities.
Mind you with a Prop on the bench and the simplicity of programming in Spin/PASM with the Prop Tool or BST or PZST IDE's you may forget all about moving to C.
As for the AVRs I would get the biggest ones you can find and use the free avr-gcc C compiler. I have had good luck using a simple home made programming circuit and the free PonyProg download software.
You can even make a USB avr programmer out of a few resistors connected to a small avr and the avr-usb software.
I suggest using them both. Sometimes they work well together as
well as separately. You might get more bang from the very similar
328p though...more flash.
I'd use WinAVR/GCC for the atmegas and Catalina for the Prop.
That way you will be learning C for both chips :-)
There are some very inexpensive USB programmers for the Atmel
chips available on ebay. We are talking 7-15 USD delivered.
I like combining the ATmega1284p and the Prop.
The 1284p has 128K of flash, 16K ram 4K eprom.
And runs at 20MIPS at 5v down to 4MIPS at 1.8v
costs 5.00 USD ea
And yeah ATmega1284p is a good choice as well for a uC. Comes in a Dip40 package so it's hobbyist friendly.
the particular uC you are working with. It is not an absolute must
though. Much good work can be done without low-level knowledge
of the uC. However, if you need to work near the limits of the uC a
working knowledge of asm can make the difference. C is very very
good but once in a while you must use asm to squeeze out that
last bit of goodness. I use C for probably 95%+ of my coding and
asm for the interrupt code that needs to do its job very quickly.
Once you know one flavor of asm then the skills quickly transfer
to any other uC. I learned asm on the 8 bit PIC uC. When I moved
to the Atmel chips it only took a few days to pick up that dialect
of asm. Asm on the Prop is really fun! there is a lot of power in each
32bit instruction...it's so versatile that you have to pay close attention
or you overlook ways to optimize your code.
For a beginner I have come to the conclusion that the best way to instruct
is to have a primer that starts from the very elementary steps of binary
math and logic and proceeds by giving simple and very detailed examples
of code and hardware using both C and asm to do the exact same tasks.
Learning C and asm side-by-side just makes sense to me. And if you already
know C or asm then the side-by-side examples make learning the other
language much easier.
The Prop1 and 2 could benefit from a primer that had examples of C, SPIN and
PASM for every exercise. For these uC's you really need a knowledge of all
three languages to do the best work possible.