> From: Behrooz
So you can evaluate my comments below, I am an Electrical Engineer (minor in
computer design) by training but spent my professional life as a software
developer (now retired) developing software for large communications/message
switching applications in financial networks.
I have a (hobby) interest in process control, communications, home
automation, etc. and selected the AVR as the family that best addressed my
needs.
So, with that intro, ...
> ....
> So my questions are:
> 1-
> Since I don't have very much spare time (as a hobbyist)in learning
> new
> programming language(and my fear of dealing with complex hardware
> details), do you think it is better for me to stick to the Bascom-Avr
> with my growing program size, or not??
In my opinion you will usually pay a code size/speed penalty for the 'ease'
that some higher-level languages (like Bascom-AVR) provide. A lot of what
they are doing for you is taking care of 'details' for you but they
sometimes have to do it in a 'general' way so as to satisfy the needs of a
variety of users.
I don't think that C would be much more difficult for you than structured
Basic, especially because you now have a level of familiarity for what the
AVR can do and how programming in the AVR environment works (edit, compile,
simulate, burn, test, etc. ...). You also now have a familiarity with
program flow, etc. that you didn't have before.
I would recommend that you give C a try with some small test programs and
then try converting your Bascom application.
The biggest 'learning curve' area will probably be in initializing the
various hardware devices and (if you want to use them) getting familiar with
interrupt-driven code. I'm not familiar with Bascom-AVR but I assume it
hides many of these details from you. You will quickly develop (or acquire
from this list and other Internet sources) code snippets that you can use
over and over.
Once you know C there isn't anything you can't do on the AVR except some
very specialized things (like task switching in an RTOS). Even those you
can do with WinAVR by dropping into assembler when you want to explore more.
> 2-
> If not, what is my best option? I saw good books on teaching
> CodeVision
> in book stores, but I read on the internet that WinAvr has alot more
> piece of code on the net (I used to copy-paste those pieces to my
> bascom and it was helpful, so more code samples may be decisive)
> Which one has less bug and is more common among C programers?
When I got into the AVR I purchased (and recommend) "Embedded C Programming
and the Atmel AVR" by Barnett, Cox & O'Cull. It seems to cover everything
without being too "high level" or getting you lost in a lot of detail. It
is written to be used with CodeVision but I use WinAVR.
For beginning, I'd recommend WinAVR (free) used with AVR Studio (free from
Atmel), a development board of your choice and the "Ice-Cube" Jtag device
from ECROS Technology
(http://www.ecrostech.com/AtmelAvr/AvrIceCube/index.htm).
AVR Studio will provide you framework to develop, compile, simulate, burn
and test your programs as well as set breakpoints, step, etc. in the target
system for debugging (using the Jtag device).
This is what I did in the beginning. Because my work is getting a little
more involved (RTOS's, Ethernet, etc.) I am now transitioning away from AVR
Studio to tools that come with WinAVR like Programmers Workbench (IDE-like
environment), AVRDude (burning, etc.), DBG (debugger), etc.
> 3-
> Is the C language exactly the same for WinAvr and CodeVision? Are C
> and
> C ANSI Identical? (sorry if specially the last question seems very
> basic)
Unfortunately there are some differences between the available C compilers
for the AVR (WinAVR, CodeVision, ImageCraft, etc.) particularly in the area
of bit fields, registers, interrupts, etc. and they all have their own
libraries with varying amounts of 'extras' so programs are slightly
different from compiler to compiler.
All of the software components I suggested (AVR Studio, WinAVR) are free, so
if you don't like them you can throw them away and it didn't cost you
anything :-)
> Thanks in advance for ur reply.
Well, my advice may be worth what you paid for it (i.e.: 0) but I'm sure
others on this list will jump in if I've led you astray :-)
Cheers,
Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck